Rdrec And Wrrec (Read/Write Data Record) Instructions - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

8.3.2

RDREC and WRREC (Read/write data record) instructions

You can use the RDREC (Read data record) and WRREC (Write data record) instructions
with PROFINET, PROFIBUS, and AS-i.
Table 8- 70
RDREC and WRREC instructions
LAD / FBD
STEP 7 automatically creates the DB when you insert the instruction.
1
In the SCL examples, "RDREC_DB" and "WRREC_DB" are the names of the instance DBs.
2
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
8.3 Distributed I/O (PROFINET, PROFIBUS, or AS-i)
SCL
"RDREC_DB"(
req:=_bool_in_,
ID:=_word_in_,
index:=_dint_in_,
mlen:=_uint_in_,
valid=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_dword_out_,
len=>_uint_out_,
record:=_variant_inout_);
"WRREC_DB"(
req:=_bool_in_,
ID:=_word_in_,
index:=_dint_in_,
len:=_uint_in_,
done=>_bool_out_,
busy=>_bool_out_,
error=>_bool_out_,
status=>_dword_out_,
record:=_variant_inout_);
Extended instructions
Description
Use the RDREC instruction to read a data
record with the number INDEX from the
component addressed by the ID, such as
a central rack or a distributed component
(PROFIBUS DP or PROFINET IO).
Assign the maximum number of bytes to
read in MLEN. The selected length of the
target area RECORD should have at
least the length of MLEN bytes.
Use the WRREC instruction to transfer a
data RECORD with the record number
INDEX to a DP slave/PROFINET IO
device component addressed by ID, such
as a module in the central rack or a
distributed component (PROFIBUS DP or
PROFINET IO).
Assign the byte length of the data record
to be transmitted. The selected length of
the source area RECORD should,
therefore, have at least the length of LEN
bytes.
315

Advertisement

Table of Contents
loading

Table of Contents