ABB AC500-S Safety User Manual page 175

Hide thumbs Also See for AC500-S:
Table of Contents

Advertisement

Keyword
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,
VAR_GLOBAL and combinations with CONSTANT) per component
Only one variable declaration per line with informative comment
Bad:
VAR
END_VAR
Good:
VAR
END_VAR
Local variables (VAR) should always have a different name. Obscuring of global variables
through local variables must be avoided.
4.4.3.5
Direct addresses
The following rules must be followed when using addresses for creating safety applications:
No application of addresses directly in the program code. Each used address must be
assigned to a variable with "AT" in the declaration. In addition, we recommend identifying
input/output variables through a prefix and defining them together in a single variable list.
The application of marker addresses (%M) should be limited to a minimum due to the error-
proneness of the allocation and the lack of purpose (memory for variables is allocated auto-
matically).
Multiple address allocation should be avoided due to obscure side effects. For word- and
bit-wise access a variable is defined for the word and accessed via bit access <vari-
able>.<bit number>.
No address declarations within programs, function blocks, functions and data structures.
4.4.3.6
Data types
Of the data types defined in CODESYS the following are approved for creating safety applica-
tions:
Table 11: Simple data type
Keyword
BOOL
BYTE, SINT, USINT
WORD, INT, UINT
DWORD, DINT, UDINT
TIME, TOD, DATE, DT
2020/06/19
CODESYS Safety programming guidelines > Language-specific programming guidelines
Description
Variable value is preserved after switch-off No, not supported
Variable value is preserved after reloading No, not supported
A, B, C: BOOL; (* several variables *)
A: BOOL; (* first variable *)
B: BOOL; (* second variable *)
C: BOOL; (* third variable *)
Suitable (yes / to a limited extent / no) (comment)
Yes
Yes
Yes
Yes
Yes
3ADR025091M0208, 12, en_US
Configuration and programming
Suitable (yes / to a limited extent /
no) (comment)
175

Advertisement

Table of Contents
loading

Table of Contents