Recommended Segment Life Cycle 3.0

Overview

Life cycle and tips while scripting with the segment functions.

Applies To and Version Info

This feature applies to the Track & Trace module and is available in all versions.

Scripting

Code
#Create the segment
seg = system.mes.createSegment('Unload-Test_1234', '[global]\Enterprise\Site\Area\Unload Station 1', True)
seg.setMaterial('New Material', 'Raw Material A', '[global]\Enterprise\Site\Area\Raw Storage Tanks\Raw Storage Tank 1', 'Lot Test_1236', 100)
 
#Begin the segment
seg = seg.begin()
seg.setMaterial('New Material', 'Raw Material A', '[global]\Enterprise\Site\Area\Raw Storage Tanks\Raw Storage Tank 1', 'Lot Test_1237', 100)
 
#After material is changed, update() should be called before the end() call
seg = seg.update()
seg.end()


References

setMaterial

Segment Functions

Keywords

None