The "alterOutput" action alters an existing output connector in FairCom Edge to deliver tags automatically to a device or software system. Before you can change an output, you must use "createOutput" to create it.
Note A tag is a piece of named data with an associated value. For example, the tag
temperature 70includes both the named data temperature and the value70. In JSON, a tag is a JSON property, such as"temperature": 70. In a SQL table, a tag is a data field, such as a field named temperature with a value of70.
- You can change the source field of the integration table that supplies the data for the plugin.
- You can change the data format of the source field.
- You can change the settings of an integration.
- You can change metadata to make the integration easier to locate.
- You cannot change the plugin or the integration table.
- You will need to create a new integration.
- An integration connects data in the server to a plugin that delivers data from the server to external systems, such as connecting the integration table populated by OPC UA to the ThingWorx connector.
Note Use
"configureTopic"to connect MQTT to an existing integration table.
Request examples
Minimal
{
"action": "alterOutput",
"params": {
"outputName": "writeEverythingToModbus",
"settings": {
"modbusProtocol": "TCP",
"modbusServer": "localhost",
"propertyMapList": [
{
"propertyPath": "source_payload.temperature",
"modbusDataAddress": 1199,
"modbusDataAccess": "holdingregister",
"modbusUnitId": 5,
"modbusDataLen": 1
}
]
}
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Maximal
{
"api": "hub",
"action": "alterOutput",
"params": {
"outputName": "writeTemperatureToModbus",
"databaseName": "faircom",
"sourceFields": [
"source_payload"
],
"settings": {
"modbusProtocol": "TCP",
"modbusServer": "localhost",
"modbusServerPort": 502,
"propertyMapList": [
{
"propertyPath": "source_payload.temperature",
"modbusDataAddress": 1199,
"modbusDataAccess": "holdingregister",
"modbusUnitId": 5,
"modbusDataLen": 1
}
],
"sourceDataField": "source_payload",
"sourceDataFormat": "JSON"
},
"metadata": {
"description": "This output copies the source_payload.temperature property to the Modbus listener at localhost.",
"tags": [
"temperature"
]
}
},
"responseOptions": {
"binaryFormat": "hex",
"dataFormat": "objects",
"numberFormat": "string"
},
"authToken": "replaceWithAuthTokenFromCreateSession",
"requestId": "2",
"debug": "max"
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
databaseName |
The You specify this property when you want to use a different database instead of the default. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
enabled |
The "enabled" property turns on or off an input or output connector. Thus, it pauses or starts data collection or delivery. |
Optional with default of true
|
Boolean |
|
metadata |
The "metadata" property contains user-defined properties that add keywords and tags about the code package. The server indexes this field with a full-text index so you can search for any word or phrase to find code packages. |
Optional with default of {}
|
object | 0 or more key/value pairs |
outputName |
The "outputName" property specifies a unique name for mapping an integration table to an output plugin to an external system. A FairCom generated name follows the pattern "Output #n from <databaseName>.<schemaName>.<tableName> to <pluginName>". |
Optional with default of |
string | 1 to 64 bytes |
settings |
The Connector-specific "settings" |
Optional with default of {}
|
object | |
sourceFields |
The An integration table has many fields, such as fields populated by transforms and MQTT. Converting all fields into JSON is slower than converting only the fields needed by the output connector. For example, input connectors and MQTT messages store their data in the When you configure an output connector, you add |
Optional with default of []
|
array | One or more fields form the integration table. |
Response properties ("result")
| Property | Description | Type | Limits (inclusive) |
|---|---|---|---|
data |
The |
array of objects | The action determines its contents. |
|
data .enabled |
|
boolean |
truefalse
|
|
data .running |
The "running" property is true when an input connector is collecting data or an output connector is delivering data; otherwise, it is false. A disabled connector will never be running. An enabled connector may or may not be running. |
Boolean |
|
|
data .stopCode |
The "stopCode" property is 0 when the connector is successfully connected to its device or software; otherwise, it is non-zero. |
integer |
-2147483648 to 2147483647
|
|
data .stopReason |
The "stopReason" property is "" when the input connector is collecting data; otherwise, it is a non-empty string. |
string | 0 to 256 bytes |