Track and Trace | recordOperation()

Sepasoft MES Module Suite

system.mes.trace.recordOperation

Track and trace scripting function reference, see system.mes.trace

Supported Sepasoft Module Versions:

Warning

Release Candidate: 3.81.6 RC3 and later

Script Example

In this script example, recordOperation() will be called, capturing the material, equipment, personnel, and tooling (supplemental equipment) information relevant to the transformation or movement of materials in the production of finished goods.  Note how recordOperation() takes in some top level information (dates, user defined ID, etc.) then arrays of dictionaries for materials, personnel, and tooling.  This structure allows for flexible addition and subtraction of resources.

Python
##Define required information like material lot info and equipment path.
inLot = '7-26-ID1'
id = '7-26-ID2'
eqPath = 'New Enterprise\\New Site\\New Area\\New Line'
material = 'Material 1'
suppl = 'Box'
person = 'Supervisor, Sam'

##Use a helper function to build the input material dictionary required by the Record Operation function
matInDict = system.mes.trace.configureMaterial(userid = inLot, name = inLot, lotNo = inLot, materialName = material, quantity = 100, 
			equipmentPath = eqPath)

##Use a helper function to build the output material dictionary required by the Record Operation function
matOutDict = system.mes.trace.configureMaterial(userid = id, name = id, lotNo = id, materialName = material, quantity = 100,
			equipmentPath = eqPath, autoCreateLot = True)

##Use a helper function to build the supplemental equipment dictionary required by the Record Operation function
supplementalEqDict = system.mes.trace.configureSupplementalEquipment(userid = id, name = id, equipmentName = suppl) 

##Use a helper function to build the personnel dictionary required by the Record Operation function
personnelDict = system.mes.trace.configurePersonnel(userid = id, name = id, person = person)

##Call record operation, passing in necessary data
system.mes.trace.recordOperation(
	userid = id, 
	name = 'Anodize Part', 
	beginDateTime = system.date.now(), 
	endDateTime = system.date.now(), 
	equipmentPath = eqPath, 
	materialIn = [matInDict],
	materialOut = [matOutDict],
	supplementalEquipment = [supplementalEqDict],
	personnel = [personnelDict]
	)






Sepasoft MES Module Suite