Lenzefpidrv.lib function library, General information about the rs−232c interface – Lenze Global Drive PLC Developer Studio User Manual

Page 11

Advertising
background image

LenzeFpiDrv.lib function library

General information about the RS−232C interface

2−4

l

LenzeFpiDrv.lib EN 1.1

Example: Bit sequence/voltage level for a character to be transmitted

Character:

A" (ASCII)

01000001 (bin)
65 (dez)
41 (hex)

LSB

1

Start

0

Bit1

0

Bit2

0

Bit3

0

Bit4

0

Bit5

0

MSB

1

Parity

0

Stop

1

Stop

2

+3...+15V

−3...−15V
(Neutral level)

Parity*:

Even

Stop bits:

2

Data bits:

7

When using 7 data bits, a parity bit will always be created so that the setting No parity" (byParity = 0) is not admissible!

Character:

A" (ASCII)

01000001 (bin)
65 (dez)
41 (hex)

LSB

1

Start

0

Bit1

0

Bit2

0

Bit3

0

Bit4

0

Bit5

0

Bit6

1

MSB

0

Parity

0

Stop

1

Stop

2

+3...+15V

−3...−15V
(Neutral level)

Parity:

Even

Stop bits:

2

Data bits:

8

For a successful communication between sender and receiver, the transmission parameters (baud
rate, data bits, parity bit, stop bits) must be set identically for both.

·

The transmission parameters of the FP interface are configured using the function
L_Rs232Open.

(

^ 3−1)

Parity bit

The parity bit serves as control bit for data transmission, similar to a check sum. We distinguish
between even and odd parities, a parity bit can be deactivated (parity None"):

·

Even parity:
The sender transfers 0" as parity bit, if an even number of data bits with valency 1" has been
transferred.

·

Odd parity:
The sender transfers 0" as parity bit, if an uneven number of data bits with valency 1" has
been transferred.

·

None
No transfer of parity bits.

The parity bit can be used for a "Parity check":
During data transfer the sender determines the parity of the data bits. The parity bit "informs" the
receiver. The receiver calculates the parity of the data bits received and compares the parity with the
parity bit received. It is thus possible to detect transmission error in a bit (1−bit error). It is however
not possible to detect 2−bit errors (two wrong data bits have been transferred), since the parity does
not change.

Advertising