MES 3.0

The Create Materials set-up on the window OEE_03_Scripting/01_Configuration has four main components:

  1. Four Buttons (Ignition)



Configure the Buttons as follows:



Configure Buttons and Scripts

  1. Drag four Ignition Buttons onto the rectangles on the window. Position each and resize as shown above.

  2. (optional) Change each Button's Background Color property (this tutorial uses 98,203,201).

  3. For each of the four Buttons, use the associated code block in the panels below to configure, as follows:
    1. Change the Button's Text property to match the Button image.
    2. Change the Name property to match the name provided.
    3. Open the Component Scripting dialog box (Ctrl-J), select the actionPerformed event handler script area and paste in the associated script.




Button Name:  btn_createLine

##Create a New Line in a given Area:
parentObj = system.mes.loadMESObject('Alternate Area', 'Area')
 
newMESObj = system.mes.createMESObject('Line')
newMESObj.setPropertyValue('Name', 'Line B')
newMESObj.setActive(1)
newMESObj.addParent(parentObj)
system.mes.saveMESObject(newMESObj)


Reference:



Button Name:  btn_createMatDef

##Create a New Material Definition within a given Material Class
matClass = system.mes.loadMESObject('Production Materials', 'MaterialClass')
 
obj = system.mes.createMESObject('MaterialDef')
obj.setPropertyValue('Name', 'Grapefruit Juice')
obj.addParent(matClass)
system.mes.saveMESObject(obj)


Reference:



Button Name:  btn_createOpDef

##Create a New Operation Definition for a given Material-Equipment Combination
eqPath = 'New Enterprise\\Site\\Area\\Line 2'
obj = system.mes.loadMESObject('Grapefruit Juice', 'MaterialDef')
matLink = system.mes.object.link.create(obj)
objList = system.mes.oee.createMaterialProcessSegment(matLink, eqPath)
system.mes.saveMESObjects(objList)


Reference:



Button Name:  btn_createEqState

##Create a new Equipment State in a given Equipment State Class
stateCls = system.mes.loadMESObject('Default', 'EquipmentStateClass')
state = system.mes.createMESObject('EquipmentState')
state.addParent(stateCls)
state.setPropertyValue('Name', 'Comm Card Fault')
state.setPropertyValue('EquipmentStateCode', 12)
state.setPropertyValue('EquipmentStateType', 'Unplanned Downtime')
#valid values for EquipmentStateType: "Running", "Idle", "Blocked", "Starved", "Planned Downtime", "Unplanned Downtime", "Disabled"
state.setPropertyValue('EquipmentStateOverride', 'Optional')
state.setPropertyValue('EquipmentStateOverrideScope', 'Detected Equipment State')
system.mes.saveMESObject(state)


Reference:




  • No labels