Function elements: RAW-CAN status. IFM CR0403

Add to My manuals
231 Pages

advertisement

Function elements: RAW-CAN status. IFM CR0403 | Manualzz

BasicController CR0403

5.2.2 Function elements: RAW-CAN (Layer 2)

Content

Function elements: RAW-CAN status ....................................................................................................63

Function elements: receive RAW-CAN data ..........................................................................................69

Function elements: transmit RAW-CAN data .........................................................................................79

Function elements: RAW-CAN remote ...................................................................................................85

35756

Here we describe the RAW-CAN function blocks (CAN Layer 2) of ifm electronic to be used in the application program.

Function elements: RAW-CAN status

Content

CAN_ENABLE ........................................................................................................................................64

CAN_RECOVER ....................................................................................................................................65

CAN_SETDOWNLOADID ......................................................................................................................66

CAN_STATUS ........................................................................................................................................67

35750

63

BasicController CR0403

CAN_ENABLE

Unit type = function block (FB)

Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

35432

>

>

Description

>

With CAN_ENABLE the CAN hardware is initialised. Without this call no other calls are possible in

RAW-CAN or they return an error.

In order to change the baud rate the following procedure is required:

► Maintain the function block on ENABLE=FALSE for the duration of one cycle.

> All protocols are reset.

>

Re-initialisation of the CAN interface and the CAN protocols running on it. Any information available for cyclical transmission is lost as well and must be newly created.

> At renewed ENABLE=TRUE, the new baud rate is adopted.

35407

Parameters of the inputs

35231

Parameter

ENABLE

CHANNEL

BAUDRATE

Data type

BOOL := FALSE

BYTE

WORD := 250

Description

TRUE: enable CAN interface

FALSE: disable CAN interface

CAN interface (1...n) depending on the device

Baudrate [kbits/s] permissible = 20, 50, 100, 125, 250, 500, 1000

Parameters of the outputs

35103

Parameter

RESULT

Data type

BYTE

Description feedback of the function block

(possible messages → following table)

Possible results for RESULT:

Value dec | hex

Description

0

1

8

9

242

00

01

08

09

F2

FB is inactive

FB execution completed without error

– data is valid function block is active

CAN is not active

Error: setting is not possible

64

BasicController CR0403

CAN_RECOVER

Unit type = function block (FB)

Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

35435

>

Description

35366

CAN_RECOVER has the following tasks:

 to activate / deactivate the automatic bus off handling

 to restart the CAN interface in case of bus off

> In case of bus off: CAN Controller deletes all buffers (including the buffers of the other protocols).

>

If CAN_RECOVER is not used (ENABLE=FALSE):

> in case of a bus off a recovery attempt is automatically made after 1 s.

> after 4 failed recovery attempts in a row the affected CAN interface is deactivated.

Parameters of the inputs

35241

Parameter

ENABLE

CHANNEL

RECOVER_EXECUTE

InhibitTime

(optional use of the parameter)

Data type

BOOL := FALSE

BYTE

BOOL

TIME := T#1s

Description

TRUE: No automatic recovery after CAN bus off

FALSE: Automatic recovery after CAN bus off

CAN interface (1...n) depending on the device

TRUE (only for 1 cycle): restart of CAN interface remedy bus off condition

FALSE: function element is not executed

Waiting time between bus off and restart of the CAN interface

65

BasicController CR0403

CAN_SETDOWNLOADID

= Set download ID

Unit type = function block (FB)

Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

35077

>

Description

35373

The download ID is required for data exchange when connecting the runtime system and the

CODESYS development environment. When the device is started the download ID is set with the default value from the hardware configuration.

>

With CAN_SETDOWNLOADID this value can be set in the PLC program (e.g. using certain inputs).

The changed ID is also written into the hardware configuration.

Parameters of the inputs

35242

Parameter

EXECUTE

CHANNEL

DOWNLOAD_ID

Data type

BOOL := FALSE

BYTE

BYTE

Description

FALSE  TRUE (edge): execute function element once otherwise: function element is not active

A function element already started is processed.

CAN interface (1...n) depending on the device

1...127 = set download ID

0 = read download ID

>

Parameters of the outputs

35090

Parameter

RESULT

Data type

BYTE

Description feedback of the function block

(possible messages → following table)

Possible results for RESULT:

0

Value dec | hex

00

Description

FB is inactive

1

8

242

01

08

F2 function block execution completed without error function block is active

Error: setting is not possible

66

BasicController CR0403

CAN_STATUS

Unit type = function block (FB)

Unit is contained in the library ifm_RawCAN_NT_Vxxyyzz.LIB

Symbol in CODESYS:

35064

>

Description

>

CAN_STATUS provides information on the chosen CAN bus.

Without hardware initialisation the following flags can be reset to FALSE:

- BUSOFF

- WARNING_RX

- WARNING_TX

Parameters of the inputs

Parameter

ENABLE

CHANNEL

CLEAR

Data type

BOOL := FALSE

BYTE

BOOL := FALSE

Description

TRUE: execute this function element

FALSE: unit is not executed

> Function block inputs are not active

> Function block outputs are not specified

CAN interface (1...n) depending on the device

TRUE: Reset the following flags:

• WARNING_RX

• WARNING_TX

• BUSOFF

FALSE: function element is not executed

>

Parameters of the outputs

Parameter

BAUDRATE

DOWNLOAD_ID

BUSOFF

WARNING_RX

WARNING_TX

VERSION

BUSLOAD

RESULT

Data type

WORD

BYTE

BOOL

BOOL

BOOL

DWORD

BYTE

BYTE

35367

35228

Description current baudrate of the CANopen node in [kBaud] current download ID

Error CAN BUS OFF at the interface

Warning threshold for receiving is exceeded at the interface

Warning threshold for transmitting is exceeded at the interface

Version of the ifm CAN stack library

Current bus load in [%] feedback of the function block

(possible messages → following table)

35094

67

BasicController CR0403

Possible results for RESULT:

Value dec | hex

Description

0

1

8

9

242

00

01

08

09

F2

FB is inactive function block execution completed without error function block is active

CAN is not active

Error: setting is not possible

68

advertisement

Related manuals

Download PDF

advertisement

Table of contents