![Moeller S40-AM-TD Manual Download Page 24](http://html1.mh-extra.com/html/moeller/s40-am-td/s40-am-td_manual_1819281024.webp)
Working with data arrays
21
02/02 AWB27-1300-GB
Working with data arrays
The next section describes how to read or write data arrays
using the example of the send and receive data arrays of a
central station.
Ensure that all the array indices (subscripts) are within the
limits when accessing data arrays. If the array index
(subscript) limits are exceeded, the controller will “Halt“ and
the “Not-Ready“-LED will light up.
The data arrays were defined as follows in the variables
declaration for the parameter function block:
Writing data array elements (in the user program)
To save the constant “5” in the array element [station “2”,
subaddress “0”, offset address “3”] of the send data array,
proceed as follows:
VAR_INPUT
tra_dat: ARRAY[1..2, 0..0, 0..29] OF BYTE ; (*Send data array (station number,
subaddresses, offset addresses)*)
END_VAR
VAR_OUTPUT
rec_dat: ARRAY[1..2, 0..0, 0..4] OF BYTE ;
(*Receive data array (station number,
subaddresses, offset addresses)*)
END_VAR
LD 5
ST Instance_name.tra_dat [2,0,3]
.
.
END_PROGRAM
Summary of Contents for S40-AM-TD
Page 7: ...4 02 02 AWB27 1300 GB ...
Page 11: ...8 02 02 AWB27 1300 GB ...
Page 27: ...24 02 02 AWB27 1300 GB ...
Page 77: ...74 02 02 AWB27 1300 GB ...