Basic instructions
8.6 Move operations
S7-1200 Programmable controller
288 System Manual, V4.2, 09/2016, A5E02486680-AK
Legacy instructions
8.6.10.1
FieldRead (Read field) and FieldWrite (Write field) instructions
Note
STEP 7 V10.5 did not support
a variable reference as an array index or multi-dimensional
arrays. The FieldRead and FieldWrite instructions were used to provide variable array index
operations for a one
-dimensional array. STEP 7 V11 and greater
a variable as an
array index and multi
-dimensional arrays. FieldRead and FieldWrite are included in STEP 7
V11 and greater for backward compatibility with programs that have used these instructions.
Table 8- 100 FieldRead and FieldWrite instructions
ber[index];
FieldRead reads the array element with the index
value INDEX from the array whose first element in
specified by the MEMBER parameter. The value of
the array element is transferred to the location speci-
fied at the VALUE parameter.
ue;
WriteField transfers the value at the location specified
by the VALUE parameter to the array whose first
element is specified by the MEMBER parameter. The
value is transferred to the array element whose array
index is specified by the INDEX parameter.
1
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
Table 8- 101 Data types for parameters
Index Input DInt The index numb
er of the array element to be read or
written to
Member
1
Input Binary numbers, integers, float-
ing-point numbers, timers,
DATE, TOD, CHAR and
WCHAR as components of an
ARRAY tag
Location of the first element in a one- dimension
array defined in a global data block or block inter-
face.
For example: If the array index is specified as [-2..4],
then the index of the first element is -2 and not 0.
Value
1
Out Binary numbers, integers, float-
ing-point numbers, timers,
DATE, TOD, CHAR, WCHAR
Location to which the specified array element is
copied (FieldRead)
Location of the value that is copied to the specified
array element (FieldWrite)
The data type of the array element specified by the MEMBER parameter and the VALUE parameter must have the