Skip to main content

system.kanoa.event.addModeEvent(assetId, field, value, tStamp, modeSourceId, userId)

Adds a new modeEvent record with a single value to the specified mode event table column such as modeCode, workOrderId, or itemId fields This function updates a single field to support tag change events where the mode might, change then the itemName, then the work order


Parameters

assetId Integer: Id of asset
field String: i.e column to change
value pyObject: corresponds to the column data type
tStamp DateTime: Time stamp of mode event
modeSourceId Integer: Whether this is coming from the schedule, operator or plc (tag change)
userId Integer


Returns

modeEventId Integer
message String None if success


Example

assetId = 123
field = 'modeCode'
value = 1
tStamp = system.date.now()
modeSourceId = 1
userId = 123
modeEventId, msg = system.kanoa.event.addModeEvent(assetId, field, value, tStamp, modeSourceId, userId)