system.mes.trace.configureMaterial(see topic for parameters)

Sepasoft MES Module Suite

system.mes.trace.configureMaterial(...) 

system.mes.trace.configureMaterial(...) builds the Python dictionary that recordOperation() and modifyOperation() expect for one Material In or Material Out entry. It does not record a trace or change inventory. Pass the returned dictionary in the materialIn or materialOut array.

Warning

Scripting Function added in

MES 3.81.6 RC 3 and later.

The autoLotCompletion argument was added in MES 3.81.13 SP1 and MES 4.83.3 SP1.

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

This method accepts keyword arguments. Use one location argument: equipmentPath, manifestName, or supplementalEquipment.

Syntax

Python
system.mes.trace.configureMaterial(userId, name, lotNo, materialName, quantity, UOM, status, beginDateTime, endDateTime, equipmentPath, manifestName, supplementalEquipment, lotCustomProps, delete, autoCreateLot, autoCreateManifest, autoCreateSupplementalEquipment, lotSequenceNumber, autoLotCompletion)

Parameters

ParameterTypeRequiredDescription
userId
String
Optional

User-defined ID used later to modify or identify this material property. Dictionary key: UserID.

name
String
Optional

Property name used for the Material property on the response segment. Dictionary key: Name.

lotNo
String
Optional
Lot number used to look up an existing lot, or set on a newly created lot. Dictionary key: LotNo.
materialName
String
Optional
Name of an existing material definition. Dictionary key: MaterialName.
quantity
Float
Optional
Quantity of material. Dictionary key: Quantity.
UOM
String
Optional
Unit of measure. Optional on this call. Required on the material dictionary when it is passed to recordOperation(). Dictionary key: UOM.
status
String
Optional
Status of the material lot. Optional on this call. Required on the material dictionary when it is passed to recordOperation(). Dictionary key: Status.
beginDateTime
Date
Optional
Date and time this lot resource started. When omitted, the operation beginDateTime is used. Dictionary key: BeginDateTime.
endDateTime
Date
Optional
Date and time this lot resource ended. When omitted, the operation endDateTime is used. Dictionary key: EndDateTime.
equipmentPath
String
Optional
Equipment path where this material is stored. Use only one of equipmentPath, manifestName, or supplementalEquipment. Dictionary key: EquipmentPath.
manifestName
String
Optional
Name of a manifest where this material is stored. Dictionary key: ManifestName.
supplementalEquipment
String
Optional
Name of a supplemental equipment item where this material is stored. Dictionary key: SupplementalEquipment.
lotCustomProps
List
Optional
Custom properties for the lot. Each entry is a dictionary with Name and Value. Example: [{'Name': 'mypropertyname', 'Value': 14.5}]. Dictionary key: LotCustomProps.
delete
Boolean
Optional
Valid only with modifyOperation(). When True, the property is removed. Dictionary key: Delete.
autoCreateLot
Boolean
Optional
When True, a lot is created if none is found for lotNo. When this argument is omitted, the dictionary is still written with AutoCreateLot set to True. Dictionary key: AutoCreateLot.
autoCreateManifest
Boolean
Optional
When True, a manifest is created if none is found for manifestName. Dictionary key: AutoCreateManifest.
autoCreateSupplementalEquipment
Boolean
Optional
When True, supplemental equipment is created if none is found for supplementalEquipment. Dictionary key: AutoCreateSupplementalEquipment.
lotSequenceNumber
Integer
Optional
Material In only. Lot sequence number used when more than one lot shares the same lot number. When omitted, the system selects the sequence number. Setting this on a Material Out entry raises an exception when the operation is recorded. Dictionary key: LotSequenceNo.
autoLotCompletion
Boolean
Optional
Material In only. Added in MES 3.81.13 SP1 and MES 4.83.3 SP1. Valid values are True and False. When True, remaining lot quantity within the equipment Zero Lot Threshold is consumed and the lot is marked Used. When False, or when this argument is omitted, Zero Lot Threshold is not applied and any remaining quantity stays on the lot. There is no Confirm option. Dictionary key: AutoLotCompletion.
In MES 3.81.12 SP4, MES 4.83.1 SP4, and later, a material, person, or supplemental equipment added with modifyOperation and no dates uses the first date that is set: the date passed on the operation, then the date stored on the operation’s response segment, then the current time.

Return Value

TypeDescription
Dictionary
One material entry for the materialIn or materialOut array. Only arguments that were provided are included, except AutoCreateLot, which is True when autoCreateLot is omitted.

Scope

All

Auto Lot Completion

autoLotCompletion applies to Material In entries used by recordOperation() and modifyOperation(). It uses the Zero Lot Threshold configured on the equipment (unit of measure or percentage).

ValueBehavior
True
If the quantity left on the lot is within the equipment Zero Lot Threshold, the remainder is consumed and the lot availability status is set to Used.
False, or omitted
Zero Lot Threshold is not applied. A leftover quantity stays on the lot.

Traditional Track and Trace Auto Lot Quantity Completion on a Material Resource Property also supports Confirm. autoLotCompletion does not.

Example Usage

Minimal example

Python
eqPath = 'New Enterprise\\New Site\\New Area\\New Line'
matInDict = system.mes.trace.configureMaterial(
    userId = 'LOT-100',
    name = 'Flour In',
    lotNo = 'LOT-100',
    materialName = 'Flour',
    quantity = 100,
    UOM = 'lb',
    status = 'Complete',
    equipmentPath = eqPath)

Record an operation

Python
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'

matInDict = system.mes.trace.configureMaterial(
    userId = inLot,
    name = inLot,
    lotNo = inLot,
    materialName = material,
    quantity = 100,
    UOM = 'lb',
    status = 'Complete',
    equipmentPath = eqPath,
    autoLotCompletion = True)

matOutDict = system.mes.trace.configureMaterial(
    userId = id,
    name = id,
    lotNo = id,
    materialName = material,
    quantity = 100,
    UOM = 'lb',
    status = 'Complete',
    equipmentPath = eqPath,
    autoCreateLot = True)

supplementalEqDict = system.mes.trace.configureSupplementalEquipment(
    userId = id,
    name = id,
    equipmentName = suppl)

personnelDict = system.mes.trace.configurePersonnel(
    userId = id,
    name = id,
    person = person)

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])

autoLotCompletion = True is only on the Material In dictionary. With that setting, a consumed quantity that leaves less than the equipment Zero Lot Threshold finishes the lot and marks it Used.

Related Functions

Sepasoft MES Module Suite