Skip to main content
Version: 2.6

Siemens S7 Alarm and Events

Alarm Address

The Address for the alarms is following:

AddressDescriptionData Type
Plc1.OEMAlarmEvent:0System Alarm and operator message reader.TAlarmEvent[]

Messages are not acknowledged by the HumanOS® IoT Platform. Typically, this is done by the machine component when its associated reset action is activated.

Alarm Item

See the Operation Manual for the containing fields.

Alarm Tasks and Mapping

The driver supports PLC alarms by mapping source.

It is possible to declare multiple alarm sources (tasks) for one alarm address (pool).

This example shows three alarm sources with a mapping file:

{
"AlarmEventPool": {
"Id": "0efafbcd-447a-4fb6-900d-51affdc25e8f",
"Name": "Alarming",
"HistoryMode": {
"Retention": 20,
"SamplingRate": 2000
},
"Tasks": [
{
"Id": "66d0a44d-83e8-494d-9e15-5af16df60d55",
"Name": "Alarm Messages",
"Address": "Plc1.OEMAlarmEvent:0",
"Properties": [
{
"Name": "MessageMappingFile",
"Value": "Signallist.json"
},
{
"Name": "MessageCount",
"Value": 187,
"DataType": "System.Int32"
},
{
"Name": "StartAddress",
"Value": "Plc1.DataBlock.ByteArray:970.0[47]"
},
{
"Name": "MessageFormat",
"Value": "BitMessage"
},
{
"Name": "Message:Type",
"Value": "Raise"
}
]
},
{
"Id": "f2280557-9806-414d-b002-aa3e30fb79b5",
"Name": "Alarm Confirm Messages",
"Address": "Plc1.OEMAlarmEvent:0",
"Properties": [
{
"Name": "MessageMappingFile",
"Value": "Signallist.json"
},
{
"Name": "MessageCount",
"Value": 187,
"DataType": "System.Int32"
},
{
"Name": "StartAddress",
"Value": "Plc1.DataBlock.ByteArray:971.0[47]"
},
{
"Name": "MessageFormat",
"Value": "BitMessage"
},
{
"Name": "Message:Type",
"Value": "Confirm"
}
]
}
]
}
}
AccessorDescription
IdUnique Id for each task
NameA name for the task
AddressAlarm address (pool)
Property MessageMappingFileThe mapping file to load (copy to The mapping file to load - copy to .\Config\HumanOS.UHAL.SiemensS7Control\)
Property MessageCountAmount of messages which are mapped (depends on the Property MessageFormat)
Property StartAddressThe corresponding source address with offset and length (depends on the Property MessageFormat)
Property MessageFormatBitMessage or Channel32Message
Property Message:TypeType 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"
}
]
}
]
}
AccessorDescription
IdSpecifies the bit number (absolute)
AlarmTypeSpecifies the Alarm type, see Alarm Types in Alarm and Event Source
OemIdThe Condition name of the alarm or event
TextSpecifies the message
PropertiesSpecify properties which are attached to this alarm or event and can later be accessed
Properties:NameProperty name
Properties:ValueProperty value

Example in the designer:

Calculation of MessageCount

The "MessageCount" together with the "MessageFormat" specifies the amount of data to be read.

MessageFormatDescription
BitMessageThe entered value is divided by 8 and rounded to the next bigger number of 8*value to specify the number of bytes to be read, the raw value is mapped to the message file
Channel32MessageThe entered value is multiplied by 4 to specify the number of bytes to be read, the raw value is mapped to the message file
Bitmessage

Examples BitMessage:

Entered ValueNumber of bytes read by driverMapped messages (bits)
000
212
818
929
20025200
10561321056
Channel32Messages

Each segment displays a bit and a bit equals a channel, so for example if there are 32 error LEDs on a device each segment could be one LED. The 32-bit channel messages allow bundling of errors of the same type. One error text will then be applied for all 32 bits, with the channel id automatically attached.

Examples Channel32Message:

Entered ValueNumber of byes read by driverMapped messagesMapped bits
0000
14132
4164128
9369288
166416512
33132331056

Calculation of StartAddress

The "StartAddress" specifies the source, offset and length of the data array.

It is possible and needed by Channel32Messages to specify a higher length than the "MessageCount". The suggestion is to calculate the "MessageCount" and adapt the value in the brackets to avoid conflicts.

BitMessage:

CalculationExample
MessageCount / 8 -> round to next bigger whole number20/8=2.5 -> 3 Bytes
Length * 83*8=24 Messages/Bits

Channel32Message:

CalculationExample
MessageCount * 410*4=40 Bytes
Length / 440/4=10 Messages/Bits

The address Plc1.DataBlock.ByteArray:972.0[48] means:

  • Source: DataBlock
  • DataType: ByteArray
  • Source Number: 972
  • Offset in byte: 0
  • Length in byte: 48

Examples:

Bracket Value (Array Length)MessageCountMessageFormatResulting Length in bytes
11BitMessage1
41BitMessage1
1616BitMessage2
16128BitMessage16
41Channel32Message4
82Channel32Message8
1322Channel32Message8