Equipment Configuration Script Examples

Sepasoft MES Module Suite

OEE Configuration Script Example

Scripting Functions in example:

system.mes.getCurrentEquipmentStates

system.mes.getEquipmentModeHistory

system.mes.getEquipmentModeOptions

system.mes.getEquipmentScheduleEntries

system.mes.getEquipmentStateHistory

system.mes.getEquipmentStateOptions

Obtain Equipment State Configuration Data Example

Python
hdr = ['equipPath', 'stateName', 'stateCode', 'stateType']
newData = []
 
 
equipPath = '\Nuts Unlimited\Folsom\Receiving\Line 1'
     
if equipPath != '':
    data = system.mes.getEquipmentStateOptions(equipPath, "", "")
    for item in data:
        stateName = item.getName()
        if item.getMESObjectType().getName() == 'EquipmentStateClass':
            pass
        else:          
            stateCode = item.getStateCode()
            stateType = item.getStateTypeName()
            newData.append([equipPath, stateName, stateCode, stateType])
 			
eqStates = system.dataset.toDataSet(hdr, newData)  
for row in range(eqStates.rowCount):
   for col in range(eqStates.columnCount):
      print eqStates.getValueAt(row, col)

Output

Python
 [global]\Nuts Unlimited\Folsom\Receiving\Line 1
Unplanned Downtime
3
Unplanned Downtime
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Planned Downtime
4
Planned Downtime
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Idle
2
Idle
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Blocked
5
Blocked
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Disabled
0
Disabled
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Running
1
Running
[global]\Nuts Unlimited\Folsom\Receiving\Line 1
Starved
6
Starved

Sepasoft MES Module Suite