onChangeTriggerTags

The "onChangeTriggerTags" property is an array of strings that specifies tags to work with the "onChangeTrigger" property to control when a connector saves collected data to an integration table. Each "propertyPath" value is the connector's unique identifier to a collected data item, which is commonly called a "tag". This property is required when the "onChangeTrigger" property has one of the following values: "saveWhenAnySpecifiedTagHasChanged" or "saveWhenAllSpecifiedTagsHaveChanged".


The following code excerpt triggers a save event when the value of the "temperature" tag changes.

"onChangeTrigger": "saveWhenAnySpecifiedTagHasChanged",
"onChangeTriggerTags": [ "temperature" ]


Code Example

{
 "api": "hub",
 "action": "createInput",
 "params": {
   "inputName": "modbusTCP",
   "serviceName": "modbus",
   "tableName": "modbusTableTCP",
   
   "dataCollectionIntervalMilliseconds": 1000,
   
   "dataPersistenceStrategy": "onChange",
   "onChangeTrigger": "saveWhenAnySpecifiedTagHasChanged",
   "onChangeTriggerTags": ["t1"],

   "settings": {
     
     "modbusProtocol": "TCP",
     "modbusServer": "127.0.0.1",
     "modbusServerPort": 502,
     
     "propertyMapList": [
       {
         "propertyPath": "temperature",
         "modbusDataAccess": "holdingregister",
         "modbusDataAddress": 4003,
         "modbusDataType": "int8Signed"
       }
     ]
     
   }
 },
 "authToken": "replaceWithAuthTokenFromCreateSession"
}

 

Notes
 

  • The connector uses this property only when the "dataPersistenceStrategy" is "onChange"
  • The "createInput" and "alterInput" actions return an error wen aspecified tag name is not defined.
  • The "createInput" and "alterInput" actions return an error if you assign a value to "onChangeTriggerTags" and the "onChangeTrigger" property is not set to "saveWhenAnySpecifiedTagHasChanged" or "saveWhenAllSpecifiedTagsHaveChanged".
  • The following properties work together to save meaningful data changes.
    • "dataPersistenceStrategy"
    • "maxUnsavedEvents"
    • “normalLowerLimit”
    • "normalUpperLimit"
    • "deadbandLowerLimit"
    • "deadbandUpperLimit"
    • "significantMagnitude"
    • "onChangeScope"
    • "onChangeScopeTags"
    • "onChangeTrigger"
    • "onChangeTriggerTags"