Single Lot Handling Mode Equipment Check 3.0

Overview

Equipment Lot Handling modes specify how lots are managed at specific equipment.  For cases where equipment can only hold one lot at a time, the Single Lot handling mode exists.  When this option is selected, a check must be performed so that no more than one lot is stored at an equipment.  Attempting to create a lot at equipment where a lot already exists will throw an exception.    

An MES list is built in the script below.  The first equipment without lots will be assigned to "availBin".  This equipment item could then be used in a segment. 

Applies to  and Version

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

Scripting

Code
seg = system.mes.createSegment('Put Mixed Nuts into Bin', '[global]\Enterprise\Site\Nuts\Nut Mixing', True)
 
#Get options for equipment that the lot can be retrieved from or stored
availBin = None
##Note that the material equipment reference property could be for a Material In or Material Out.
## Material Out case: 'Material.Material Out.LotEquipmentRef'
lotEquipmentOptList = system.mes.getAvailableReferenceOptions(seg, 'Material.Material In.LotEquipmentRef', 'All Equipment', '', False, 100, '')
for ndx in range(lotEquipmentOptList.size()):
	if system.mes.getLotInventoryByEquipment(lotEquipmentOptList.get(ndx).getName()).size() == 0:
		availBin = lotEquipmentOptList.get(ndx)
print availBin

References

system.mes.getAvailableReferenceOptions


Keywords

single lot handling; lot handling mode; lot equipment reference; Track and Trace; T&T; trace; free equipment;