Skip to main content

system.kanoa.quality.config.setChkItemDataSource(dataSourceInfo, userId)

Sets the tag a check item reads its value from without an attribute, replacing any it had. A check reads either an attribute's data source or its own tag, so a check linked to an attribute is refused.


Parameters​

dataSourceInfo Dictionary

- chkItemIdInteger
- sourceTagPathStringNone or blank removes the check item's tag
- scaleFactorFloatCan be None
- ignoreZeroValuesBooleanA zero is read as no value. None is False
- enabledBooleanNone is True

userId Integer: Id of the user executing the function


Returns​

(chkItemDataSourceId, msg): the id and None, None and None when the tag was removed, or None and the reason nothing was changed


Example​

#Check 47 reads the line's supply temperature, which isn't specific to an asset
dataSourceInfo = {'chkItemId': 47, 'sourceTagPath': '[Kanoa]Utilities/Supply Temperature', 'scaleFactor': None, 'ignoreZeroValues': True}
userId = 5
chkItemDataSourceId, msg = system.kanoa.quality.config.setChkItemDataSource(dataSourceInfo, userId)

#Remove it again
chkItemDataSourceId, msg = system.kanoa.quality.config.setChkItemDataSource({'chkItemId': 47, 'sourceTagPath': None}, userId)