system.mes.trace.getInventory

Sepasoft MES Module Suite

system.mes.trace.getInventory

This method accepts keyword arguments. Returns a python array of information about lot inventory.

syntax note

Warning

Brackets [] denote an optional parameter

Version Specific

Warning

MES 3.81.6 RC 3 and later

For version downloads, go to https://www.sepasoft.com/downloads/.

Syntax

system.mes.trace.getInventory([lotNumber], [materialName], [materialClass], [equipmentPath], [equipmentName], [status], [enforceLotHandling], [maxResults], [includeActiveLots], [beginDateTime], [endDateTime])
  • Parameters

lotNumber=If a lot number is provided, then the results will only include that lot number which may include multiple sequence numbers. The lotNumber filter can be used in combination with other optional filters.

materialName=If a material name is provided, then the results will only include lot numbers for the material. The materialName filter can be used in combination with other optional filters.

materialClass=If a material class is provided, then the results will only include lot numbers for materials that belong to the material class. The materialClass filter can be used in combination with other optional filters.

equipmentName=Look up inventory for lots stored at a specific equipment by name, defaults to any equipment name.  When equipmentName is populated supplemental equipment is included in the results.

getSupplementalEquipment=Includes supplemental equipment if this is True. Setting this to true can use additional cpu/memory. Defaults to True if equipmentName is provided, otherwise, False.

Version dependent: MES 3.81.11 SP5 and later

NOTE: If this argument is not provided, the system protects protect backwards-compatibility for upgrading customers. The previous behavior was dependent on the "equipmentName" argument being provided or not. If equipmentName is provided, the system automatically searches for Supplemental Equipment Lots. If equipmentName is not provided, the system automatically filters-out Supplemental Lots.

equipmentPath=If an equipment path, supplemental equipment, or manifest is provided, then the results will only include lot numbers from those equipment items. The equipment filter can be used in combination with other optional filters.

status=User defined description of status. Not the same as the LotStatus in T&T 95. The status filter can be used in combination with other optional filters.

enforceLotHandling=If true, the results are ordered by the lot handling setting. For example, FIFO, LIFO, etc., defaults to False.

maxResults=Maximum number of lots to return, defaults to 100.

includeActiveLots=When True returns lots that are currently being used in an active operation, defaults to True.

includeInactiveLots=When True returns lots that were previously created by an operation that is no longer running, defaults to True.

includeScheduledQty=Returns the scheduled quantity in addition to the quantity on hand, defaults to False.

beginDateTime=Starting date and time for the inventory lots to return. The begin date-time filter can be used in combination with other optional filters.

endDateTime=Ending date and time for the inventory lots to return. The end date-time filter can be used in combination with other optional filters. 

  • Returns

A PyDictionary that has a 'lots' key, whose corresponding value is a PyArray of PyDictionaries containing lot information. The result also has a 'maxResultsExceeded' key whose corresponding value indicates if results were limited by the maxResults parameter.  If supplemental equipment should be included, then the equipmentName parameter must be populated.

  • Scope

All

Script Example

Python
eqPath = 'New Enterprise\\Site\\Area\\Line 1'
result = system.mes.trace.getInventory(equipmentPath=eqPath)
##print out the first entry of the lot list within the inventory return.  
print result['lots'][0]
##print out the first entry's available qty
print result['lots'][0]['AvailableQuantity']

##Example of printing off a list of lot numbers and qtys:
#for i in range(len(result['lots'])):
#	print result['lots'][i]['LotNumber'], result['lots'][i]['AvailableQuantity']

Script Result

Python
{u'Location UUID': u'c25c65a7-347e-48ff-a8f5-e8c7f2a2088f', u'NetQuantity': 100.0, u'Location Type': u'Line', u'Location Name': u'Line 1', u'InQuantity': 100.0, u'AvailableQuantity': 100.0, u'MESMaterialLotUUID': u'7b250687-edb3-43db-9e4e-1d3bc8ce0062', u'Units': None, u'Scheduled': 0.0, u'OutQuantity': 0.0, u'MaterialUUID': u'86b242bc-f599-48b3-af89-6bdbd598f649', u'LotSequence': 1, u'MaterialDescription': u'', u'MaterialName': u'Corn Chips', u'LotNumber': u'1-25-ID1'}100.0



Sepasoft MES Module Suite