OPC-UA Alarm and Event Access
Alarm and condition module of OPC-UA server can be accessed using the alarm event source info.
The address is the node id of the main object providing A&C.
{
"AlarmEventPool": {
"Id": "FA1611AB-B6C9-4FF4-B34D-BF35E6A44232",
"Name": "AlarmEventPool",
"Tasks": [
{
"Id": "E669AF07-0991-4A40-A7A4-9D2B2B881D07",
"Name": "Standard Messages",
"Address": "ns=2;g={ece37fdf-4862-4543-af23-48ffdb8203c7}"
}
],
"HistoryMode": {
"Retention": 1,
"SampleRate": 1000
}
}
}
OEM Message Mapping
The driver supports PLC alarms by mapping source. It is possible to declare multiple alarm sources (tasks) for one alarm address (pool).
As source address only System.Byte[]
is allowed.
This example shows three alarm sources with a mapping file:
"AlarmEventPool": {
"Id": "FA1611AB-B6C9-4FF4-B34D-BF35E6A44232",
"Name": "AlarmEventPool",
"Tasks": [
{
"Id": "66d0a44d-83e8-494d-9e15-5af16df60d55",
"Name": "Alarm Messages",
"Address": "OEMAlarmEvent",
"Properties": [
{
"Name": "MessageMappingFile",
"Value": "OEMBitMessages.json"
},
{
"Name": "MessageCount",
"Value": 8,
"DataType": "System.Int32"
},
{
"Name": "SourceName",
"Value": "OpcUa",
"DataType": "System.String"
},
{
"Name": "StartAddress",
"Value": "ns=2;s=Demo.Static.Arrays.Byte"
},
{
"Name": "MessageFormat",
"Value": "BitMessage"
},
{
"Name": "Message:Type",
"Value": "Raise"
}
]
}
]
}
Accessor | Description |
---|---|
Id | Unique Id for each task |
Name | A name for the task |
Address | Alarm address (pool) |
Property MessageMappingFile | The mapping file to load (copy to .\Config\HumanOS.UHAL.OpcUaControl\ ) |
Property MessageCount | Amount of messages which are mapped (depends on the Property MessageFormat) |
Property StartAddress | The corresponding source address with offset and length (depends on the Property MessageFormat) |
Property MessageFormat | BitMessage or Channel32Message |
Property Message:Type | Type of each message that occurs from this source |
A property which starts with Message: is attached as property to the alarm item (e.g. message) which means additional fields are added with this data and can be used later on.
Mapping means, the alarms and events are defined by the data given and not the data that the alarm source provides.
The mapping source must either be of type JSON and must be structured like this example:
{
"Messages": [
{
"Id": 0,
"AlarmType": "Alarm",
"OemId": "Alarm 1",
"Text": "PU Sammelfehler",
"Properties": [
{
"Name": "MyProperty",
"Value": "Some other info"
},
{
"Name": "EnableRmq",
"Value": "1"
},
{
"Name": "EnableRest",
"Value": "0"
}
]
}
]
}
Accessor | Description |
---|---|
Id | Specifies the bit number (absolute) |
AlarmType | Specifies the Alarm type, see Alarm Types in Alarm and Event Source |
OemId | The Condition name of the alarm or event |
Text | Specifies the message |
Properties | Specify properties which are attached to this alarm or event and can later be accessed |
Properties:Name | Property name |
Properties:Value | Property value |