Skip to end of metadata
Go to start of metadata

Description

This object defines the material resources that may be required by a process segment. It holds resource information that control what material lots can be consumed or created by operations segments derived from the process segment. This object is stored as a complex property object of a process segment.

This object is not derived from the MESAbstractObject. Instead it derives from AbstractMESComplexProperty object and inherits all its functions and properties.


When an operations segment is scheduled or executed, a Response Material Property object is created. Refer to that object help for more details.




Object Creation

This object is primarily created when using the MES Object Editor component. The following object methods can be used to create or return this type of object.


 Click here to see script examples...
Code Snippet
def add_material_resource_prop(ps_name, supplemental_equipment_name):	
	ps = system.mes.loadMESObject(ps_name, 'ProcessSegment')
	# Create Material Resource Complex Property and name it material out
	material_prop = ps.createComplexProperty('Material', 'Material Out')
	
	# We are using a material called MatDef1 in our operation
	mat_Link = system.mes.getMESObjectLinkByName('MaterialDef', 'MatDef1')
	material_prop.setMaterialRef(mat_Link)
	
	# The material equipment ref is where we store out created material after it is done 
	# This can be either a piece of Supplemental Equipment, or a Storage Unit
	# In this example we are using a piece of supplemental equipment that already exists
	equip_ref = system.mes.loadMESObject(supplemental_equipment_name, 'Equipment')
	material_prop.setEquipmentRefUUID(equip_ref.getUUID())
	material_prop.setEquipmentRefType(equip_ref.getMESObjectTypeName())
	
	# Set remaining properties 
	material_prop.setQuantitySource('Manual')
	material_prop.setUse('Out')
	material_prop.setOptional(False)
	material_prop.setLotNumberSource('Auto')
	material_prop.setAutoGenerateLot(True)
	material_prop.setRatePeriod('None')
	
	# Save off the equipment to your server
	system.mes.saveMESObject(ps)
 
# Using already created Process Segment with Equipment Resource Property
ps_name = 'Example Process Segment'
supplemental_equipment_name = 'Supplement Equipment Example'
add_material_resource_prop(ps_name, supplemental_equipment_name)

ps = system.mes.loadMESObject(ps_name, 'ProcessSegment')

# Get Material Use of Material Resource Property with the name of Material Out
print ps.getComplexProperty('Material.Material Out.MaterialUse')

# Get Material Resource Property with the name of Material Out
print ps.getComplexProperty('Material.Material Out.MaterialAutoGenerateLot')
Output
MaterialUse=Out
MaterialAutoGenerateLot=true


Use

This object is not a parameter for any scripting or object functions.



Object Properties

The object properties are accessible through the MES Object Editor component and with the provided object functions, but not directly as obj.properties. The setting name is what appears in the MES Object Editor component and the script name is what is used to set or get the value using script. See AbstractMESComplexProperty for details about accessing values using script. 

Property values can be accessed and changed for an object by using the getPropertyValue() and setPropertyValue() method.

Setting NameTypeScriptingDescription

Name__

StringMaterialNameThis is the name to refer to this material resource by. Many process segments have multiple material resources and this is a unique name displayed to the operator, shown in analysis and reports, and also internally used to reference this material resource.
OptionalbooleanMaterialOptional

If the material defined here is always required as an input or an output of this process, then leave this setting unchecked. If this material is optional, then select it.

Production SelectablebooleanMaterialProductionSelectableThis box is checked by default. If this setting is unchecked then this property selection will not be visible to the operator in the MES Material Selector component.
UseStringMaterialUse

Defines whether this material is an input, a consumableby-product or an output of this process segment. Options are:

In - This setting is used for material feeding from an existing material lot into a segment that will be part of the finished goods.

Out - This setting is used for material feeding out of a segment that is or will be part of the finished goods.

Consumable - This setting is used for material feeding into a segment that is not part of the finished goods.

By-product - This is used for material feeding out of a segment that is not part of the finished goods.

 Auto Generate Lotboolean  MaterialAutoGenerateLot

For a Material Use set to In, if this property is enabled, the incoming lot will be created and consumed by this segment. This is typically only done when receiving material lot doesn't already exists. For a Material Use set to Out, this property must be enabled.

Material_ReferencePython DictionaryMaterialRefThis can be set to a Material Class or a Material Definition. If set to Material Class, the specific material definition will need to be provided when the segment runs.
Lot_Equipment_Reference Python Dictionary MaterialEquipmentRef

This is the type of equipment associated with this material resource. It can be an Equipment Class, Equipment, Line, Line Cell Group or Storage Unit and can be used to prevent this process segment from selecting lots located in other equipment.

In the case where this material resource is an input to the segment, this will be the equipment where the material is coming from. This helps establish routes that exist due to physical machinery. For example if tanks 1 and 2 can only supply line 1 and tanks 3 and 4 can only supply line 2.

In the case where this material resource is an output from the segment, this will be the equipment where the material is going to. And just like the case of the input, routes that exist due to physical machinery can be accommodated.

Enable SublotsbooleanMaterialEnableSublots

If this setting is selected, then sublot support will be enabled for the material resource. If sublots are used, then serial numbers, or other unique identification number, can be assigned to each sublot item.

For example, a Material Lot of batteries may have 25 individual batteries each with a serial number and each with their own test results.

 Lot Number SourceString MaterialLotNoSource

This determines the source of the lot number.

Options are:

  • Auto: This setting automatically generates lot number. The internal lot number generator will generate a lot number and assign it automatically for the operator. This option can also be used if a different lot number format is used or lot numbers are provided by another system that is integrated with this system.
  • Manual: This setting will prompt the operator for the lot number when using GUI components.  If used in script, the lot number must be provided at run-time. This is typically used when receiving raw materials or entering a lot number generated by an outside system. 
  • In LinkOnly valid for Out materials. In cases where the lot number for the output material will be the same as the lot number of the input to the process segment, this setting will tie the two together. Segments can be configured with multiple material inputs and outputs and different lot number links can be configured. Whenever this setting is used, the Lot Sequence number is incremented, so that a material lot can be tracked through a number of process segments.

Creating Custom Lot Numbers

When the Lot Number Source is set to Auto, the T&T module will internally generate a unique lot number. If a custom lot number needs to be generated or a query to obtain a lot number from another system, a custom script can be added to the CreateLotNumber event to do just that. This event is fired when Lot Number Source is set to Auto and a new material lot number is required by an operation segment. See the Generate Custom Lot Number knowledge base article for more information.

Lot Number Source LinkString MaterialLotNoSourceLinkThe system will use the lot number of the incoming material for this material. Use the name of the material reference complex property, i.e. if this property is set to Material In, then the system selects the lot number for the material reference Material In.
 Quantity SourceString MaterialQuantitySource

This setting determines the source of the quantity for this material resource.

Options

Available Lot Quantity - This option obtains the total quantity of the lot that is currently available. If multiple segments utilize a material lot, they each requisition a quantity leaving, potentially, some quantity remaining for use - this is the available lot quantity. The available lot quantity setting utilizes all of the available material, leaving none for other processes.

Link - This option allows the quantity to come from an input or output material resource of this segment. This eliminates the need to type in the quantity multiple times if they will always be the same as another material resource.  Note, you can not use a material resource multiple times with this setting.

Link Combine - For segments that are combining two or more lots into one streams, as is the case of joining goods after tests are done to only a portion of a lot, this option can be used. It is used by having two or more material resources, that are segment inputs, linked to the same material resource output. When the segment is ended, the system will sum up the quantities of the linked material resources to that of the linking material resources. There isn't a need to use "," or any other delimiters while defining the quantity source link, instead a single name is used that can be put into all of the material references link names.

Link Split - For segments that are splitting a lot into two or more streams, as is the case of separating good from bad product, this option can be used. It is used by having two or more material resources, that are segment outputs, linked to the same material resource. When the segment is ended, the system will ensure that the sum of the quantities of the linking material resources equal that of the linked material resources.

Manual - The operator will be prompted for the quantity when using GUI components.  If utilized in script, the value must be provided at run-time. The quantity must be entered before the segment is ended.

MES Counter - Obtain the quantity from the automatic production counters defined for the associated equipment. The associated equipment may change if the Lot Equipment Reference setting is set to an Equipment Class and the specific equipment is not known until the segment is started for production. More information can be found in the MES Counters page.

Sublot Count - The quantity will be automatically set based on the number of Material Sublot items belonging to the Material Lot. If sublots are used, then serial numbers, or other unique identification number, can be assigned to each sublot item.

For example, a Material Lot of batteries maybe have 25 individual batteries each with a serial number and each with their own test results. The quantity of the Material Lot will match the number of Material Sublot items of the Material Lot. Or, the number of batteries in the lot.

Quantity Source LinkStringMaterialQuantitySourceLink

If the quantity value of an output material lot will be determined based on the quantity values of an input material lot or lots, the name provided here is used to either Link, Split or Combine the values (based on the Quantity Source setting).

Example, three input materials all have Quantity Source Link set to Total Input. If Material Out has Quantity Source to Link Combine and the Quantity Source Link also set to Total Input, the output material quantity will be calculated as the sum of all input materials.

QuantityFloat8 MaterialQuantity Typically this is left blank, but it can be set to a fixed value that will be constant every time the segment is used for production.
UnitsStringMaterialUnitsUnits for the quantity.

Rate Period

String

MaterialRatePeriod

The rate period is the unit of time used for the material rate. This rate is used by scheduling functionality to determine relevant consumption or production of material.

Options

Min - For setting the rate in minutes.

Hour For setting the rate in hours.

Cycle For setting the rate in cycles.

RateFloat8MaterialRateThis setting determines rate of the material consumption or production for scheduling. The rate utilizes the rate period property to determine the unit of time for this rate. Material rate is invalid if it is set to less than zero.
Cycle TimeInt4MaterialCycleTimeThe expected time to complete a material cycle in seconds.
Final Lot StatusStringMaterialFinalLotStatus

When a segment is started, the status of the Material Lots will be set to Active. When the segment is ended or a new lot is used for the material resource, the status will automatically be set to Complete. Optionally, the value of this setting can be used instead of the default Complete. This is useful for setting a lot to HoldIn Process or anything that can be used to filter lots or sublots.

Active status while the lot is active cannot be changed.
Auto Lot Quantity CompletionStringMaterialAutoLotCompletion

This setting determines if all the items belonging to the lot are automatically consumed. Options are:

Disabled - Select this if the items in the lot should not be used automatically, regardless of the Zero Lot Threshold setting.

Enabled - Select this if the items in the lot should be used automatically (via the Zero Lot Threshold functionality in the Storage Unit, by setting the lot's Lot Availability Status property to Used). See Lot Handling Modes and Material Lot.

Confirm - Set this if the lot quantity needs to be confirmed. This will check if the lot has reached its confirmation threshold or not.

Material Lot Depletion WarningInt4MaterialLotDepletionWarningSets the depletion warning in seconds.
Material Lot Status FilterStringMaterialLotStatusFilterThe material lot status can be set to any custom value here. This can be used to filter which material lots can be selected when this process segment is executed. The Material Lot Status Filter property accepts comma separated lot status values. By default, only lots with a lot status of Complete will be shown in the Material Selector. This can be changed to also include other lot status values such as Active by setting the Material Lot Status Filter to Complete, Active. It can also include user defined values as well.
 Click here to see script examples for accessing object properties...

The following script example shows how an object property can be accessed. Object functions are also provided to set and get most property values.

Code Snippet
#Load MES object
mesObject = system.mes.loadMESObject('Mix Nuts', 'ProcessSegment')
matRef = mesObject.getComplexProperty('Material', 'Almonds In')
#Get the value of auto lot completion property
print matRef.getValue('MaterialAutoLotCompletion')
Output
Disabled


Object Functions

This object provides the following functions:

Info

Material and equipment references can be set in one of two ways:

Material

  1. Passing an object link to the method setMaterialRef(materialRef)
  2. Using a uuid and type with setMaterialRefUUID(materialRefUUID) and setMaterialRefType(materialRefType)

Equipment

  1. Passing an object link to the method setEquipmentRef(equipmentRef)

    obj_link = system.mes.getMESObjectLinkByEquipmentPath('my/equipment/path')
    equip_prop.setEquipmentRef(obj_link)
  2. Using a uuid and type with setEquipmentRefUUID(equipmentRefUUID) and setEquipmentRefType(equipmentRefType)

    obj = system.mes.loadMESObjectByEquipmentPath('my/equipment/path')
    equip_prop.setEquipmentRefUUID(obj.getUUID())
    equip_prop.setEquipmentRefType(obj.getMESObjectTypeName())
 getAutoGenerateLot()
Description

Return the boolean corresponding to the auto generate property.

Syntax

getAutoGenerateLot()


  • Parameters

 None

  • Returns

 boolean - True if the material lot is generated automatically and False otherwise.

  • Scope

All

 getAutoLotCompletion()
Description

Return the boolean corresponding to the auto lot completion property.

Syntax

getAutoLotCompletion()


  • Parameters

 None

  • Returns

 boolean - True if the material lot is completed automatically and False otherwise.

  • Scope

All

 getCycleTime()
Description

Get the time taken to complete a material cycle in seconds.

Syntax

getCycleTime()


  • Parameters

 None

  • Returns

 Integer - The time taken in seconds to complete a material cycle.

  • Scope

All

 getEnableSublots()
Description

Get the boolean corresponding to enable sublots property. Returns True if sublots can be added.

Syntax

getEnableSublots()


  • Parameters

 None

  • Returns

 boolean - True if sublots are enabled.

  • Scope

All

 getEquipmentRef()
Description

Return the reference of the equipment object.

Syntax

getEquipmentRef()


  • Parameters

 None

  • Returns

 MESObjectLink objLink - The reference link to the equipment object.

  • Scope

All

 getEquipmentRefProperty()
Description

Get the reference property of equipment object.

Syntax

getEquipmentRefProperty()


  • Parameters

 None

  • Returns

 MESEquipmentRefProperty refProperty - The reference property of the equipment object.

  • Scope

All

 getEquipmentRefType()
Description

Get the type of equipment reference.

Syntax

getEquipmentRefType()


  • Parameters

 None

  • Returns

 String refType - The type of the equipment reference.

  • Scope

All

 getEquipmentRefUUID()
Description

 Get the uuid that corresponds to equipment reference.

Syntax

getEquipmentRefUUID()


  • Parameters

 None

  • Returns

 String equipmentRefUUID - The unique identifier that corresponds to equipment reference.

  • Scope

All

 getFinalLotStatus()
Description

Gets the final lot status of the material.

Syntax

getFinalLotStatus()


  • Parameters

None

  • Returns

String finalLotStatus - The final status of the material lot.

  • Scope

All

 getLotDepletionWarning()
Description

Gets the warning of lot depletion in seconds.

Syntax

getLotDepletionWarning()


  • Parameters

None

  • Returns

Integer value - The depletion warning in seconds.

  • Scope

All

 getLotNumberSource()
Description

Gets name of the lot number source.

Syntax

getLotNumberSource()


  • Parameters

None

  • Returns

String lotNoSource - The name of the lot number source.

  • Scope

All

 getLotNumberSourceLink()
Description

Gets the name of the lot number source link.

Syntax

getLotNumberSourceLink()


  • Parameters

None

  • Returns

String lotNoSourceLink - Name of the lot number source link.

  • Scope

All

 getLotStatusFilter()
Description

Get the custom lot status of results to return.

Syntax

getLotStatusFilter()


  • Parameters

None

  • Returns

String lotStatusFilter - The custom lot status value.

  • Scope

All

 getMaterialCycleTime()
Description

Get the time taken to complete a material cycle in seconds.

Syntax

getMaterialCycleTime()


  • Parameters

 None

  • Returns

 Integer - The time taken in seconds to complete a material cycle.

  • Scope

All

 getMaterialRate()
Description

Gets the rate of material for production.

Syntax

getMaterialRate()


  • Parameters

None

  • Returns

double matRate - The rate of material.

  • Scope

All

 getMaterialRatePeriod()
Description

Gets the material rate period.

Syntax

getMaterialRatePeriod()


  • Parameters

None

  • Returns

String ratePeriod - The material rate period.

  • Scope

All

 getMaterialRef()
Description

Gets the MES object link corresponding to this material property.

Syntax

getMaterialRef()

  • Parameters

None

  • Returns

MES Object Link mesObjectLink - The link corresponding to the material.

  • Scope

All

 getMaterialRefProperty()
Description

Gets the material reference properties for this material property.

Syntax

getMaterialRefProperty()


  • Parameters

None

  • Returns

MESMaterialRefProperty - The material reference properties. All those children properties to MES material property.

  • Scope

All

 getMaterialRefType()
Description

Gets the reference type of the material.

Syntax

getMaterialRefType()


  • Parameters

None

  • Returns

String materialRefType - The type of the material reference.

  • Scope

All

 getMaterialRefUUID()
Description

Gets the uuid for the material reference.

Syntax

getMaterialRefUUID()


  • Parameters

None

  • Returns

 String materialRefUUID - The unique identifier for the material reference.

  • Scope

All

 getOptional()
Description

Get the value of optional property of the material. Optional property defines whether the property is mandatory or optional.

Syntax

getOptional()


  • Parameters

 None

  • Returns

 boolean optional - The optional property of the material.

  • Scope

All

 getQuantity()
Description

Get the quantity of equipment. This is here in compliance with ISA-95 standard.

Syntax

getQuantity()


  • Parameters

 None

  • Returns

 double quantity - The quantity of equipment.

  • Scope

All

 getQuantitySource()
Description

Get the value for quantity source property of material.

Syntax

getQuantitySource()


  • Parameters

 None

  • Returns

 double quantitySource - The quantity source property of material.

  • Scope

All

 getQuantitySourceLink()
Description

Get the value of quantity source link property for material.

Syntax

getQuantitySourceLink(quantityLink)


  • Parameters

None

  • Returns

 double quantityLink - The quantity source link property for material.

  • Scope

All

 getRate()
Description

Gets the material rate.

Syntax

getRate()


  • Parameters

None

  • Returns

double rate - The material rate.

  • Scope

All

 getRatePeriod()
Description

Gets the material rate period.

Syntax

getRatePeriod()


  • Parameters

None

  • Returns

String ratePeriod - The material rate period.

  • Scope

All

 getReferenceOptions(mesObjectType, searchPattern)
Description

Get a list of the available options for the specified MES reference property specified by the object type and search pattern.

Syntax

getReferenceOptions(mesObjectType, searchPattern)


  • Parameters

MESObjectTypes mesObjectType - The MES object type of the links that represent the options. Can be of type: Equipment, AllEquipment, MaterialDef, or MaterialLot.

String searchPattern - The search pattern to filter the results by. It can contain the * and ? wild card characters. 

  • Returns

A list of MES Object Link objects holding the options that are appropriate for the specified property. The list is returned as a MES List object that is a collection holding MES object links that represent the options.

  • Scope

All

 getReferenceOptions(mesObjectType, searchPattern, maxLotReturnCount, lotDescriptionPattern)
Description

Get a list of the available options for the specified MES reference property specified by the parameters.

Syntax

getReferenceOptions(mesObjectType, searchPattern, maxLotReturnCount, lotDescriptionPattern)


  • Parameters

MESObjectTypes mesObjectType - The MES object type of the links that represent the options. Can be of type: Equipment, AllEquipment, MaterialDef, or MaterialLot.

String searchPattern - The search pattern to filter the results by. It can contain the * and ? wild card characters. 

int maxLotReturnCount - The maximum number of lots.

String lotDescriptionPattern - This is a pattern to filter the lot descriptions.

  • Returns

A list of MES Object Link objects holding the options that are appropriate for the specified property. The list is returned as a MES List object that is a collection holding MES object links that represent the options.

  • Scope

All

 getUnits()
Description

Get units defined for this equipment.

Syntax

getUnits()


  • Parameters

 None

  • Returns

 String units - The units for equipment.

  • Scope

All

 getUse()
Description

Get the value of use property defined for this material.

Syntax

getUse()


  • Parameters

 None

  • Returns

 String use - The use property for material.

  • Scope

All

 isOutUse()
Description

Checks whether the value of use property is Out and returns the corresponding boolean.

Syntax

isOutUse()


  • Parameters

 None

  • Returns

 boolean use - True if the use property for material is Out and False otherwise.

  • Scope

All

 isProductionSelectable()
Description

Checks whether the value of production selectable property is True and returns the corresponding boolean.

Syntax

isProductionSelectable()


  • Parameters

 None

  • Returns

 boolean selectable - True if the production selectable property for material is set to True and False otherwise.

  • Scope

All

 setAutoGenerateLot(autoGenerateLot)
Description

Sets a boolean indicating whether this material property will automatically generate lots or not.

Syntax

setAutoGenerateLot(autoGenerateLot)


  • Parameters

boolean autoGenerateLot - True, if the autoGenerateLot property is set to true and False otherwise.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in.setAutoGenerateLot(True)  # Will automatically create a new lot
 setAutoLotCompletion(autoLotCompletion)
Description

Sets the value of auto lot completion property associated with this material property.

Syntax

setAutoLotCompletion(autoLotCompletion)


  • Parameters

String autoLotCompletion - The value to set the auto lot completion property for.

  • Returns

Nothing

  • Scope

All

 setCycleTime(cycleTime)
Description

Sets the lot cycle time in seconds.

Syntax

setCycleTime(cycleTime)


  • Parameters

Sets the lot cycle time in seconds.

  • Returns

Nothing

  • Scope

All

 setEnableSublots(enableSublots)
Description

A boolean indicating whether this response material property will enable sublots or not.

Syntax

setEnableSublots(enableSublots)


  • Parameters

boolean enableSublots - True, if sublots are enabled and False otherwise.

  • Returns

Nothing

  • Scope

All

Code Snippet
mat_prop_out = mat_prop_out_process_segment.createComplexProperty('Material', 'Bagged Almonds Out')
mat_prop_out.setEnableSublots(True) # Will enable the ability to create sublots
 setEquipmentRef(equipmentRef)
Description

 Set reference to the equipment property.

Syntax

setEquipmentRef(equipmentRef)


  • Parameters

 MESObjectLink equipmentRef - Reference to the equipment property.

  • Returns

 Nothing

  • Scope

All

Code Snippet
line_link = system.mes.getMESObjectLinkByEquipmentPath('my/line/path')
os = system.mes.loadMESObject('Mix Nuts','OperationsSegment')
material_prop = os.getComplexProperty('Material', 'Material Out')
material_prop.setEquipmentRef(line_link)
 setEquipmentRefType(equipmentRefType)
Description

 Set the type of equipment reference.

Syntax

setEquipmentRefType(equipmentRefType)


  • Parameters

String equipmentRefType - The type of equipment reference.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
equip_ref = system.mes.loadMESObject(supplemental_equipment_name, 'Equipment')
material_prop.setEquipmentRefType(equip_ref.getMESObjectTypeName())
 setEquipmentRefUUID(equipmentRefUUID)
Description

 Set the uuid that corresponds to equipment reference.

Syntax

setEquipmentRefUUID(equipmentRefUUID)


  • Parameters

 String equipmentRefUUID - The unique identifier that corresponds to equipment reference.

  • Returns

 Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
equip_ref = system.mes.loadMESObject(supplemental_equipment_name, 'Equipment')
material_prop.setEquipmentRefUUID(equip_ref.getUUID())
 setFinalLotStatus(finalLotStatus)
Description

This is useful for setting a lot to Hold, In Process or anything that can be used to filter lots or sublots. When a segment is started, the status of the Material Lots will be set to Active. When the segment is ended or a new lot is used for the material resource, the status will be set to Complete. Optionally, the value of this setting can be used instead of the default Complete. Please note, the Active status while the lot is active cannot be changed.

Syntax

setFinalLotStatus(finalLotStatus)


  • Parameters

String finalLotStatus - The status to set the lot for.

  • Returns

Nothing

  • Scope

All

 setLotDepletionWarning(lotDepletionWarningSeconds)
Description

Sets the warning of lot depletion in seconds.

Syntax

setLotDepletionWarning(lotDepletionWarningSeconds)


  • Parameters

Integer lotDepletionWarningSeconds - The depletion warning in seconds.

  • Returns

 Nothing

  • Scope

All

 setLotNumberSource(lotNoSource)
Description

Sets name of the lot number source.

Syntax

setLotNumberSource(lotNoSource)


  • Parameters

String lotNoSource - The name of the lot number source.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
material_prop.setLotNumberSource('Auto')
 setLotNumberSourceLink(lotNoSourceLink)
Description

Sets the name of the lot number source link.

Syntax

setLotNumberSourceLink(lotNoSourceLink)


  • Parameters

String lotNoSourceLink - Name of the lot number source link.

  • Returns

Nothing

  • Scope

All

 setLotStatusFilter(lotStatusFilter)
Description

Set the custom lot status of results to return.

Syntax

setLotStatusFilter(lotStatusFilter)

Tip

If you have them defined, you can also use custom Material Lot Statuses.


  • Parameters

String lotStatusFilter - The custom lot status value.

  • Returns

Nothing

  • Scope

All

Code Snippet
# Will look for lots with status of "Active" or "Complete"
material_prop = ps.createComplexProperty('Material', 'Material Out')
material_prop.setLotStatusFilter('Active,Complete')
 setMaterialCycleTime(cycleTime)
Description

Sets the material lot cycle time in seconds.

Syntax

setMaterialCycleTime(cycleTime)

Deprecated Function

Function is deprecated. Use setCycleTime()

  • Parameters

Sets the material lot cycle time in seconds.

  • Returns

Nothing

  • Scope

All

 setMaterialRate(matRate)
Description

Sets the rate of material for production.

Syntax

setMaterialRate(matRate)

Deprecated Function

Function is deprecated. Use setRate()


  • Parameters

Double matRate - The number of units produced per period

  • Returns

Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
material_prop.setMaterialRate(1)
 setMaterialRatePeriod(ratePeriod)
Description

This is used to set the material rate period.

Options

Min - For setting the rate in minutes.

Hour For setting the rate in hours.

Cycle For setting the rate in cycles.

Syntax

setMaterialRatePeriod(ratePeriod)

Deprecated Function

Function is deprecated. Use setRatePeriod()


  • Parameters

String ratePeriod - The name of material rate period you want to use.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
material_prop.setMaterialRatePeriod('Min')
 setMaterialRef(mesObjectLink)
Description

Sets an MES object link corresponding to this material property.

Syntax

setMaterialRef(mesObjectLink)


  • Parameters

MES Object Link mesObjectLink - The object link to set for the material.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_prop = ps.createComplexProperty('Material', 'Material Out')
mat_def_link = system.mes.getMESObjectLinkByName('MaterialDef', 'MatDef1')
material_prop.setMaterialRef(mat_def_link)
 setMaterialRefType(materialRefType)
Description

Sets the type of material reference.

Syntax

setMaterialRefType(materialRefType)


  • Parameters

String materialRefType - The type to set for the material reference.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_resource_property = ps.createComplexProperty('Material', 'Material to Use')
mat_def_1 = system.mes.loadMESObject('MatDef1', 'MaterialDef')
material_resource_property.setMaterialRefType(mat_def_1.getMESObjectTypeName())
 setMaterialRefUUID(materialRefUUID)
Description

Sets the uuid for the material reference.

Syntax

setMaterialRefUUID(materialRefUUID)


  • Parameters

String materialRefUUID - The unique identifier to set for the material reference.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in_equipment_reference = system.mes.getMESObjectLinkByName("StorageUnit", 'Almond Silo')
material_property_in.setEquipmentRefUUID(material_property_in_equipment_reference.getMESObjectUUID())
 setOptional(optional)
Description

Set the value of optional property of the material. Optional property defines whether the property is mandatory or optional.

Syntax

setOptional(optional)


  • Parameters

 boolean optional - The optional property of the material.

  • Returns

 Nothing

  • Scope

All

Code Snippet
material_to_add = ps.createComplexProperty('Material', 'Material To Add')
material_to_add.setOptional(False)
 setProductionSelectable(selectable)
Description

Sets the value of production selectable property.

Syntax

setProductionSelectable(selectable)


  • Parameters

 boolean selectable - Set to True to make the property production selectable and set to False otherwise.

  • Returns

 Nothing

  • Scope

All

 setQuantity(quantity)
Description

Set the default quantity of material to use. This is here in compliance with ISA-95 standard.

Syntax

setQuantity(quantity)


  • Parameters

 double quantity - The quantity of material

  • Returns

 Nothing

  • Scope

All

Code Snippet
material_to_add = ps.createComplexProperty('Material', 'Material To Add')
material_to_add.setQuantity(10.0)
 setQuantitySource(quantitySource)
Description

Informs the configuration of quantity data for the material resource.  Examples include manually specifying quantity, using the available quantity of a material lot, or linking to another material resource.

Syntax

setQuantitySource(quantitySource)


  • Parameters

 string quantitySource - The quantity source property to set for material.

  • Returns

Nothing

  • Scope

All

Code Snippet
#When defining a process segment with a quantity source of type link make sure the QuantitySourceLink for both the in and out match each other. 
#This is what is telling the material resources that they are connected to each other.
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in.setQuantitySource('Manual')  # Set the quantity source
 setQuantitySourceLink(quantityLink)
Description

Set the value of quantity source link property for material.

Syntax

setQuantitySourceLink(quantityLink)


  • Parameters

 double quantityLink - The quantity source link property to set for material.

  • Returns

Nothing

  • Scope

All

Code Snippet
# We will connect the lot quantity from "Almonds In" to "Almonds Out"
 
# Since we set the quantity for material_property_in to manual we will define what quantity we want to create
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in.setQuantitySource('Manual')
 
# By setting the quantity source link to 'Link' we are exposing the quantity for use to other segments with 
# the same link
material_property_in.setQuantitySourceLink('Link')
 
#When defining a process segment with a quantity source of type link make sure the QuantitySourceLink for both the in and out match each other. 
#This is what is telling the material resources that they are connected to each other.
material_property_out = process_segment.createComplexProperty('Material', 'Almonds Out')
material_property_in.setQuantitySource('Link')
material_property_in.setQuantitySourceLink('Link')
 setRate(rate)
Description

Sets the rate for the response material lot.

Syntax

setRate(rate)


  • Parameters

double matRate - The number of units produced per period

  • Returns

Nothing

  • Scope

All

Code Snippet
material_resource_property = ps.createComplexProperty('Material', 'Material to Use')material_resource_property.setRate(1) # 1 unit will produced every rate period
 setRatePeriod(ratePeriod)
Description

This is used to set the material rate period.

Options

Min - For setting the rate in minutes.

Hour For setting the rate in hours.

Cycle For setting the rate in cycles.

Syntax

setRatePeriod(ratePeriod)


  • Parameters

String ratePeriod - The name of material rate period you want to use.

  • Returns

Nothing

  • Scope

All

Code Snippet
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in.setRatePeriod('Min') # Every minute the period will trigger
 setUnits(units)
Description

Set units defined for this equipment.

Syntax

setUnits(units)


  • Parameters

 String units - The units for equipment.

  • Returns

 Nothing

  • Scope

All

Code Snippet
mat_prop = ps.createComplexProperty('Material', 'Received Nuts')
mat_prop.setUnits('lbs') #Will be recorded in pounds
 setUse(use)
Description

Set the value of use property defined for this material.

Syntax

setUse(use)


  • Parameters

 String use - The use property to set for material ('In', 'Out', 'Consumable', 'By-product'.

  • Returns

 Nothing

  • Scope

All

Code Snippet
material_property_in = process_segment.createComplexProperty('Material', 'Almonds In')
material_property_in.setUse('In')
 Click here to expand...

The AbstractMESComplexProperty object provides the following functions:

Naming Characters Allowed

Names must begin with a letter, digit or underscore. Subsequent characters may also include spaces and dashes. The following characters are not allowed:

ObjectCharacters not allowed
Production Equipment. ? ! # % ^ * ~ [ ] { } + = ` \, @ & ( ) < >
MES Person. ? ! # % ^ * ~ [ ] { } + = ` \/ " $ | < >
All other MES Objects. ? ! # % ^ * ~ [ ] { } + = ` \/ " $ | ,

 addCustomProperty(name, dataTypeName, description, units, productionVisible, required, value)
Description

Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The Complex Property Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.

Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"

Syntax

addCustomProperty(name, dataTypeName, description, units, productionVisible, required, value)


  • Parameters

String name - The name of the custom property to add.

String dataTypeName - The name of the Ignition data type to make the new custom property.

String description - The description of the custom property.

String units - The units of the new custom property. This is just for reference.

boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.

boolean required - If True, a value must be assigned to the custom property before and segment is ended.

String value - The value to assign to the custom property after it has been added.

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
#Load a MES object
obj = system.mes.loadMESObject('Box', 'MaterialDef')
 
#Add Type custom property directly to the MES object
obj.addCustomProperty('Type', 'String')
 
#Add Dimension custom property directly to the MES object
obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False)
 
#Add Width custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24')
 
#Add Height custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12')
 
#Type custom property was never assigned a value so None is returned
print obj.getPropertyValue('Type')
 
#Remember to save the MES object
system.mes.saveMESObject(obj)
 
#Width and Height custom properties were assigned values
print obj.getPropertyValue('Dimension.Width')
print obj.getPropertyValue('Dimension.Height')
Output
None
24
12
 addCustomProperty(name, dataTypeName, description, units, productionVisible, required)
Description

Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The Complex Property Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.

Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"

Syntax

addCustomProperty(name, dataTypeName, description, units, productionVisible, required)


  • Parameters

String name - The name of the custom property to add.

String dataTypeName - The name of the Ignition data type to make the new custom property.

String description - The description of the custom property.

String units - The units of the new custom property. This is just for reference.

boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.

boolean required - If True, a value must be assigned to the custom property before and segment is ended.

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
#Load a MES object
obj = system.mes.loadMESObject('Box', 'MaterialDef')
 
#Add Type custom property directly to the MES object
obj.addCustomProperty('Type', 'String')
 
#Add Dimension custom property directly to the MES object
obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False)
 
#Add Width custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24')
 
#Add Height custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12')
 
#Type custom property was never assigned a value so None is returned
print obj.getPropertyValue('Type')
 
#Remember to save the MES object
system.mes.saveMESObject(obj)
 
#Width and Height custom properties were assigned values
print obj.getPropertyValue('Dimension.Width')
print obj.getPropertyValue('Dimension.Height')
Output
None
24
12
 addCustomProperty(propertyPath, name, dataTypeName, description, units, productionVisible, required)
Description

Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The Complex Property Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the property path is used to specify the property.

Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"

Syntax

addCustomProperty(propertyPath, name, dataTypeName, description, units, productionVisible, required)


  • Parameters

String propertyPath - The name or property path of the custom property.

String name - The name of the custom property to add.

String dataTypeName - The name of the Ignition data type to make the new custom property.

String description - The description of the custom property.

String units - The units of the new custom property. This is just for reference.

boolean productionVisible - The default is false. If True, show the custom property in various components. If False, it will be hidden and can be used to store values behind the scenes.

boolean required - If True, a value must be assigned to the custom property before and segment is ended.

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
#Load a MES object
obj = system.mes.loadMESObject('Box', 'MaterialDef')
 
#Add Type custom property directly to the MES object
obj.addCustomProperty('Type', 'String')
 
#Add Dimension custom property directly to the MES object
obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False)
 
#Add custom property by specifying the property path
obj.addCustomProperty('Kind', 'Dimension', 'String', 'Dimension of box', '', True, False)
#Add Width custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24')
 
#Add Height custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12')
 
#Type custom property was never assigned a value so None is returned
print obj.getPropertyValue('Type')
 
#Remember to save the MES object
system.mes.saveMESObject(obj)
 
#Width and Height custom properties were assigned values
print obj.getPropertyValue('Dimension.Width')
print obj.getPropertyValue('Dimension.Height')
Output
None
24
12
 addCustomProperty(name, dataTypeName)
Description

Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The Complex Property Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the parent path is used to specify the parent.

Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"

Syntax

addCustomProperty(name, dataTypeName)


  • Parameters

String name - The name of the custom property to add.

String dataTypeName - The name of the Ignition data type to make the new custom property.

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
#Load a MES object
obj = system.mes.loadMESObject('Box', 'MaterialDef')
 
#Add Type custom property directly to the MES object
obj.addCustomProperty('Type', 'String')
 
#Add Dimension custom property directly to the MES object
obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False)
 
#Add Width custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24')
 
#Add Height custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12')
 
#Type custom property was never assigned a value so None is returned
print obj.getPropertyValue('Type')
 
#Remember to save the MES object
system.mes.saveMESObject(obj)
 
#Width and Height custom properties were assigned values
print obj.getPropertyValue('Dimension.Width')
print obj.getPropertyValue('Dimension.Height')
Output
None
24
12
 addCustomProperty(propertyPath, name, dataTypeName)
Description

Custom properties can be added to MES objects or even complex properties (such as a material, equipment or personnel reference) of an MES object. The Complex Property Functions method can be used to add a custom property directly to a MES object by not specifying a path to the parent property. To add a custom property as a child of an existing custom property or to a complex property, the property path is used to specify the property.

Each level of the path is separated with a period. This allows for names to be duplicated provided the path is unique. For example, it is possible for a MES object to have custom properties "Dimension 1.Width" and "Dimension 2.Width"

Syntax

addCustomProperty(propertyPath, name, dataTypeName)


  • Parameters

String propertyPath - The name or property path of the custom property.

String name - The name of the custom property to add.

String dataTypeName - The name of the Ignition data type to make the new custom property.

  • Returns

Nothing

  • Scope

All

Code Examples
Code Snippet
#Load a MES object
obj = system.mes.loadMESObject('Box', 'MaterialDef')
 
#Add Type custom property directly to the MES object
obj.addCustomProperty('Type', 'String')
 
#Add custom property with property path parameter
obj.addCustomProperty('Kind', 'Type', 'String')
#Add Dimension custom property directly to the MES object
obj.addCustomProperty('Dimension', 'String', 'Dimension of box', '', True, False)
 
#Add Width custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Width', 'Int4', 'Width of box', 'in', True, False, '24')
 
#Add Height custom property to the previous Dimension custom property and assign a value
obj.addCustomProperty('Dimension', 'Height', 'Int4', 'Height of box', 'in', True, False, '12')
 
#Type custom property was never assigned a value so None is returned
print obj.getPropertyValue('Type')
 
#Remember to save the MES object
system.mes.saveMESObject(obj)
 
#Width and Height custom properties were assigned values
print obj.getPropertyValue('Dimension.Width')
print obj.getPropertyValue('Dimension.Height')
Output
None
24
12
 getAllCustomProperties()
Description

Returns all the custom properties.

Syntax

getAllCustomProperties()


  • Parameters

None

  • Returns

List<MESCustomProperty> - The list of custom properties.

  • Scope

All

Code Examples
Code Snippet
matDef = system.mes.loadMESObject('Cane Sugar', 'MaterialDef')
matDef.getAllCustomProperties()
 getBaseName()

Complex properties that use extended naming have an associated base name and a number following it. This is used with Lot Reference Property that the Response Segment uses. Each time a lot reference is created it is named the base name with an extension added to it.

For example:

If balsamic vinegar is being unloaded and the tank it is being stored in fills up before the truck is fully unloaded. When it is switched to another storage tank a new lot reference is created. If the name of the material reference in the Process Segment is named Vinegar, then the first lot reference is named Vinegar-1 for the first storage tank and the second is Vinegar-2 for the second storage tank.

Description

Get the base name for the complex property.

Syntax

getBaseName()


  • Parameters

None

  • Returns

  String baseName - The base name for the complex property.

  • Scope

All

Code Examples
Code Snippet
#This code snippet prints the base name for the specific property.
seg = system.mes.createMESObject('ProcessSegment')
#Create a new material reference complex property
materialProp = seg.createComplexProperty('Material', 'Vinegar')
print materialProp.getBaseName()
Output
Vinegar
 getName()

Complex properties that use extended naming have an associated base name and a number following it. This is used with Lot Reference Property that the Response Segment uses. Each time a lot reference is created it is named the base name with an extension added to it.

For example:

If balsamic vinegar is being unloaded and the tank it is being stored in fills up before the truck is fully unloaded. When it is switched to another storage tank a new lot reference is created. If the name of the material reference in the Process Segment is named Vinegar, then the first lot reference is named Vinegar-1 for the first storage tank and the second is Vinegar-2 for the second storage tank.

Description

Get the name for the complex property.

Syntax

getName()


  • Parameters

None

  • Returns

 String - The name for the complex property.

  • Scope

All

Code Examples
Code Snippet
seg = system.mes.createSegment('Receive Steel', '[global]\Enterprise\Site\Area\Unload Station 1', True)
seg.setMaterial('Steel In', '84000', '[global]\Enterprise\Site\Receiving\Steel\QC Holding', 'Lot 84000-1', 100.0)
cnt = seg.getComplexPropertyCount('ResponseMaterial')
for ndx in range(0, cnt):
 prop = seg.getComplexProperty('ResponseMaterial', ndx)
 print prop.getName()
seg.begin()
seg = system.mes.getActiveSegment('Enterprise\Site\Area\Unload Station 1', 'Receive Steel')
seg.setMaterial('Steel In', '84001', '[global]\Enterprise\Site\Receiving\Steel\QC Holding', 'Lot 84001-1', 100.0)
seg.update()
seg = system.mes.getActiveSegment('Enterprise\Site\Area\Unload Station 1', 'Receive Steel')
cnt = seg.getComplexPropertyCount('ResponseMaterial')
for ndx in range(0, cnt):
 prop = seg.getComplexProperty('ResponseMaterial', ndx)
 print prop.getName()
Output
Steel In-1
Steel In-2
 getParentProperty(propertyName)
Description

Get the parent property for this complex property.

Syntax

getParentProperty(propertyName)


  • Parameters

String propertyName - The name of complex property to return the parent property for.

  • Returns

AbstractMESProperty - The parent property of the specified complex property.

  • Scope

All

Code Examples
Code Snippet
matDef = system.mes.loadMESObject('Cane Sugar', 'MaterialDef')
matDef.getParentProperty('Width')
 getValue(valueName)
Description

Returns the value for the specific property.

Syntax

 getValue(valueName)


  • Parameters

String valueName - The name of the value to return.

  • Returns

String - The value as an object, or returns null if the property is not found (does not throw an error).

  • Scope

All

Code Examples
Code Snippet
#This code snippet prints the value for the specific property.
seg = system.mes.createMESObject('ProcessSegment')
#Create a new material reference complex property
materialProp = seg.createComplexProperty('Material', 'Vinegar')
print materialProp.getValue('MaterialProductionSelectable')
Output
True
 setValue(valueName, value)
Description

Set the value for the specified value name.

Syntax

 setValue(valueName, value)


  • Parameters

String valueName - The name of the value to set.

String value - The new value.

  • Returns

boolean - True if the property has been set successfully and False otherwise (does not thrown an error if property does not exist or is of a different type).

  • Scope

All

Code Examples
Code Snippet
#Example
seg = system.mes.createMESObject('ProcessSegment')
#Create a new material reference complex property
materialProp = seg.createComplexProperty('Material', 'Vinegar')
materialProp.setValue('MaterialRatePeriod', 'Sec')
materialProp.setValue('MaterialRate', '74')
#Just to make sure the value is reset.
print materialProp.getValue('MaterialRatePeriod')
  
##Save the segment to manifest the changes.
system.mes.saveMESObject(seg)
Output
Sec

  • No labels