100BBasic instructions
7.6 Move
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
197
7.6.2
FieldRead and FieldWrite 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 does support a variable as an array
index and multi-dimensional arrays. FieldRead and FieldWrite are included in STEP 7 V11
for backward compatibility with programs that have used these instructions.
Table 7- 66 FieldRead and FieldWrite instructions
LAD / FBD
SCL
Description
value :=
member[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 specified at the
VALUE parameter.
member[index]
:= value;
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 7- 67 Data types for parameters
Parameter and type
Data type
Description
Index
Input
DInt
The index number of the array element to be
read or written to
Member
1
Input
Array element types:
Bool, Byte, Word, DWord, Char, SInt, Int,
Dint, USInt, UInt, UDInt, Real, LReal
Location of the first element in a one-
dimension array defined in a global data block
or block interface.
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
Bool, Byte, Word, DWord, Char, SInt, Int,
Dint, USInt, UInt, UDInt, Real, LReal
Location to which the specified array element
is copied (FieldRead)
Location of the value that is copied to the
specified array element (FieldWrite)
1
The data type of the array element specified by the MEMBER parameter and the VALUE parameter must have the
same data type.