Download USER`S GUIDE

Transcript
Language Reference
Warning: There are at most 16 arrays in an application. Arrays contain integer analog
values. As dynamic memory allocation is performed, this function may cause a system error if
the array size is too close to the size of the available memory.
(* FBD program creating an array of integers *)
arcreate
ID
ident
<>
IN1
ok
16 Size
IN2
array_error
Q
1
(* ST Equivalence: *)
array_error := (ARCREATE (ident, 16) <> 1));
(* IL Equivalence: *)
LD
ident
ARCREATE
16
NE
1
ST
array_error
ARREAD
arread
ID
Pos
Arguments:
ID
Pos
INT
INT
identifier of the array (must be in set [0..15])
position of the element in the array
must be in set [0 .. size-1]
value of the element read
0 if the arguments are not valid
INT
value
Q
Description:
Reads an element in an array of integers.
(* FBD program using array management blocks *)
array_error
RETURN
arread
ident
index
ID
Pos
Q
read_value
(* ST Equivalence: *)
If (array_error) Then Return; End_if;
read_value := ARREAD (ident, index);
(* array_error comes from the ARCREATE call *)
ICS Triplex ISaGRAF Inc.
B-311