FUNCTION_BLOCK WRREC
Write Data Record (WRREC)
This function block executes an acyclic write of user or system record-data.
The ID parameter identifies the slot or subslot of the Field Device the process data record is written to.
The INDEX input of the WRREC function block contains an integer which identifies the data record to be written.
The data record shall be stored in the variable given at the RECORD parameter.
The LEN input contains the length of the data record to be written in byte.
The variable given as RECORD parameter shall be at least of LEN byte.
The values of the RECORD and LEN parameters shall not be changed as long as the BUSY output is true.
If the data record is written successfully, the DONE output indicates that the read data record is written to the Field Device.
If an error occurred, the ERROR output indicates an error and the STATUS output contains the error code.
InOut:
Scope |
Name |
Type |
Comment |
Input |
REQ |
BOOL |
Request |
ID |
DWORD |
Identifier of a slot / subslot of a Field Device (see: AddressConcept) |
|
INDEX |
INT |
Index of the data record |
|
LEN |
INT |
Length of the data record |
|
RECORD |
POINTER TO BYTE |
Data record |
|
Output |
DONE |
BOOL |
Data record written |
BUSY |
BOOL |
FB is busy |
|
ERROR |
BOOL |
Error detected |
|
STATUS |
DWORD |
Last detected status |