Sepasoft MES Module Suite
system.mes.trace.configureMaterial(userid, name, lotNo, materialName, quantity, UOM, status, beginDateTime, endDateTime, equipmentPath, manifestName, supplementalEquipment, lotCustomProps, delete, autoCreateLot, autoCreateManifest, autoCreateSupplementalEquipment)
A convenience function that creates a Python Dictionary in the format expected for array entries in the Batch Phase Parameters with a data type of Material_In or Material_Out.
|
Scripting Function added in MES 3.81.6 RC 3 and later For version downloads, go to https://www.sepasoft.com/downloads/. |
Syntax
system.mes.trace.configureMaterial(id, name, lotNo, materialName, quantity, UOM, status, beginDateTime, endDateTime, equipmentPath, manifestName, supplementalEquipment, lotCustomProps, delete, autoCreateLot, autoCreateManifest, autoCreateSupplementalEquipment)
- Parameters
userid string: A user-defined ID to reference this property when modifying.
name string: The property name that will be used for the Material property on the response segment.
lotNo: The lot number that will be used to look up an existing lot or set on a newly created lot.
lotSequenceNumber integer: The lot sequence number that will be used to look up an existing lot when multiple instances exist with the same lot number. Optional parameter, only for Material In use lots.
materialName: The name of an existing material definition that will be used.
quantity: The quantity of material.
UOM: Unit of Measure. User defined units (e.g. pounds, liters, circuit boards, pallets, etc.) for the lot. This is optional in the context of the configureMaterial() call, but required within the context of the recordOperation() call for the Material dictionary.
status: string: status of the Material Lot. This is optional in the context of the configureMaterial() call, but required within the context of the recordOperation() call for the Material dictionary.
beginDateTime date: Optional date and time that this lot resource started. Uses the Operation beginDateTime if None.
endDateTime date: Optional date and time that this lot resource ended. Uses the Operation endDateTime if None.
equipmentPath string: The equipment path where this material is stored at. Only one of equipmentPath, manifestName, or supplementalEquipment should be used.
manifestName: The optional name of a manifest this material is stored at. Defaults to None.
supplementalEquipment: The optional name of a supplemental equipment this material is stored at. Defaults to None.
lotCustomProps: An optional array of python dictionaries defining the custom properties associated with the lot.
Example: [{‘Name’:’mypropertyname’, ‘Value’: 14.5}]
delete: Optional parameter only valid for when using modifyOperation(). If True then the property will be removed.
autoCreateLot: Optional flag that when true, a lot will be created if one is not found by its lot number.
autoCreateManifest: Optional flag that when true, a manifest will be created if one is not found by its name.
autoCreateSupplementalEquipment: Optional flag that when true, a supplemental equipment will be created if one is not found by its name.
- Returns
A Python Dictionary representing a material for an operation.
- Scope
All
system.mes.trace.recordOperation
Track and trace scripting function reference, see system.mes.trace
Supported Sepasoft Module Versions:
|
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