Description

This object defines the properties of personnel resources that may be required by a process segment. It holds resource information (as properties that are accessible through object function calls) that alter the way any operations segments derived from the process segment are executed. This object is itself 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.



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.

Script Example
Code Snippet
ps = system.mes.loadMESObject('Line MES OEE Test', 'ProcessSegment')
depProp = ps.createComplexProperty('Personnel', 'Sarah')
print depProp
Output
>>> 
{PersonnelOptional=false, PersonnelProductionSelectable=true, PersonnelRef=, PersonnelRefUUID=null, 
PersonnelRefType=null, PersonnelUse=, PersonnelQuantity=0.0, PersonnelUnits=}
>>> 


Use

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



Object Properties

These properties are accessible through the MES Object Editor component and with the provided object functions, but not directly as obj.properties. Property values can be accessed and changed for an object by using the getPropertyValue() and setPropertyValue() method. 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.

This object has the following properties that affect how this object operates...

Setting NameTypeScriptingDescription
NameStringPersonnelThis is the name to refer to this personnel resource by. Some process segments have multiple personnel resources and this is a unique name displayed to the operator, shown in analysis and reports, and also internally used to reference this personnel resource.
OptionalbooleanPersonnelOptionalIf the property defined here is always required, then leave this setting unchecked. If this property is optional, then select it.
Production SelectablebooleanPersonnelProductionSelectableThis 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.
Personnel_ReferencePyDictionaryPersonnelRefThis can be set to a Personnel Class or a Person. By setting this to Personnel Class will cause the operator to be prompted for the specific Person for this personnel resource. If set to a Person, then the selection will be automatically selected.
Personnel Reference UUIDStringPersonnelReferenceUUIDUnique identifier (UUID) representing the personnel reference.
UseStringPersonnelUseThe personnel use property is here in compliance with ISA-95 standard, we don't have any internal functions for this though you can specify if this property refers to Production, Maintenance, etc.
QuantityFloat8 PersonnelQuantityPersonnel quantity property is here in compliance with ISA-95 standard, we don't have any internal functions for this.
UnitsStringPersonnelUnitsThis specifies the units for the quantity setting.
Custom Properties

To add new custom property, select this row and click add button on tool bar.

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
#Example to return the reference uuid of a personnel
#Load MES object
mesObject = system.mes.loadMESObject('Mix Nuts', 'ProcessSegment')
equipRef = mesObject.getComplexProperty('Personnel', 'Sarah')
print equipRef.getValue('PersonnelRefUUID')
Output
>>> 
c1e017c5-4813-49e2-8725-8c044ec02857
>>> >>> 





Object Functions

This object provides the following functions:

Info

Personnel references can be set in one of two ways:

  1. Passing an object link to the method setPersonnelRef(personnelRef)

  2. Using a uuid and type with setPersonnelRefUUID(personnelRefUUID) and setPersonnelRefType(personnelRefType)

Description

Returns the corresponding boolean after checking whether the personnel property is optional or not.

Syntax

getOptional()


  • Parameters

 None

  • Returns

  boolean - True if this property is optional and False otherwise.

  • Scope

All

Description

Return the reference of the personnel object.

Syntax

getPersonnelRef()


  • Parameters

 None

  • Returns

 MESObjectLink objLink - The reference link to the personnel object.

  • Scope

All

Description

Get the reference property of personnel object.

Syntax

getPersonnelRefProperty()


  • Parameters

 None

  • Returns

 MESPersonnelRefProperty refProperty - The reference property of the personnel object.

  • Scope

All

Description

Get the type of personnel reference.

Syntax

getPersonnelRefType()


  • Parameters

 None

  • Returns

 String refType - The type of the personnel reference.

  • Scope

All

Description

 Get the uuid that corresponds to personnel reference.

Syntax

getPersonnelRefUUID()


  • Parameters

 None

  • Returns

 String personnelRefUUID - The unique identifier that corresponds to personnel reference.

  • Scope

All

Description

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

Syntax

getQuantity()


  • Parameters

 None

  • Returns

 double quantity - The quantity of personnel.

  • Scope

All

Description

Get units defined for this personnel.

Syntax

getUnits()


  • Parameters

 None

  • Returns

 String units - The units for personnel.

  • Scope

All

Description

Set to True if this property is optional and False otherwise.

Syntax

setOptional(optional)


  • Parameters

 boolean optional - Set to True if this property is not required and False otherwise.

  • Returns

  Nothing

  • Scope

All

Description

 Set reference to the personnel property.

Syntax

setPersonnelRef(personnelRef)


  • Parameters

 MESObjectLink personnelRef - Reference to the personnel property.

  • Returns

 Nothing

  • Scope

All

Description

 Set the type of personnel reference.

Syntax

setPersonnelRefType(personnelRefType)


  • Parameters

String personnelRefType - The type of personnel reference.

  • Returns

Nothing

  • Scope

All

Description

 Set the uuid that corresponds to personnel reference.

Syntax

setPersonnelRefUUID(personnelRefUUID)


  • Parameters

 String personnelRefUUID - The unique identifier that corresponds to personnel reference.

  • Returns

 Nothing

  • Scope

All

Description

Set the quantity of personnel. This is here in compliance with ISA-95 standard.

Syntax

setQuantity(quantity)


  • Parameters

 double quantity - The quantity of personnel.

  • Returns

 Nothing

  • Scope

All

Description

Set units defined for this personnel object.

Syntax

setUnits(units)


  • Parameters

 String units - The number of personnel.

  • Returns

 Nothing

  • Scope

All

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. ? ! # % ^ * ~ [ ] { } + = ` \/ " $ | ,

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

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

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