Versions Compared

Key

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

Overview

Before you begin using Track and Trace, we thought we would start you off with several recommendations and issues to consider when using it. 

Applies To and Version Info

This feature applies to Track and Trace module and is applicable to every version.


Tips

  1. Work from a Material Process Flow diagram.

  2. Scope: Keep MES objects synchronized between the Client and Gateway.

Warning
titleBAD PRACTICE
Code Block
languagepy
linenumberstrue
seg = system.mes.createSegment('TT Consume', eqPath, False, True) #created segment, but have not yet started the segment.
seg.begin()	#start segment
seg.setMaterial('Material In', 20.0)	#Setting the material in on the unstarted segment object from line 1, not the started object.
seg.update()	#We're still calling update on the unstarted segment not the running segment, meaning that our change is not captured.
Tip
titleCORRECT PRACTICE
Code Block
languagepy
linenumberstrue
seg = system.mes.createSegment('TT Consume', eqPath, False, True)	#create segment object
seg = seg.begin()	#started segment, and set the variable 'seg' equal to the new started segment.
seg.setMaterial('Material In', 20.0)	#set the material on the 'seg' object.
seg = seg.update()	#updated the running segment with the material chance applied in line 5.

OR

Code Block
languagepy
linenumberstrue
eqPath = '[global]\Enterprise\Site\Area\Line 1'
lotPath = '[global]\Enterprise\Site\Area\Test Zone\Test Unit A'

seg = system.mes.createSegment('TT Consume', eqPath, False, True)
lotList = seg.getAvailableMaterialLots('Material In', lotPath)
if lotList.size() > 0:
  seg.setMaterialBypassChecks('Material In', lotList.get(0).getName(), 1.0)

system.mes.beginSegment(seg)
seg = system.mes.getActiveSegment(eqPath, 'TT Consume')
print seg
seg.end()


3. Avoid <any equipment> used with <any material> on the same material property of a segment. 
    If  If it is used, set the autoAssign parameter of the system.mes.createSegment script function to False.


4. When using <any equipment> on a material property of a segment, make sure the auto assign property is set to false.


5. Use system.mes.executeSegmentImmediately or seg.executeImmediately script function for high speed operations.


 6. Use system.mes.executeSegmentImmediately or seg.executeImmediately script function for operations that don’t have a duration associated with them.

 

Warning

Use executeImmediately() with a datestamp for operations that occurred in the past.

Don’t use executeImmediately() for operations with multiple segments.

Don’t mix execute() and executeImmediately() calls on the same gateway. The execute() lock can impact performance of executeImmediately().

 

7. Set the ignoreVersion parameter of the system.mes.createSegment script function to True to increase performance of repetitive operations that don’t change.


8. Use seg.getAvailableMaterialLots if a material property is set to <any equipment>.

 

Code Block
languagepy
linenumberstrue
from java.util import Calendar

eqPath = '[global]\Enterprise\Site\Area\Line 1'

lotPath = '[global]\Enterprise\Site\Area\Test Zone\Test Unit A'

seg = system.mes.createSegment('TT Consume', eqPath, False, True)

lotList = seg.getAvailableMaterialLots('Material In', lotPath)

if lotList.size() > 0:

seg.setMaterialBypassChecks('Material In', lotList.get(0).getName(), 1.0)

seg.executeImmediately(Calendar.getInstance().getTime(), True)

 

Warning
The method setMaterialBypassChecks bypasses check if material is correct for the material property, ignores the net quantity.


9. Don’t run more segments than is needed for the required output.


10. Don’t overuse Custom Properties.


11. Make sure you always use a double for the quantity parameter of the segment’s setMaterial methods.


12. In the database, don’t add UUID to clustered index. Clustered indexes are required for database synchronization. Adding an identity column and using it in the clustered index will yield the best performance.


13. The database is the constraining factor in performance of a Track and Trace implementation.


14. Database best practices:

  • While replicating database, do not write direct queries to the MES tables. 
  • It can affect performance if tables are locked.
  • Don’t modify the table schema.


Pagedetails