Skip to end of metadata
Go to start of metadata

You want to create an Operation that will start Automatically when Scheduled

Caution: if a WorkOrder is already created BEFORE you make that modification,
Schedule created from that WorkOrder will not "see" the change ..
hence, first delete the WorkOrder (and future Schedule Entries associated)!

Step-by-step guide

This is for OEE 2.0

  1. Using the Material Manager, create a new Material (or modify an existing Material accordingly)


  2. Use the Object Editor to check your Operation Definition 
    right click on Operation Definition and select Edit Settings


    add a Trigger Operation Begin with the  sign 

    save

    Edit the _CO segment (Changeover) in the same fashion (right click → Edit Settings)
    and make sure that Auto is selected

    save

  3. In this example, I am using MES Schedule Selector and MES Schedule View stock components 
    right click on the Schedule View Time Line and select New Entry


    in the drawer that appears 
     in this example, I selected <none> for Work Order and I am using Duration

    save
  4. at the Scheduled Time (or different if you drag the entry in the MES Schedule View Time Line) 
    this Operation will start and end Automatically


Caution 

Automated setup script for bulk changes

If you need to set up auto start for a large number of OEE operations, the script below will do just that. The setUpAutoStart function will configure a single operation, removeAutoStart will undo the configuration. The executeForOperationsOnEqPath will call those functions for all OEE operations for a particular line, you just need to pass it the name of the function you want to execute.

Auto Start Configuration Helper
def setUpAutoStart(operation):
    """Sets Up auto-start for an OEE operation."""
    print operation
    try:
        COLink = system.mes.getMESObjectLinkByName('OperationsSegment', operation.getName() + '_CO')
    except:
        print "we skipped operation %s" % operation
        return
    
    #Checking if the property exists, so we don't duplicate names
    triggerName = 'DefaultBeginTrigger'
    
    if triggerName not in operation.getComplexPropertyItemNames('TriggerOperBegin'):
        #if the propperty doesn't exist, we create it
        begTrig = operation.createComplexProperty('TriggerOperBegin', 'DefaultBeginTrigger')
    else:
        #if the propperty exists, we load it
        begTrig = operation.getComplexProperty('TriggerOperBegin', 'DefaultBeginTrigger')

    #From https://help.sepasoft.com/docs/display/MHD/Trigger+Operation+Begin+Property
    begTrig.setMode('Schedule (time)')
    begTrig.setAuto(True)
    system.mes.saveMESObject(operation)
        
    #From https://help.sepasoft.com/docs/display/MHD/Trigger+Segment+Begin+Property
    #also from the example in https://help.sepasoft.com/docs/display/SKB/Derive+Operations+Segment
    COSeg = system.mes.loadMESObject(operation.getName() + '_CO', 'OperationsSegment')
    COtrigger = COSeg.getComplexProperty('TriggerSegBegin', 'DefaultBeginTrigger')
    COtrigger.setAuto(True)
    system.mes.saveMESObject(COSeg)
    
    #same process as for the Changeover above
    ProdSeg = system.mes.loadMESObject(operation.getName(), 'OperationsSegment')
    ProdTrigger = ProdSeg.getComplexProperty('TriggerSegEnd', 'Production End')
    ProdTrigger.setMode('Schedule (time)')
    ProdTrigger.setAuto(True)
    system.mes.saveMESObject(ProdSeg)
    
def removeAutoStart(operation):
    """Removes auto-start from an OEE operation"""
    print operation
    try:
        COLink = system.mes.getMESObjectLinkByName('OperationsSegment', operation.getName() + '_CO')
    except:
        print "we skipped operation %s" % operation
        return
    
    #Checking if the property exists, so we don't duplicate names
    triggerName = 'DefaultBeginTrigger'
    
    if triggerName not in operation.getComplexPropertyItemNames('TriggerOperBegin'):
        return
    else:
        #if the propperty exists, we remove it
        operation.removeComplexProperty('TriggerOperBegin', 'DefaultBeginTrigger')
        
    #From https://help.sepasoft.com/docs/display/MHD/Trigger+Segment+Begin+Property
    #also from the example in https://help.sepasoft.com/docs/display/SKB/Derive+Operations+Segment
    COSeg = system.mes.loadMESObject(operation.getName() + '_CO', 'OperationsSegment')
    COtrigger = COSeg.getComplexProperty('TriggerSegBegin', 'DefaultBeginTrigger')
    COtrigger.setAuto(False)
    system.mes.saveMESObject(COSeg)
    
    #same process as for the Changeover above
    ProdSeg = system.mes.loadMESObject(operation.getName(), 'OperationsSegment')
    ProdTrigger = ProdSeg.getComplexProperty('TriggerSegEnd', 'Production End')
    ProdTrigger.setMode('Schedule (production)')
    ProdTrigger.setAuto(False)
    system.mes.saveMESObject(ProdSeg)

def executeForOperationsOnEqPath(eqPath, function):
    """goes through OEE operations defined for the eqPath passed and applies the passed function to them."""
    #from https://help.sepasoft.com/docs/display/MHD/system.mes.getAvailableOperations
    opList = system.mes.getAvailableOperations(eqPath, '*', False, False)
    print opList
    for op in opList:
        operation = op.getMESObject()
        function(operation)

eqPath = 'Nuts Unlimited\Folsom\Tests\Test Line 1'

# Configures all OEE Operations to auto start for a line
executeForOperationsOnEqPath(eqPath, setUpAutoStart)

# Removes the configuration for all OEE Operations in a line
executeForOperationsOnEqPath(eqPath, removeAutoStart)


N/A