Professional Documents
Culture Documents
P ML / I G: ACK Unit Machine Mplementation Uide
P ML / I G: ACK Unit Machine Mplementation Uide
IMPLEMENTATION GUIDE
Part 2: Standard Representation of PackTags in an OPC UA Server
Summary
This document “Standard Representation of PackTags in an OPC UA server” is the second part of
the PackML unit/machine Implementation Guide. The PackML unit/machine Implementation
Guide is a Best Practice Recommendation based on ANSI/ISA TR88.00.02-2015. The purpose of this
guideline is to help companies with different knowledge levels to implement PackML interfaces on
Units/Machines. This document contains best practice recommendations based on the real
implementation of PackML interfaces using OPC UA by a number of OMAC member companies as
well as other users.
This document is the second part in a series of document related to build PackML unit/machines.
Further documents are forthcoming and will focus on issues such as PackML Machine software
code structure, PackML and Safety, PackML and Line Integration, PackML OEE and PackML
HMI.
1.2. GOALS
This PackML implementation guide provides a definition of the minimum requirements of a OPC
UA PackTags interface. For example, there are practical examples on how to setup the OPC UA
Server to fulfil the requirements for handling the Admin, Command and Status PackTags. It also
addresses how different OPC UA implementations can be done. The guideline provides examples
of how to configure the PackTags within the OPC UA Server.
Benefits for both End Users and Machine Suppliers include:
• Easy integration of unit/machines via standard OPC UA Server
• Reduction of integration cost
1
See also https://opcfoundation.org/markets-collaboration/plcopen/
1.3. BACKGROUND
The OMAC End Users want to achieve a unified way of interfacing with units/machines on the
factory floor. Providing this unified interface will ensure easy integration with a supervisory
control system. There are similar interfaces to all units, and the units have the same data
structure interfaces available.
By applying a unified user interface based on the PackML State Model an operator can be guided
in case of an unplanned stoppage. Furthermore, there can be common event handling on all units,
providing the End User the possibility to view stop reasons in a common way for all units.
The interface described in this document is built on the international reference model PackML
defined by The International Society of Automation (ISA). The interface follows the PackML State
Model as described in the reference ANSI/ISA TR88.00.02-2015.
Basic understanding and knowledge of the TR88.00.02 technical report is required before reading
this Best Practice Recommendation. In fact, it is strongly recommended to have the report in
hand when reading this document.
A unit/machine is defined as a collection of physical equipment and control functions that perform
one or more major processing functions. A unit/machine can be a single machine or a subset of a
whole packaging line. The term unit and machine are used interchangeably in this document.
Machine Suppliers are defined as companies or organizations that provide PackML compliant
unit/machines. End users are defined as companies or organizations that use PackML compliant
unit/machines in production facilities.
2 The list is not complete and there could be changes in the document titles.
3
OEE guideline and HMI guideline are under development as identified by the OMAC OPW strategy.
AddressSpace: The collection of objects and related information that the OPC UA Server makes
available to Clients is referred to as its AddressSpace.
Attributes: OPC UA defines eight distinct NodeClasses. These are: Object, Variable, Method,
View, ObjectType, VariableType, DataType, and ReferenceType. Each NodeClass includes a fixed
set of information referred to as its attributes. The attributes common to all NodeClasses, the so-
called base attributes, are: NodeId, NodeClass, DisplayName, Browse Name, Description,
WriteMask, and UserWriteMask. Each of these is defined below.
BrowseName: A fixed (i.e. non-localized) string used to label the node internally. The
BrowseName is used by the client to identify the Node when browsing.
Description: A localize string used to provide additional information about the node.
DisplayName: A localized string used to display the name of the node on a user interface.
“Localized” here means that the Display Name may vary depending according to the user's native
(or configured) language.
NodeClass: The NodeClass attribute contains information about the purpose or intrinsic
functionality of the Node itself. A fixed set of enumerated values is defined: Object, Variable,
Method, ObjectType, VariableType, ReferenceType, DataType and View.
NodeId: Each node within an AddressSpace is uniquely identified by its NodeId, the components
of which are NamespaceIndex (Uint16), IdentifierType (Numeric, String, GUID or Opaque) and
Identifier. The format of the value assigned to Identifier depends on the IdentifierType.
Nodes: OPC UA represents features within the AddressSpace by nodes. Each node has a
distinct NodeClass, the main types of which are Object, Variable, and Method. For example, a
method is represented by a node of NodeClass Method. Each node within the AddressSpace is
uniquely identified by its NodeId. For convenience, we will sometimes refer to a node with
NodeClass Object as an Object node or a node with NodeClass Variable as a Variable node.
Object: OPC UA uses objects to provide a formal representation of data together with related
events or methods. Objects may be linked by references. The well-known object-oriented
concepts of type hierarchy and inheritance are supported.
Figure 2 The OPC UA object model encapsulates variables, methods, etc. in a single formal entity. References to other objects may also be
defined. For more information, see [4], §4.2. Figure used with permission.
References: Nodes within an AddressSpace may be related to one another by References. Both
hierarchical and non-hierarchical reference types are supported. References provide the formal
mechanism by which notions of type hierarchy and inheritance may be represented.
Root Node: Each AddressSpace has a unique node called its root. All nodes within an address
space are linked, either directly or indirectly through a sequence of references, to the root.
UserWriteMask: The UserWriteMask indicates which of the Node attributes may be modified
by the user currently connected to the server.
Variable: Computer programmers use the term variable to denote a symbolic name associated
with a memory address. For our purposes here, a variable always includes a type, which restricts
the kind of information that the variable may represent. For example, if myBool is a Boolean
variable, then myBool may either be TRUE or FALSE, but it may not take the integer value 123.
In PLC programming, variable is used interchangeably with the term tag. Variable will also be
used in the context of OPC UA to describe a particular NodeClass that introduces a Value
attribute to hold some concrete value. As we shall see in the next section, all single-valued
programming variables, and in particular all PackTags of elementary type, will be associated
with Nodes of NodeClass Variable.
WriteMask: The WriteMask indicates which of the Node attributes may be modified by an OPC
UA client.
3.1.1. NODEID
Each node within a given AddressSpace has a unique identifier called its NodeId. The PLCopen
companion specification [2] does not place any requirements on this structure. An example of
how one technology provider handles this is given in Figure 3. Note that the Identifier Type is
String and that the associated Identifier string reflects in a canonical way the nested PackTag
structure. This is considered best practice and users are strongly encouraged to follow this
pattern.
Figure 3 Example NodeId definition. The format of the Identifier string 4 is not standardized and will vary from vendor to vendor. In this
case the associated PackTag is Machine_01.Status.CurMachSpeed.
3.1.2. NODECLASS
All PackTags of elementary type (DINT, REAL, STRING, etc.) shall be represented in the in
AddressSpace by nodes of NodeClass Variable. Examples of PackTags of elementary type are
UnitName.Status.CurMachSpeed (REAL), UnitName.Admin.Parameter[#].Unit (STRING) or
UnitName.Status.StateCurrent (DINT).
It is recommended that complex types be represented by Variable nodes as well, but it is
acceptable to represent these simply as Objects. Representing the complex types as Variables has
the advantage of allowing the underlying complex data to be read by a UA client in a single call.
The two basic approaches to complex type modelling are compared in Appendices 1 and 2. This
topic is also revisited in detail in §3.5 Mapping of structure data types.
4 It’s not mandatory to have a string identifier – Numeric based identifiers is also possible. A lot of very small
implementations (resource limited devices) may wish to use numeric identifiers as they require less memory. Basically,
string Ids are the preference but not mandatory.
3.1.4. DISPLAYNAME
The DisplayName is a localized string used to display the name of the node. Because ISA-
TR88.00.02-2015 does not describe localized PackTag names, it is recommended that the
DisplayName match the BrowseName as defined above.
3.1.5. DESCRIPTION
Description is an optional attribute used to provide additional information about the node itself.
Its use is not specified.
3.1.6. WRITEMASK
WriteMask is an optional attribute that describes which of the node's attributes may be altered
by a client. Its use is not specified.
3.1.7. USERWRITEMASK
UserWriteMask is an optional attribute that describes which of the node's attributes may be
altered by a particular user. Its use is not specified.
DataType Mandatory NodeId The DataType of the Value attribute. With respect to
single-valued PackTags, only four BaseDataTypes are
used: Boolean [1], Int32 [6], Float [10] and String
[12]. Here the numeric identifiers are defined by the
standard OPC UA nodeset. For complex data, an
appropriate subtype of BaseDataType>Structure
must be defined.
5
See [2] §5.3 for additional information regarding the general case.
6
This Guideline places no focus on historizing.
7 History can be represented in a more primitive way, e.g. history of last X alarms as an array rather than historizing.
It is recommended that OPC UA servers also provide the component data of each structure as a
set of sub-variables. This allows OPC UA clients that do not support complex data to access each
of the individual scalar values. It also allows advanced clients to read/write an individual tag
without having to read/write an entire command/status/admin structure. Figures 4 and 5 indicate
how a sample data structure, together with its individual elements, may be mapped. Note that
this approach requires that each IEC 61131-3 structure be modelled additionally as a
VariableType. The examples are taken directly from [2].
TYPE ExampleIEC611313Structure:
STRUCT
IntStructureElement: INT;
RealStructureElement: REAL;
BoolStructureElement: BOOL;
END_STRUCT;
END_TYPE
Struct ExampleIEC61131-3
{
public short IntStructureElement;
public float RealStructureElement;
public bool BoolStructureElement;
}
Figure 8 Mapping of the PackML EQUIPMENTINTERLOCK type as a variable type. The components of EquipmentInterlock VariableType,
Blocked and Starved, are Booleans.
Figure 11 Mapping a complex PackTag as an ObjectNode requires the definition of a suitable ObjectType. Note that in this case there is no
value associated with the node itself. Only the elementary subtypes (Blocked and Starved) may be read.
8
The top level PackMLV30, Command, Status and Admin could be ObjectTypes as it’s not required to read all data
atomically at that level. Anything lower could be a variable of datatype custom structure allowing for atomic read. At the
same level, variables could also be associated with a variable type definition to expose individual sub data items.
Attribute Value
BrowseName <Variable Name> or <IEC Data Type Name>
Note that ISA-TR88.00.02-2015 does not specify lower and upper limits for most of the arrays
included in the PackTags interface. In these cases, IndexMin and IndexMax may be freely
defined provided IndexMin.Value <= IndexMax.Value. By constrast DateTime and
AckDateTime9 must be defined as DINT arrays with a IndexMin.Value = 0 and IndexMax.Value
= 6.
Some users may want to simplify the PackTags interface by imposing the rule that all arrays
begin at index 0. Other users may have this rule forced on them. C#, for example, begins all
arrays at index 0. In these cases, the additional properties defined by [2] are essentially
redundant and may be safely omitted in non-PLC implementations.
4.1. ALARM
The alarm type contains information required to describe an individual alarm or warning. PackTags
of this type include UnitName.Admin.Alarm[#], UnitName.Admin.AlarmHistory[#],
UnitName.Admin.Warning[#], etc.
TYPE ALARM:
STRUCT
///
///Alarm or warning current status
Trigger: BOOL;
///
///Alarm or warning identification number
ID: DINT;
///
///Context specific value associated to given alarm or warning
Value: DINT;
///
///Alarm or warning description
Message: STRING;
///
///Identification number associated to alarm type or severity
Category: DINT;
///
///Time stamp of alarm or warning occurrence. Format year:month:day:hour:min:sec:µsec
DateTime: ARRAY[0..6] OF DINT;
///
///Time stamp of alarm or warning acknowledgment. Format year:month:day:hour:min:sec:µsec
AckDateTime: ARRAY[0..6] OF DINT;
END_STRUCT
END_TYPE
4.2. COUNT
The count type contains information required to track the number of occurrences of a given
operation. The operation itself may also be described. UnitName.Admin.ProdConsumedCount[#]
and UnitName.Admin.ProdProcessedCount[#] are examples of PackTags of this type.
TYPE COUNT:
STRUCT
///
///Product identification number
ID: DINT;
///
///Product description
4.3. DESCRIPTOR
The descriptor type is used to describe parameters in the unit/machine.
UnitName.Status.Parameter[#] and UnitName.Command.Product[#].Ingredients[#].Parameter[#]
are examples of this type.
TYPE DESCRIPTOR:
STRUCT
///
///Parameter identification number
ID: DINT;
///
///Parameter description
Name: STRING;
///
///Parameter units of measure
Unit: STRING;
///
///Numeric value of parameter
Value: REAL;
END_STRUCT
END_TYPE
4.4. EQUIPMENTINTERLOCK
The equipment interlock type signals if the unit/machine is blocked or starved.
UnitName.Status. EquipmentInterlock is the only example of this type.
TYPE EQUIPMENTINTERLOCK:
STRUCT
///
///Machine stoppage due to downstream fault
Blocked: BOOL;
///
///Machine stoppage due to upstream or supply fault
Starved: BOOL;
END_STRUCT
END_TYPE
TYPE INGREDIENT:
STRUCT
///
///Ingredient identification number
IngredientID: DINT;
///
///Parameters associated to given ingredient
Parameter: ARRAY[] OF DESCRIPTOR;
END_STRUCT
END_TYPE
4.6. INTERFACE
The interface type includes data used to coordinate state machine transitions between machines.
Parameter information may also be exchanged. UnitName.Command.RemoteInterface[#]
is an example of this type.
TYPE INTERFACE:
STRUCT
///
///Identification number of upstream or downstream unit machine
Number: DINT;
///
///Control command for upstream or downstream machine
ControlCmdNumber: DINT;
///
///Control command value associated with ControlCmdNumber
CmdValue: DINT;
///
///Parameter data required for peer-to-peer coordination
Parameter: ARRAY[] OF DESCRIPTOR;
END_STRUCT
END_TYPE
4.7. PRODUCT
The product type comprises all tags required to make a given product. This includes process-specific
data, as well as all recipe data. UnitName.Command.Product[#] and UnitName.Status.Product[#] are
examples of this type.
TYPE PRODUCT:
STRUCT
///
///Product identification number
ProductID: DINT;
///
///Parameters required for processing given product
TYPE PMLa :
STRUCT
///
///Parameters associated to the local interface (e.g. HMI)
Parameter: ARRAY[] OF DESCRIPTOR;
///
///Listing of all currently active alarms
Alarm: ARRAY[] OF ALARM;
///
///Extent of the Alarm array
AlarmExtent: DINT;
///
///Chronological alarm history, with most recent given as AlarmHistory[0]
AlarmHistory: ARRAY[] OF ALARM;
///
///Extent of AlarmHistory array
AlarmHistoryExtent: DINT;
///
///Alarm associated to the primary cause of machine stoppage ('first fault') (required)
StopReason: ALARM;
///
///Extent of StopReason array
StopReasonExtent: DINT;
///
///Listing of all currently active warnings
Warning: ARRAY[] OF ALARM;
///
///Extent of warning array
WarningExtent: DINT;
///
///Elapsed time in seconds of current mode.
ModeCurrentTime: ARRAY[] OF DINT;
TYPE PMLc :
STRUCT
///
///Numeric representation of the commanded unit mode (required)
UnitMode: DINT;
///
///Signals request that the current value of Command.UnitMode be activated (required)
UnitModeChangeRequest: BOOL;
///
///Machine speed setpoint in units of [primary packages/min] (required)
MachSpeed: REAL;
///
///Bitwise indication that materials are ready for processing.
MaterialInterlock: ARRAY[1..32] OF BOOL;
///
///Numerical representation of the state commands (1=Reset, 2=Start, etc.) (required)
CntrlCmd: DINT;
///
///Signals request that the current value of Command.CntrlCmd be activated (required)
CmdChangeRequest: BOOL;
///
///Use to coordinate activities between peers (i.e. upstream or downstream unit machines.)
TYPE PMLs :
STRUCT
///
///Numeric representation of the active unit mode (required)
UnitModeCurrent: DINT;
///
///Handshaking bit acknowledging that unit mode change request has been made.
UnitModeRequested: BOOL;
///
///Signals that unit mode change request has been accepted; switching is actively in process.
UnitModeChangeInProcess: BOOL;
///
///Numeric representation of the active state (required)
StateCurrent: DINT;
///
///Handshaking value acknowledging that state change request has been made.
StateRequested: DINT;
///
///Signals that state change request has been accepted; switching is actively in process.
StateChangeInProcess: BOOL;
///
///Active machine speed setpoint in units of [primary packages/min] (required)
MachSpeed: REAL;
///
///Actual machine speed in units of [primary packages/min] (required)
CurMachSpeed: REAL;
///
///Bitwise indication that materials are ready for processing.
MaterialInterlock: ARRAY[0..31] OF BOOL;
///
///Signals that the machine is either blocked or starved (required)
EquipmentInterlock: EQUIPMENTINTERLOCK;
///
///Use to coordinate activities between peers (i.e. upstream or downstream unit machines.)
RemoteInterface: ARRAY[] OF INTERFACE;
///
///Current values or parameters associated to the end user supervisory interface.
Parameter: ARRAY[] OF DESCRIPTOR;
///
///Current recipe or process data associated to the various products run on the unit machine.
Product: ARRAY[] OF PRODUCT;
END_STRUCT
END_TYPE
It is recommended to organize all PackML data under an easily recognizable object or folder. In
the example below, PackTags served by Machine_01 appear under the PackML object.
Figure 12 PackTags10 from a single unit/machine, Machine_01, are organized under a dedicated object or folder. The name PackML is
recommended, but not required.
If the OPC UA server contains PackML data from multiple unit/machines, it is recommended
that this data also be organized under this same object. This is shown in Figure 13.
Figure 13 PackTags from unit/machines Machine_01, Machine_02 and Machine_03 are organized under a common object or folder.
10
The only reason Admin, Command and Status are visible in this diagram is because they have a type defintion.
Otherwise, the client is simply interacting with the Machine_01 node of data type PackML30 structure
Figure 14 Construction of the PackML folder using the "Organizes" ReferenceType. UaModeler from Unified Automation GmbH was used
to create the OPC UA model.
6.2. REFERENCES
Table 6 List of references
The preparation of this document is supported by Bosch Rexroth, Mettler Toledo, SESAM-
World and Mitsubishi Electric.
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type11
Class Definition Identifier
PACKMLC30
Variable PACKML30 “en-US”, "UnitName” index, "UnitName” UnitName PACKMLV30
VariableType
PMLc
Variable PMLc "Command” "Command” UnitName.Command PMLc
VariableType
Descriptor
Variable Descriptor "Parameter” "Parameter” UnitName.Command.RemoteInterface[#].Parameter[#] Descriptor
VariableType
11
Data type per ISA-TR88.00.02-2015.
12
The [#] denotes an array of unspecified dimension.
Descriptor
Variable Descriptor "Parameter” "Parameter” UnitName.Command.Parameter[#] Descriptor
VariableType
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Descriptor
Variable Descriptor Descriptor
VariableType "ProcessVariables” "ProcessVariables” UnitName.Command.Product[#].ProcessVariables[#]
Indredient Ingredient
Variable Ingredient
VariableType "Ingredients” "Ingredients” UnitName.Command.Product[#].Ingredients[#]
Variable BaseVariableType 6 [Int32] Int (32-bit)
"IngredientID” "IngredientID” UnitName.Command.Product[#].Ingredients[#].IngredientID
Descriptor Descriptor
Variable Descriptor
VariableType "Parameter” "Parameter” UnitName.Command.Product[#].Ingredients[#].Parameter[#]
Variable BaseVariableType 6 [Int32] "ID” "ID” UnitName.Command.Product[#].Ingredients[#].Parameter[#].ID Int (32-bit)
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable PMLs PMLs "Status” "Status” UnitName.Status PMLs
VariableType
Variable BaseVariableType 6 [Int32] "UnitModeCurrent” "UnitModeCurrent” UnitName.Status.UnitModeCurrent Int (32-bit)
Descriptor
Variable Descriptor "Parameter” "Parameter” UnitName.Status.RemoteInterface[#].Parameter[#] Descriptor
VariableType
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable BaseVariableType 12 [String] "Name” "Name” UnitName.Status.Parameter[#].Name String
Descriptor Descriptor
Variable Descriptor "ProcessVariables” "ProcessVariables” UnitName.Status.Product[#].ProcessVariables[#]
VariableType
Variable BaseVariableType 6 [Int32] "ID” "ID” UnitName.Status.Product[#].ProcessVariables[#].ID Int (32-bit)
Ingredient
Variable Ingredient "Ingredients” "Ingredients” UnitName.Status.Product[#].Ingredients[#] Ingredient
VariableType
Descriptor
Variable Descriptor "Parameter” "Parameter” UnitName.Status.Product[#].Ingredients[#].Parameter[#] Descriptor
VariableType
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
PMLa
Variable PMLa PMLa
VariableType "Admin” "Admin” UnitName.Admin
Descriptor
Variable Descriptor Descriptor
VariableType "Parameter” "Parameter” UnitName.Admin.Parameter[#]
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable AlarmVariableType Alarm "StopReason” "StopReason” UnitName.Admin.StopReason[#] Alarm
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable BaseVariableType 12 [String] "Name” "Name” UnitName.Admin.ProdConsumedCount[#].Name String
Table 15 PackTags Complex data structures mapped as Object nodes (i.e. NodeClass=Object)
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type13
Class Definition Identifier
PACKML30
Object --- “en-US”, "UnitName” index, "UnitName” UnitName PACKMLV30
ObjectType
PMLc
Object --- "Command” "Command” UnitName.Command PMLc
ObjectType
13
Data type per ISA-TR88.00.02-2015.
Table 16 PackTags Complex data structures mapped as Object nodes (i.e. NodeClass=Object)
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Object Descriptor --- "ProcessVariables” "ProcessVariables” UnitName.Command.Product[#].ProcessVariables[#] Descriptor
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Object PMLs ObjectType --- "Status” "Status” UnitName.Status PMLs
EquipmentInterlock Equipment
Object --- "EquipmentInterlock” "EquipmentInterlock” UnitName.Status.EquipmentInterlock
ObjectType Interlock
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable BaseVariableType 12 [String] "Name” "Name” UnitName.Status.Parameter[#].Name String
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
PMLa
Object --- PMLa
ObjectType "Admin” "Admin” UnitName.Admin
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Object AlarmObjectType --- "StopReason” "StopReason” UnitName.Admin.StopReason[#] Alarm
OPC UA ISA-TR88.00.02-2015
Node HasType DataType
DisplayName BrowseName PackTag Type
Class Definition Identifier
Variable BaseVariableType 12 [String] "Name” "Name” UnitName.Admin.ProdConsumedCount[#].Name String