Lenzefpidrv.lib function library – Lenze Global Drive PLC Developer Studio User Manual

Page 24

Advertising
background image

LenzeFpiDrv.lib function library

Functions

3.5

Receive data (L_Rs232ReceiveData)

3−9

L

LenzeFpiDrv.lib EN 1.1

TimeOut

The activation of this function starts a time out timer. The timer will be reset with every byte received.
If the time wTimeOut has expired without receiving data, a TimeOut error will be set and the unit is
no longer ready for receiving data.

NumberOfReceiveBytes

If wNumberOfReceiveBytes bytes have been received, the receiving process will be stopped.

Ending character (byEndChar1/byEndChar2)

With asynchronous data transmission, the data flow is checked by defining a start and an end
character between the sender and receiver. The end character indicates the end of a data package
sent and must be recognised accordingly by the receiver. Sometimes the end character consists of
a character pair.

Use byEndChar1 and byEndChar2 to define these end characters. The receiving process is over
when the defined end character is recognised by the receiver. The end characters are stored in the
receive memory.

Example

Calling the function in ST:

g_nReceiveStatus:=

L_Rs232ReceiveData(30,

ADR(g_abyReceiveData),

g_wLength,
g_wReceiveBufferSize,
g_wTimeOut,
g_byEndChar1,
g_byEndChar2,
g_wControl);

Note!

Addresses within the memory range of the operating system are not permitted with the functions
L_Rs232SendData and L_Rs232ReceiveData !

·

See also the note for L_Rs232SendData.

(

^ 3−4)

Advertising