onChangeScope

The "onChangeScope" property specifies which tags the connector saves to an integration table. 
It is an optional enumerated string with the following values:

  • "saveAllTags" (default) 
    • The connector saves all collected tags to the integration table. 
  • "saveOnlyChangedTags" 
    • The connector persists tags with values that have changed from their previous value. If no "onChange" rules are defined, then all values are considered changed.
  • "saveSpecificTags" 
    • The connector persists the tags specified in the "onChangeScopeTags" property. 
    • It requires the "onChangeScopeTags" property to exist and specify one or more tags. 

Use cases

  • When you want to consistently collect the same data, set "onChangeScope" to "saveAllTags". This approach ensures transforms and queries always have all the data. Unless the "onChangeTrigger" property is set to "saveWhenAllTagsHaveChanged" tags are saved even when their value has not changed. 
  • When you want to save space in an integration table, set "onChangeScope" to "saveOnlyChangedTags". This approach also saves space in MQTT messages and other services that FairCom Edge delivers to.
  • When you want to save space in the integration table while persisting the same subset of tags, set "onChangeScope" to "saveSpecificTags". This approach allows the connector to collect additional tags to trigger persistence without persisting those tags.

 

 

Code Example

{
 "api": "hub",
 "action": "createInput",
 "params": {
   "inputName": "modbusTCP",
   "serviceName": "modbus",
   "tableName": "modbusTableTCP",
   
   "dataCollectionIntervalMilliseconds": 1000,
   
   "dataPersistenceStrategy": "onChange",
   "onChangeScope": "saveSpecificTags", 
   "onChangeScopeTags": ["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 following properties work together to save meaningful data changes.
    • "dataPersistenceStrategy"
    • "maxUnsavedEvents"
    • “normalLowerLimit”
    • "normalUpperLimit"
    • "deadbandLowerLimit"
    • "deadbandUpperLimit"
    • "significantMagnitude"
    • "onChangeScope"
    • "onChangeScopeTags"
    • "onChangeTrigger"
    • "onChangeTriggerTags"