Skip to end of metadata
Go to start of metadata

Is there a method/function that allows editing production counts AND the work order quantity complete?

(in the) Case of:

  1. Operator starts running the equipment but forgets to start the Work Order Production Run
  2. Half way through the operator realizes he forgot and starts the Production Run according to the Material.
  3. Later on the operator informs the supervisor
  4. The supervisor now needs to adjust the Production Data which is accomplished through the Value Editor AND they need to adjust the Work Order Quantity Complete.

Step-by-step guide


  1. you can modify the 'Equipment Work Order' tag collector value (or add a new one) using the addTagCollectorValue() or updateTagCollectorValue() 
    script functions as appropriate (note, you may need others to get the value, timestamp, etc.).  You can also change it through the UI via the Value Editor component.

  2. For the remaining Work Order references you'll have to modify the Operations Response object. 
    Here is a snippet mapping that out, given a Response Segment.


##Get the response segment
UUID = 'b7ad50c2-29ff-4bc1-9ecc-d27fff5bbb8f'
seg = system.mes.loadMESObject(UUID)
##From the response segment, get the Operations Response
opRsp = system.mes.loadMESObject(seg.getPropertyValue('OperationsResponseRefUUID'))
##Get the Work Order Object that is configured on the Operations Response
woLink = opRsp.getWorkOrderLink()
if woLink == None:
	
	##Get the correct work order object.
	woObj = system.mes.workorder.getMESWorkOrder(woName)
	##Get an Object Link
	woLink = system.mes.getMESObjectLinkByName('WorkOrder', woName)
	##Set the object link for the Work Order on the Operations Response
	opRsp.setWorkOrderLink(woLink)
	##Save the Operations Response.
	system.mes.saveMESObject(opRsp)
	
	##Note, you may also have to apply this to the Operations Request object.


addTagCollectorValue()

updateTagCollectorValue()