Fieldread And Fieldwrite Instructions - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

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
For LAD and FBD: Click the "???" and select a data type from the drop-down menu.
1
Table 7- 67
Data types for parameters
Parameter and type
Index
Input
Member
Input
1
Value
Out
1
The data type of the array element specified by the MEMBER parameter and the VALUE parameter must have the
1
same data type.
S7-1200 Programmable controller
System Manual, 11/2011, A5E02486680-05
SCL
Description
FieldRead reads the array element with the index value INDEX from the
value :=
array whose first element in specified by the MEMBER parameter. The
member[index];
value of the array element is transferred to the location specified at the
VALUE parameter.
WriteField transfers the value at the location specified by the VALUE
member[index]
parameter to the array whose first element is specified by the MEMBER
:= value;
parameter. The value is transferred to the array element whose array
index is specified by the INDEX parameter.
Data type
DInt
Array element types:
Bool, Byte, Word, DWord, Char, SInt, Int,
Dint, USInt, UInt, UDInt, Real, LReal
Bool, Byte, Word, DWord, Char, SInt, Int,
Dint, USInt, UInt, UDInt, Real, LReal
100BBasic instructions
Description
The index number of the array element to be
read or written to
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.
Location to which the specified array element
is copied (FieldRead)
Location of the value that is copied to the
specified array element (FieldWrite)
7.6 Move
197

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-1200

Table of Contents