5 receive data (l_rs232receivedata), Receive data (l_rs232receivedata), Lenzefpidrv.lib function library – Lenze Global Drive PLC Developer Studio User Manual
Page 22: Functions

LenzeFpiDrv.lib function library
Functions
3.5
Receive data (L_Rs232ReceiveData)
3−7
L
LenzeFpiDrv.lib EN 1.1
3.5
Receive data (L_Rs232ReceiveData)
INT.
L_Rs232ReceiveData (wDrvNr, pabyReceiveDataMemory, wBuffersize,
wTimeOut ,wNumberOfBytes,
byEndChar1, byEndChar2, wControl)
With this function data can be received via the FP interface.
·
The operating system of the controller receives data and executes the PLC program at the
same time.
·
A max. of 32767 characters can be received per function call.
·
A new call is only possible after the previous call has been processed, i.e. after all data has
been received or the end of reception has been detected.
·
An active receiving process can be cancelled by repeating the function L_Rs232Open . It is
then possible to receive data which has been changed, if necessary.
L_Rs232ReceiveData
wDrvNr
pabyReceiveDataMemory
wNumberOfReceiveBytes
wBufferSize
wTimeOut
byEndChar1
byEndChar2
wControl
Fig. 3−5
Receive data (L_Rs232ReceiveData)
Transfer parameters
Identifier
Data type
Possible settings
Info
wDrvNr
Word
30
AIF interface
pabyReceive
DataMemory
Pointer to Array
of Byte
Pointer set onto the address in
the memory where the storage
of the received data bytes is to
start.
The address of a variable (e. g. data array) can be detected using
the address function ADR .
wBuffersize
Word
2 ... 32767
Size of the receive memory in bytes
·
The memory has a minimum size of two bytes.
wNumberOf
ReceiveBytes
Word
1 ... 32767
Number of data bytes to be received
·
This parameter can be used for checking the end of data
reception (see wControl).
wTimeOut
Word
2 ... 60000
Time out time (in ms) for receiving data
·
This parameter can be used for checking the end of data
reception (see wControl).
byEndChar1
Byte
0 ... 255
Character which defines the end of the data byte to be received.
·
This parameter can be used for checking the end of data
reception (see wControl).
byEndChar2
Byte
0 ... 255
Character which defines the end of the data byte to be received.
·
This parameter can be used for checking the end of data
reception (see wControl).