ABB AC500-S Safety User Manual page 213

Safety programmable logic controllers system
Hide thumbs Also See for AC500-S:
Table of Contents

Advertisement

4.4.3.4
Variable declarations
Of the variable types and attributes defined in IEC 61131-3 the following are suitable for creating safety-ori-
ented applications:
Keyword
VAR
VAR_INPUT
VAR_OUTPUT
VAR_IN_OUT
VAR_GLOBAL
VAR_EXTERNAL
AT
CONSTANT
RETAIN
PERSISTENT
In the interest of better readability the following rules should be followed for the declaration of variables:
Only one block of declaration type (e.g., VAR, VAR_INPUT, VAR_OUTPUT, VAR_IN_OUT,
n
VAR_GLOBAL and combindations with CONSTANT) per component
n
Only one variable declaration per line with informative comment
Bad:
VAR
A, B, C: BOOL; (* several variables *)
END_VAR
Good:
VAR
A: BOOL; (* first variable *)
B: BOOL; (* second variable *)
C: BOOL; (* third variable *)
END_VAR
n
Local variables (VAR) should always have a different name. Obscuring of global variables through local
variables must be avoided.
30.03.2017
CoDeSys Safety programming guidelines > Language-specific programming guidelines
Description
Local block variable
Block input parameter
Block output parameter
Block reference parameter
Global variable
Declaration of global variables used in
the block
Variable address allocation
Declaration as constant (no write
access possible)
Variable value is preserved after switch-
off
Variable value is preserved after
reloading
AC500-S
Configuration and programming
Suitable (Yes / To a limited extent /
No) (comment)
Yes
Yes
Yes
To a limited extent (To illustrate the
side effect the parameter should be
identified with a prefix. Even better
would be to use an input and output
parameter instead.)
Yes (We strongly recommend identi-
fying global variables with a prefix
such as "G_" or "GS_" (for safety-ori-
ented variables).)
Yes/optional (not required in CoD-
eSys)
Yes (see next chapter)
Yes (We recommend to declare each
constant explicitly.)
No, not supported
No, not supported
213

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents