#Alarm |
Top Previous Next |
The #Alarm object is an alarm archive which monitors the alarms defined in the alarm definition. The alarm object is a global object.
Parameters Object
Text/File
Action
VarValue
VarType
Option
The alarm buffer has a word-based structure and the start address is defined with the alarm object. Each bit from data word 4 represents an alarm. The maximum number of alarms depends on the maximum array size that can be defined on the PLC. The last 512 alarms are stored in a ring buffer (alarm history). The alarm history and the current setting (sorting, filter) are saved retentively in the <alarm>.ini file.
EPAM / PLC handshake: The status bits in the alarm buffer are set from one side and must then be reset by the other side after they have been detected. For example, EPAM sets [0].1 (alarms acknowledged in EPAM), in response to which the PLC resets this bit to 0 as soon as it has processed the value.
Defining the alarm buffer in the PLC
CoDeSys:
Global variables: Example VAR_GLOBAL Alarm : ARRAY[0..20]OF WORD END_VAR
The alarms can then be addressed via Alarm[x].x.
Step7:
In Step7 it's useful to create an array with a bit structure. This allows the alarms to be addressed transparently as in EPAM. Example: Alarm[x].Bit[x]
Alarm ARRAY[0..x] STRUCT Bit ARRAY [0..15] BOOL END_STRUCT
If the S7 alarm variables are created as a bit-structured array, the Raw option must be defined in the UserVar, otherwise the communication driver will swap High/Low bytes.
See also |