system.mes.oee.updateEquipmentStateValue

Sepasoft MES Module Suite

system.mes.oee.updateEquipmentStateValue

Change the reason for a downtime event for a line or cell group based on a state timestamp.

system.mes.oee.updateEquipmentStateValue and updateEquipmentStateValues now reject a blamed-equipment change that leaves the current MES line. Same-line changes stay allowed. This is in MES 3.81.13 SP3 and MES 4.83.3 SP3.

A call that passes equipment on another line throws:

Cannot change downtime equipment from '<reason path>' to '<new path>' because they are on different lines.

Syntax

system.mes.oee.updateEquipmentStateValue(equipmentPath, reasonEquipmentPath, newEquipmentPath, stateTimeStamp, newStateCode)

Parameters

String  equipmentPath — The equipment path for the line, or, if managing downtime events for a cell group, the equipment path for the cell group.

String  reasonEquipmentPath — The equipment path for the original equipment that caused the downtime event.

String  newEquipmentPath — The equipment path for the new equipment to blame for the downtime event. Use the same path as the currently blamed equipment to change only the reason. To change blamed equipment, the new path must be on the same MES line as reasonEquipmentPath (another cell on that line, or the line itself). An empty path keeps the reason equipment. In MES 3.81.13 SP3, MES 4.83.3 SP3, and later, a path on a different line is rejected with: Cannot change downtime equipment from '...' to '...' because they are on different lines.

Date  stateTimeStamp — The timestamp of the state that is at the source of the downtime event.

The state timestamp is not always the same as the downtime event timestamp. Using the downtime event timestamp will not always produce consistent OEE downtime event durations.

Integer  newStateCode — The new equipment state code as an integer. This value should match a code assigned to a state associated with the specified equipment.

Returns

Nothing

Scope

All

Notes

Changing blamed equipment to another cell or the line is still allowed when the state’s override scope is Any Equipment State. If that scope is not set, the call throws Selected state must have 'Any Equipment State' override scope. Equipment on a different line is never allowed, including from a script.

Code Examples

Changing the equipment state on Sealer to 3:

Python
equipment_path = 'Enterprise\\Site\\Area\\Line 2'
reason_equipment_path = 'Enterprise\\Site\\Area\\Line 2\\Sealer'
new_equipment_path = 'Enterprise\\Site\\Area\\Line 2\\Sealer'
new_state = 3

system.mes.oee.updateEquipmentStateValue(equipment_path, reason_equipment_path, new_equipment_path, time_stamp, new_state)

Changing the equipment state to 3 and blaming the filler. Sealer and Filler are on the same line:

Python
equipment_path = 'Enterprise\\Site\\Area\\Line 2'
reason_equipment_path = 'Enterprise\\Site\\Area\\Line 2\\Sealer'
new_equipment_path = 'Enterprise\\Site\\Area\\Line 2\\Filler'
new_state = 3

system.mes.oee.updateEquipmentStateValue(equipment_path, reason_equipment_path, new_equipment_path, time_stamp, new_state)

Related Functions

Sepasoft MES Module Suite