The optional "thingName" property associates a connector to a device or software application.
In a request, the "thingName" and "thingId" properties are mutually exclusive.
When a thing is assigned to a connector, both the "thingName" and "thingId" properties are included in a response.
Assigning a thing to each connector lets FairCom Edge track where collected values come from and are delivered.
Note A connector is created using the
"createInput"or"createOutput"actions.
See also"thingId".
Example creating a thing, a tag, and an input connector that uses them
The following "createThing" action creates a thing named "PLC 74".
{
"action": "createThing",
"params": {
"thingName": "PLC 74"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}The following "createTag" action creates a tag named "plc74_modbus_temperature", which maps the tag to the "celsius" property in the source_payload field and the "temperature_celsius" field in the "temperature" table.
{
"action": "createTag",
"params": {
"tagName": "plc74_modbus_temperature",
"tableName": "temperature",
"tagDataType": "number",
"sourceFieldName": "temperature_celsius",
"sourcePayloadPath": "celsius",
"purpose": "Track Celsius Temperatures from devices"
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}The following "createInput" action creates an input connector that collects data from the thing named "PLC 74" and stores it in the temperature table. It also maps the data value from input register 2000 to the tag named "plc74_modbus_temperature", which defines where the data value is stored in the table. In this case, the tag stores the value in the "temperature_celsius" field and in the "celsius" property in the source_payload field.
{
"action": "createInput",
"params": {
"inputName": "INPUT: PLC 74 & Modbus",
"serviceName": "modbus",
"thingName": "PLC 74",
"tableName": "temperature",
"settings": {
"modbusProtocol": "TCP",
"modbusServer": "127.0.0.1",
"modbusServerPort": 502,
"modbusDataCollectionIntervalMilliseconds": 15000,
"propertyMapList": [
{
"tagName": "plc74_modbus_temperature",
"modbusDataAddress": 2000,
"modbusDataAccess": "inputRegister",
"modbusUnitId": 5,
"modbusDataLen": 1
}
]
}
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}Tips You can substitute the
"thingId"property for"thingName".
You can also substitute the"tagId"property for"tagName".