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

Page 23

Advertising
background image

LenzeFpiDrv.lib function library

Functions

3.5

Receive data (L_Rs232ReceiveData)

3−8

L

LenzeFpiDrv.lib EN 1.1

Identifier

Info

Possible settings

Data type

wControl

Word

End of receiving data after:

Checking the end of data reception

Bit 0:

wTimeOut

Bit 1:

wNumberOfBytes

Bit 2:

byEndChar1

Bit 3:

byEndChar2

0: not active
1: active
0: not active
1: active
0: not active
1: active
0: not active
1: active

Bits 4−15 are reserved for future extensions

Return value

Data type

Value

Meaning

Priority

Integer

−6

wControl is invalid since reserved bits have been overwritten.

6

−5

Time out time exceeds its limits (2 ... 60000 ms).

5

−4

Number of bytes to be received > receive memory (1 ... 32767) or
Number of bytes to be received = 0.

4

−3

Receive memory size exceeds its limits (2 ... 32767).

3

−2

Pointer of receive memory does not point to PLC−RAM.

2

−1

Wrong driver number (wDrvNr) or driver not initialised.

1

Note: If errors are caused by several problems, the error cause with the highest priority sends back the

corresponding feedback value.

0

Receive order successfully transferred to operating system.

Receive/send check

The way of how to detect the end of receiving data and whether the unit is read for receiving data can
be configured with beendet wird, kann mit Hilfe von wControl :

Data reception is stopped when

wControl

Priority

the memory is full. (This check test is always active.)

1

a certain waiting time is over wTimeOut no bytes have been received

0000 0000 0000 0001

2

the number of wNumberOfReceiveBytes bytes have been received

0000 0000 0000 001x

3

the character byEndChar1 has been received

0000 0000 0000 010x

4

the character byEndChar2 has been received

0000 0000 0000 100x

5

the character byEndChar1 and byEndChar2 have been received subsequently

0000 0000 0000 110x

6

(x: any status)

Example:

wControl = 0x0009

hex

= 0000 0000 0000 100 1

bin

End of receiving data wTimeOut is active

End of receiving data byEndChar2 is active

Caution!

Please ensure that the size of the created memory (e. g. an array) does not fall below value indicated
in wBuffersize since otherwise the check test of the memory limits will not work.
This can result in an impermissible overwriting of the memory and result in errors!

Receive memory is full

If the receive memory is full and data is sent to be received, the receiving process will be stopped
immediately. By this it is avoided that the memory is overwritten with received data.

Advertising