Plc programming – Lenze ETC Motion Control User Manual
Page 379
PLC programming
Library
V24 functions
8.8
8.8.2
l
379
EDSTCXN EN 2.0
8.8.2.4
READBLOCKV24
FUNCTION ReadBlockV24: DINT
VAR_INPUT
pRequest
: DINT;
(* Address of the V24 request structure *)
pBuffer
: DINT;
(* Address of a data buffer *)
BufSize
: INT;
(* Buffer size in byte *)
END_VAR
The function reads max. BufSize characters in the stated data buffer pBuffer
from the V24 reception buffer.
The function returns the number of characters read from the reception
buffer.
8.8.2.5
READV24
FUNCTION ReadV24: DINT
VAR_INPUT
req_pr
: DINT;
(* Address of the V24 request structure *)
END_VAR
Reading a character from the reception buffer. The reception buffers is
implemented as FIFO and is read and written to simultaneously.
This function always provides an immediate return. Return values smaller
than 0 indicate an error (
¶ 391). If the FIFO is empty, −1 (EOF) will be
returned.
requestV24_p
: DINT;
zeichen_di
: DINT;
zeichen_di
: = READV24(requestV24_p);
8.8.2.6
WRITEBLOCKV24
FUNCTION WriteBlockV24: DINT
VAR_INPUT
pRequest
: DINT;
(* Address of the V24 request structure *)
pBuffer
: DINT;
(* Address of a data buffer *)
BufSize
: INT;
(* number of the characters to be written *)
END_VAR
The function tries to insert BufSize characters of the stated address pBuffer
into the V24 send buffer. If there is sufficient space in the send buffer all
BufSize characters will be entered.
The function returns the number of the characters written into the send
buffer.
Declaration
Description
Declaration
Description
Example
Declaration
Description