ABB AC500-S Safety User Manual page 219

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

Advertisement

Flags := 0;
Enable := TRUE;
Good:
VAR CONSTANT
EnableBit: INT := 0;
END_VAR
VAR
Flags AT %QW12: WORD;
END_VAR
Flags := 0;
Flags.EnableBit := TRUE;
4.4.3.9.6
Conversions
No implicit type conversions should be used for assignation and mixed types, i.e., only explicit conversions
should be used.
Bad:
VAR
A: BYTE;
B: INT;
C: DWORD;
END_VAR
C := A + B;
Good:
VAR
A: BYTE;
B: INT;
C: DWORD;
END_VAR
C := INT_TO_DWORD(B + BYTE_TO_INT(A));
An even better solution in such cases is to reflect on type allocation.
30.03.2017
CoDeSys Safety programming guidelines > Language-specific programming guidelines
AC500-S
Configuration and programming
219

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents