System bus (can) for lenze plc devices, Lenzecandrv.lib function library – Lenze DDS System bus CAN for PLC User Manual

Page 146

Advertising
background image

10.3

L_CanInit − initialising the CAN driver

System bus (CAN) for Lenze PLC devices

LenzeCanDrv.lib function library

10−4

L

PLC−Systembus EN 2.0

Response with regard to errors (Tx/Rx buffer)

The response in the case of errors in the Tx/Rx buffer can be configured via the codes C0608/C0609:

Code

LCD

Possible settings

Information

Lenze

Selection

C0608 over Tx−Queue

0

0

TRIP

1

Message

2

Warning

3

Off

4

FAIL QSP (not for Drive PLC!)

Configuration of the monitoring for
Tx buffer

C0609 over Rx−lsr

0

0

TRIP

4

Fail−QSP

Configuration of the monitoring for
Rx buffer

·

Not for Drive PLC!

Example

Calling the function in ST with decoding of the return value:

(* open CAN driver − returns g_dwReturnValue *)

g_dwReturnValue:=

L_CanInit(10, 0);

g_bInitOK :=

NOT DWORD_TO_BOOL(g_dwReturnValue AND 16#0000_0001);

g_bDriverFail :=

DWORD_TO_BOOL(SHR(g_dwReturnValue,1) AND 16#0000_0001);

g_wVersion :=

DWORD_TO_WORD(SHR(g_dwReturnValue,16) AND 16#FFFF);

Advertising