Overview

These script functions are used to get the response segment for the specified equipment path and segment name.  This is most often for the purpose of updating the segment with changes in material or personnel.

Method Options


Description

Get the response segment for the specified equipment path and segment name.

Syntax

system.mes.getActiveSegment(equipmentPath, segmentName)


  • Parameters

 String equipmentPath - The path of the equipment that is running an operation and specified segment.

 String segmentName - The name of the segment to return.

  • Returns

The matching MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#This code will get the active segment, set the material, and update the segment to manifest changes.
seg = system.mes.getActiveSegment('Dressings Inc\California\Raw Materials\Unload Station 1', 'Unload Balsamic Vinegar')
seg.setMaterial('Vinegar', 'Balsamic Vinegar', 'Dressings Inc\California\Raw Materials\Tank Farm\Vinegar Tank 2', 'TBV 1128', 100.0)
seg = seg.update() #Reloads the updated segment into seg
Description

Get the response segment for the specified operation at the equipment path with the given segment name.

Syntax

system.mes.getActiveSegment(operationsResponse, equipmentPath, segmentName)


  • Parameters

 MESOperationsResponse operationsResponse - The operations response object that is associated with the segment to return.

 String equipmentPath - The path of the equipment that is running an operation and specified segment.

 String segmentName - The name of the segment to return.

  • Returns

The matching MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
operationsResponseUUID = 'a446eea5-d451-4d8f-aac0-60e02672a193'
operationsResponse=system.mes.loadMESObject(operationsResponseUUID)
segmentName = 'Sugar-Nuts Unlimited:Site 1:Area:Line 1'
path = '[global]\Nuts Unlimited\Site 1\Area\Line 1'
seg = system.mes.getActiveSegment(operationsResponseUUID, path, segmentName)
print seg
Output
ResponseSegment (8aff88ce-138e-4bd2-b35d-1a066203bf4c, Sugar-Nuts Unlimited:Site 1:Area:Line 1, 0 parents, 0 children, 0 custom properties, 7 complex properties)
Description

Get the response segment for the operation at the specified equipment path with the given segment name.

Syntax

system.mes.getActiveSegment(operationsResponseUUID, equipmentPath, segmentName)


  • Parameters

 String operationsResponseUUID - The UUID of the operations response object that is associated with the segment to return.

 String equipmentPath - The path of the equipment that is running an operation and specified segment.

 String segmentName - The name of the segment to return.

  • Returns

The matching MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
operationsResponseUUID = '7a4b2168-1d34-4944-96f5-edc0be02ce32'
path = '[global]\Nuts Unlimited\Site 1\Area\Line 1'
segmentName = 'Sugar-Nuts Unlimited:Site 1:Area:Line 1'

seg = system.mes.getActiveSegment(operationsResponseUUID, path, segmentName)
seg = seg.end() #Ends the segment and also reloads the updated segment object into seg for later use





  • No labels