-

RDREC

Type Function block
Description The function block is used to read a data record from a Profinet IO device. The block is executed by REQ = TRUE. The Profinet address ID of the device/slot/subslot from which the data record is read is specified with the ID input. The INDEX input identifies the data record to be read. The maximum number of bytes which shall be read is specified with the MLEN input.

If the data record is read successfully, the VALID output indicates that the read data record is stored in the RECORD parameter.

If an error occurs during execution of the function block, ERROR is set to TRUE and VALID is set to FALSE. The STATUS output indicates the error code.
Notes
  • Before calling the function block, an Application Relation (AR) with the communication partner should be completely established.
  • All parameters have to be set.
  • A maximum of 32 instances of the function block is allowed in the PLCnext Engineer project.
  • Function blocks have to be instantiated. The instance name of the function block has to be declared in the 'Variables' table of the POU where the FB is going to be used. The instance name must be unique within the POU.
Parameters Inputs

REQ

ID

INDEX

MLEN

Input/Output

RECORD

Outputs

VALID

BUSY

ERROR

STATUS

LEN
Error codes Error codes at the STATUS output