#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

Column A, object

M/O

Default

Description

#Alarm

M


Alarm handling

Text/File

Column B, Text/File

M/O

Default

Description

<name>.txt

M


Alarm definition with the alarm variables and the alarm message texts

The name <name> becomes the alarm type and the ID of the alarm object.

 

 

Action

Column K

M/O

Default

Description

#Page=<name>

O


Action is executed when alarms come:

Screen page change to screen page <name>

VarValue

Column P

M/O

Default

Description

Variable

M


Variable that specifies the alarm buffer

VarType

Column Q

M/O

Default

Description

WORD[]

M


Data type array of WORD (length according to number of alarms)

Option

Column S

M/O

Default

Description

Type=<name>

O

Name of the definition file without extension ".TXT"

Alarm type (allows the definition of several alarm objects with the same alarm definition)

 


Structure of the alarm buffer

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

 

Icon-Hinweis Alarm Array in UserVar

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.

 

Variable name

Type

Size [byte]

Address

Flag options

/RS7/S1/AlarmArray

WORD[130]

260

DB20.DBB0

Raw

/RS7/S1/AlarmArray[0]

WORD

2

DB20.DBW0

Raw

/RS7/S1/AlarmArray[1]

WORD

2

DB20.DBW2

Raw

/RS7/S1/AlarmArray[2]

WORD

2

DB20.DBW4

Raw

/RS7/S1/AlarmArray[3]

WORD

2

DB20.DBW6

Raw

/RS7/S1/AlarmArray[4]

WORD

2

DB20.DBW8


 

 

Icon-Hinweis

Simulation of Alarms

See: Alarm Simulation

 

See also

AlarmList action
Alarm action
Alarm-specific system variables