– 42 –
61131-3
IEC:2003(E)
Table 17 - Variable type assignment features
No.
Feature/examples
4
a
Array location assignment
VAR
INARY AT %IW6 :
ARRAY [0..9] OF INT;
END_VAR
Declares an array of 10 integers to be allocated to contiguous
input locations starting at %IW6 (note 2)
5
Automatic memory allocation of symbolic variables
VAR
CONDITION_RED : BOOL;
IBOUNCE : WORD ;
MYDUB : DWORD ;
AWORD, BWORD, CWORD : INT;
MYSTR: STRING[10] ;
END_VAR
Allocates a memory bit to the Boolean variable
CONDITION_RED.
Allocates a memory word to the 16-bit string variable
IBOUNCE.
Allocates a double memory word to the 32-bit-string
variable MYDUB.
Allocates 3 separate
memory words for the integer
variables AWORD, BWORD, and CWORD.
Allocates memory to contain a string with a
maximum length of 10 characters. After initializa-
tion, the string has length 0
and contains the empty
string ''.
Do'stlaringiz bilan baham: