system.mes.trace.getTraceabilityData

Sepasoft MES Module Suite

system.mes.trace.getTraceabilityData (lotNumber, lotSequenceNumber, fanOutLimit, depthLimit, includeSupplementalEquipment, includeLotQunatities)

Gets traceability data about a specific lot and what segments later used that lot.

system.mes.trace.getTraceabilityData(lotNumber, lotSequenceNumber, fanOutLimit, depthLimit, includeSupplementalEquipment, includeLotQunatities)

Syntax

system.mes.trace.getTraceabilityData(lotNumber, lotSequenceNumber, fanOutLimit, depthLimit, includeSupplementalEquipment, includeLotQunatities)

  • Parameters

string lotNumber The lot number to limit the results by. Defaults to None.

integer lotSequenceNumber The sequence number of the lot to return the results for. If a lot number is output by more than one operation, then the sequence number will increment. If this optional parameter is not provided, then the trace will start from the first lot sequence number for the lot. Defaults to None.

date beginDateTime Optionally include if limiting the begin date-time of the operation being searched for. Defaults to None.

date endDateTime Optionally include if limiting the end date-time of the operation being searched for. Defaults to None.

integer fanOutLimit Optionally specify the maximum number of lots that can come from a single lot. When this value is exceeded, an exception is thrown and and a result dataset is not returned. The range of the dataset is the resulting lots from a Material-In parameter to any downstream lot(s).

integer depthLimit Optionally specify the maximum depth that forward lot tracing goes. This is the maximum number of 'forward' calls the system looks for where a lot is used.

When Operation 1 outs to Lot 1, and Operation 2 inputs from lot 1 and outputs to lot 2, and so on to N, and you set the following:

If depthLimit = 0, the systems returns Operation 1 and Lot 1,

If depthLimit=1, the system returns Operation 1, Lot 1, Operation 2, Lot 2,

If depthLimit=N would return Operations and Lots up to N-1. This doesn't cause an exception, it just limits how long the function runs before returning.

boolean getSupplementalEquipment Only include supplemental equipment if this is True. Setting this to true can use additional CPU/memory. Defaults to False.

boolean includeLotQuantities - included in 3.81.11 SP0 and later. False by default. Displays the lot quantities of the material lots returned in the results. If set to True, the "inQuantity" attribute appears in the Material Lot sections with the "IN" use type ("outQuantity" appears for "OUT" use types). 

Expand Show More for an example of results:

  • Returns

A PyArray of PyDictionaries containing lot information.

  • Scope

All

Example of Return Lot Information

Code
[
	{
		u'endDateTime': 2025-01-14 15:10:16.0,
		u'segmentName': u'Generate A',
		u'materialsOut': {
			u'Material Out-0': {
				u'outQuantity': 2000.0,
				u'lotSeqNo': 1,
				u'lotNumber': u'LOT_001',
				u'endDateTime': 2025-01-14 15:10:16.736,
				u'materialName': u'My Mat Def A',
				u'equipmentPath': u'E\\S\\A\\L',
				u'lotUUID': u'3a004e29-14c6-421d-8de3-b68799ff5531',
				u'beginDateTime': 2025-01-14 15:10:13.5,
				u'nextSegments': [
					{
						u'endDateTime': 2025-01-14 15:10:59.0,
						u'segmentName': u'Convert A-2-B',
						u'materialsOut': {
							u'Material Out-0': {
								u'outQuantity': 200.0,
								u'more': True,
								u'lotSeqNo': 1,
								u'lotNumber': u'LOT_002',
								u'endDateTime': 2025-01-14 15:10:59.889,
								u'materialName': u'My Mat Def B',
								u'equipmentPath': u'E\\S\\A\\L',
								u'lotUUID': u'1e086f9d-106a-42a9-9993-99fc99ba34b3',
								u'beginDateTime': 2025-01-14 15:10:57.294
							}
						},
						u'equipmentPath': u'E\\S\\A\\L',
						u'materialsIn': {
							u'Material In-0': {
								u'lotSeqNo': 1,
								u'lotNumber': u'LOT_001',
								u'endDateTime': 2025-01-14 15:10:59.889,
								u'materialName': u'My Mat Def A',
								u'equipmentPath': u'E\\S\\A\\L',
								u'lotUUID': u'3a004e29-14c6-421d-8de3-b68799ff5531',
								u'inQuantity': 400.0,
								u'beginDateTime': 2025-01-14 15:10:57.294,
								u'previousSegments': [u'4ed1c57e-aabc-47eb-b2be-c301dd17091a']
							}
						},
						u'operationID': None,
						u'beginDateTime': 2025-01-14 15:10:57.0,
						u'segmentUUID': u'64a47906-0072-49a5-ad9f-f0d1813d4a30'
					}
				]
			}
		},
		u'equipmentPath': u'E\\S\\A\\L',
		u'materialsIn': {},
		u'operationID': None,
		u'beginDateTime': 2025-01-14 15:10:13.0,
		u'segmentUUID': u'4ed1c57e-aabc-47eb-b2be-c301dd17091a'
	},
	{
		u'endDateTime': 2025-01-14 15:10:59.0,
		u'segmentName': u'Convert A-2-B',
		u'materialsOut': {
			u'Material Out-0': {
				u'outQuantity': 200.0,
				u'more': True,
				u'lotSeqNo': 1,
				u'lotNumber': u'LOT_002',
				u'endDateTime': 2025-01-14 15:10:59.889,
				u'materialName': u'My Mat Def B',
				u'equipmentPath': u'E\\S\\A\\L',
				u'lotUUID': u'1e086f9d-106a-42a9-9993-99fc99ba34b3',
				u'beginDateTime': 2025-01-14 15:10:57.294
			}
		},
		u'equipmentPath': u'E\\S\\A\\L',
		u'materialsIn': {
			u'Material In-0': {
				u'lotSeqNo': 1,
				u'lotNumber': u'LOT_001',
				u'endDateTime': 2025-01-14 15:10:59.889,
				u'materialName': u'My Mat Def A',
				u'equipmentPath': u'E\\S\\A\\L',
				u'lotUUID': u'3a004e29-14c6-421d-8de3-b68799ff5531',
				u'inQuantity': 400.0,
				u'beginDateTime': 2025-01-14 15:10:57.294,
				u'previousSegments': [u'4ed1c57e-aabc-47eb-b2be-c301dd17091a']
			}
		},
		u'operationID': None,
		u'beginDateTime': 2025-01-14 15:10:57.0,
		u'segmentUUID': u'64a47906-0072-49a5-ad9f-f0d1813d4a30'
	}
]

If the request is not successful, an exception is logged detailing the reason.


Sepasoft MES Module Suite