system.mes.oee.updateEquipmentStateValues

Sepasoft MES Module Suite

system.mes.oee.updateEquipmentStateValues

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

This is useful to update multiple downtime events when they are rolled up into a single entry.

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

Python
system.mes.oee.updateEquipmentStateValues(equipmentPath, reasonEquipmentPath, newEquipmentPath, fromStateTimeStamp, toStateTimeStamp, newStateCode) system.mes.oee.updateEquipmentStateValues(equipmentPath, reasonEquipmentPath, newEquipmentPath, fromStateTimeStamp, toStateTimeStamp, includeShortStops, 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  fromStateTimeStamp — The starting timestamp to begin updating downtime events.

Date  toStateTimeStamp — The ending timestamp to end updating downtime events. fromStateTimeStamp must be earlier than or equal to toStateTimeStamp.

Boolean  includeShortStops — Optional. Set to True to include short stop downtime events. When this argument is omitted, short stops are included.

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

Each matching event is updated with the same rules as system.mes.oee.updateEquipmentStateValue. 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 for all states between the begin and end timestamps:

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.updateEquipmentStateValues(equipment_path, reason_equipment_path, new_equipment_path, begin, end, new_state)

Changing the equipment state to 3 and blaming the filler for all states between the begin and end timestamps. 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.updateEquipmentStateValues(equipment_path, reason_equipment_path, new_equipment_path, begin, end, new_state)

The same call, excluding short stops:

Python
system.mes.oee.updateEquipmentStateValues(equipment_path, reason_equipment_path, new_equipment_path, begin, end, False, new_state)

Related Functions


Sepasoft MES Module Suite