The optional "tagName" property assigns a tag to a value collected by a connector. Use the "createInput" or "createOutput" actions to create a connector that collects tags from a device or delivers tags to a device.
- It is a best practice to assign a tag to each collected value instead of the
"propertyPath". - A tag lets FairCom Edge track the provenance of a data value from data collection through data delivery.
- A tag automatically synchronizes
source_payloadproperties between corresponding user-defined table fields. - A tag provides additional information about the collected value.
- The
"tagName"property goes in the"propertyMapList"object. - A tag must exist before you can create an input or output connector that uses it.
- It is a best practice for users to use the tag's name to specify a tag because it is a human friendly name.
- It is a best practice for applications to use the tag's ID to specify a tag because it is immune to UTF-8 malicious attacks.
- In a request, the
"tagId","tagName", and"propertyPath"are mutually exclusive. - A response includes both the
"tagName"and"tagId"properties when a tag is assigned to a data value in a property map. - A response includes the
"propertyPath"property only when no tag is assigned to a data value in a property map.
See also "tagId".
Example creating a tag, a thing, an input connector that uses them
The following "createTag" action creates a tag named "plc74_modbus_temperature" that is stored in the "temperature" table. It maps the tag to the temperature_celsius field and to the "celsius" property in the source_payload field.
{
"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 "createThing" action creates a thing named "plc74", which represents a PLC in the factory.
{
"action": "createThing",
"params": {
"name": "PLC 74"
},
"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 value from input register 2000 to the tag named "plc74_modbus_temperature", which defines where the 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"
}If the "tableName" specified at the Input is not equal to the one specified in one of its tags, return an error "Table assigned to tag TTT does not match the table assigned to connector CCC".