Skip to end of metadata
Go to start of metadata

Overview

Description

Create a new MESResponseSegment from the specified Operations Response. This is done to create a new instance of a MESResponseSegment object needed to begin a segment.  This function, if the Operations Response is not specified assumes the currently running Operations Response is specified.

In a multi-operation use-case, where more than one operation could be running on an equipment item, this function should not be used.  Instead, system.mes.createOperation() should be used (followed by creating the response segment for the newly created and started operation).


These script functions are used to create a new response segment object.

Method Options


When creating a segment without the auto assign parameter supplied that the default is auto assign is set to True.

Syntax

system.mes.createSegment(definitionSegment, equipmentPath)


  • Parameters

 AbstractMESObject definitionSegment - The operations segment to base the response segment on. See AbstractMESObject object in the MES documentation.

String equipmentPath - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#Creates a segment
obj = system.mes.loadMESObject('Receive Turkeys', 'OperationsSegment')
system.mes.createSegment(obj, 'My Enterprise\California\Receiving\Unload Station 1')
Syntax

system.mes.createSegment(definitionSegment, equipmentPath, autoAssignOptions)


  • Parameters

AbstractMESObject definitionSegment - The operations segment to base the response segment on. See AbstractMESObject object in the MES documentation.

String equipmentPath - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

boolean autoAssignOptions - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#This code will create a new instance of the MESResponseSegment object
seg = system.mes.createSegment('Load Assembly Tray', '[global]\Dressings Inc\California\Assembly\PS Assembly', False)
seg.setMaterial('Housing', 'Housing', 'Assembly Tray 8')
seg.begin()
Syntax

system.mes.createSegment(operationsResponse, segmentName, equipmentPath, autoAssignOptions)


  • Parameters

MESOperationsResponse object - The operations response to create the response segment for.

String segmentName - The name of the operationsSegment to base the response segment on. If this property is empty, then the name of the operations response object will be used.

String equipmentPath - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

boolean autoAssignOptions - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#Creates a segment for a specific operation
eqPath = 'My Enterprise\California\Receiving\Unload Station 1'
operDef = system.mes.loadMESObject('Receive Turkeys', 'OperationsDefinition')
operResp = system.mes.createOperation(operDef)
system.mes.createSegment(operResp, 'Receive Turkeys', eqPath, True)
Syntax

system.mes.createSegment(operationsResponse, segmentName, autoAssignOptions)


  • Parameters

MESOperationsResponse  operationsResponse - The operations response to create the response segment for.

String segmentName - The name of the operationsSegment to base the response segment on. If this property is empty, then the name of the operations response object will be used.

boolean autoAssignOptions - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#Load an operation definition object
operDef = system.mes.loadMESObject('Receive Turkeys', 'OperationsDefinition')
#Create an operation for the operations definition object
operResp = system.mes.createOperation(operDef)
#Create a segment for the specified operation
system.mes.createSegment(operResp, 'Receive Turkeys', True)
Syntax

system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions)


  • Parameters

String operationsSegmentName - The name of the operations segment to base the response segment on.

String equipmentPath - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

boolean autoAssignOptions - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True)
Syntax

system.mes.createSegment(operationsSegmentName, equipmentPath, autoAssignOptions, ignoreVersion)


  • Parameters

String operationsSegmentName - The name of the operations segment to base the response segment on.

String equipmentPath - Equipment path of the equipment to use when creating the segment. This is required and is used when a material class is specified in the segment, it has to be replaced with the specific equipment.

boolean autoAssignOptions - If true, automatically assign material, lot and person options. Otherwise, they have to be set prior to beginning the segment.

boolean ignoreVersion - If true, will not validate the version of the segment. Useful if the segment could theoretically be altered elsewhere while it is being created.

  • Returns

A new MESResponseSegment object.

  • Scope

All

Code Examples
Code Snippet
#Creates a segment for a given equipment path and segment name 
system.mes.createSegment('Receive Turkeys', 'My Enterprise\California\Receiving\Unload Station 1', True, True)