Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Overview

If you get the error ' Cannot start a new OEE run because the operation previously started has not been indexed to the next cell', this article explains how to fix this.

Panel
Table of Contents



 

This situation can arise if cells or cell groups were added or modified to the line in the production model while an OEE run was active. It is strongly recommended to end any runs before making changes to the production model, but if you find yourself in this situation, the following steps can be taken to correct the entries in the database to fix this error.

 


For most cases, the scripts below are sufficient in solving the issue.

Fix with Scripting

Run this script first. It will print the Operation UUID, Product Code, Work Order, and Mode for the line and all the cells, and then return an Ignition Dataset with the same info.

Code Block
languagepy
titleDebug Line
collapsetrue
def debugLine(linePath):
    fixList = ["Equipment Operation UUID", "Equipment Product Code", "Equipment Work Order", "Equipment Mode"]
  
    lineObjLink = system.mes.getMESObjectLink(system.mes.loadMESObjectByEquipmentPath(linePath).UUID)
    childList = []
  
    def getChildren(objLink):
        obj = objLink.getMESObject()
        objectLinks = obj.getChildCollection().getList()
        childList.extend(objectLinks)
  
        for objectLink in objectLinks:
            if objectLink.getMESObjectType().getName() == "LineCellGroup":
                getChildren(objectLink)
  
    getChildren(lineObjLink)
    def returnInfo(eqPath, collectorType):
        try:
            lastTimeStamp = system.mes.getTagCollectorLastTimeStamp(eqPath, fix, '')
            lastValue = system.mes.getTagCollectorLastValue(eqPath, fix, '')    
            return [eqPath, collectorType, str(lastValue), lastTimeStamp]    
        except:
            return [eqPath, collectorType, None, None]
        
    headers = ["Equipment Path", "Collector Type", "Last Value", "Last Time Stamp"]
    data = []
    for fix in fixList:
        print returnInfo(linePath, fix)
        data.append(returnInfo(linePath, fix))
        
        for child in childList:
            childObj = child.getMESObject()
            path = childObj.getEquipmentPath()
            print returnInfo(path, fix)
            data.append(returnInfo(path, fix))
    return system.dataset.toDataSet(headers, data)

This will bruteforce fix the issue, aborting all runs, and updating the Operation UUID, Product Code, Work Order, and Mode to reflect a run that has ended right when you run this script. Please note that this script assumes that your "Idle" mode is 3.

Code Block
languagepy
titleFix Line
collapsetrue
def fixLine(linePath):
    system.mes.invalidateCache()
    print linePath
    activeOperations = system.mes.getCurrentOperations(linePath)
    for op in activeOperations:
        op.abort()
    fixList = ["Equipment Operation UUID", "Equipment Product Code", "Equipment Work Order", "Equipment Mode"]

    lineObjLink = system.mes.getMESObjectLink(system.mes.loadMESObjectByEquipmentPath(linePath).UUID)
    childList = []

    def getChildren(objLink):
        obj = objLink.getMESObject()
        objectLinks = obj.getChildCollection().getList()
        childList.extend(objectLinks)

        for objectLink in objectLinks:
            if objectLink.getMESObjectType().getName() == "LineCellGroup":
                getChildren(objectLink)

    getChildren(lineObjLink)

    for fix in fixList:
        value = ''
        if fix == "Equipment Mode":
            value = 3
        timeStamp = system.date.now()
        system.mes.addTagCollectorValue(linePath, fix, '', timeStamp, value)


    	for child in childList:
        	childObj = child.getMESObject()
        	path = childObj.getEquipmentPath()
        	print path
        	try:
            	system.mes.addTagCollectorValue(path, fix, '', timeStamp, value)
        	except:
            	system.mes.updateTagCollectorValue(path, fix, '', timeStamp, value)

Fix Manually

Check and Abort any Active Runs

  1. Check if there are any active operations on the line and abort them if necessary. You can do this in the script console by typing ...
Code Block
languagepy
eqPath = '[global]\Nuts Unlimited\Site\Area\Bottling Line 1'
ops = system.mes.getCurrentOperations(eqPath)
for op in ops:
	print op
	system.mes.abortOperation(eqPath, op.getUUID())
Code Block
>>> 
OperationsResponse (6f89051d-73c9-4b5b-a518-4d4b56ce98da, PC-0001-Nuts Unlimited:Site:Area:Bottling Line 1, 0 parents, 0 children, 0 custom properties, 1 complex properties)
OperationsResponse (ade5f02c-842d-49f0-9255-a716ad3eb91c, PC-0002-Nuts Unlimited:Site:Area:Bottling Line 1, 0 parents, 0 children, 0 custom properties, 1 complex properties)
>>>

 

Add Necessary Entries to New Production Items

There are entries in the database table for the existing cells/cell groups that need to copied over to the new cells/cell groups that were added.

  • Use the MES Value Editor to get the last entry for Equipment Operation UUIDEquipment Product Code and Equipment Work Order for one of the original cells. 

  • Select Edit and copy the time from the field below the calendar.
  • Select <back
  • Select the new cell(s) and any new cell group(s) that were added. 
  • Select Insert Before and paste the copied timestamp into the same field.

Repeat the above steps for all new cells and cellgroups and for the Equipment Operation UUIDEquipment Product Code and Equipment Work Order Tag Collector Type fields.


Alternatively, you can download the following project 

View file
nameDnF.proj
height250