Generic Mode Network and Device Communication
32 (62)
11.2.2
Initializing the CAN Controller
C CAN_INIT
Initializes the CAN controller with the specified baud rate. Exclusively CiA standard baud rates
are supported (10, 20, 50, 100, 125, 250, 500, 800, 1000 kBaud). For custom baud rates see
.
C CAN_INIT <baud-rate><buscop>
Parameter
Parameter
Description
baud-rate
Baud rate in kBaud. CAN controller is initialized with the specified baud rate. Possible
values: 10–1000 decimal (exclusively CiA standard)
buscop
Mode of bus coupling, exclusively HIGH is supported, possible entry: HIGH
Example
C CAN_INIT 500 HIGH
Possible Return Values
Return Value
Description
I OK: CAN_INIT
Function succeeded
E 22 Baudrate not supported
Baud rate is not supported. Use CiA supported baud rate.
E 31 Error while initializing CAN
Internal error while initializing the CAN controller. CAN
controller not initialized. Try to initialize again.
E 4 Unsupported parameter
Bus coupling LOW is not supported. Use bus coupling
HIGH.
C CAN_INIT_AUTO
Initializes the CAN controller with automatic baud rate detection. CAN controller is set into TX
passive mode and all CiA baud rates are tested until a valid CAN message is received. The
CAN controller is initialized with the detected baud rate and a response with the same baud rate
is transmitted.
C CAN_INIT_AUTO <timeout><buscop>
Parameter
Parameter
Description
timeout
Time in seconds to test for the CiA baud rate, possible values: 1–1000 decimal
(optional, default: 1)
buscop
Mode of bus coupling, exclusively HIGH is supported, possible entry: HIGH
Example
C CAN_INIT_AUTO 10 HIGH
Possible Return Values
Return Value
Description
I 100
I OK: CAN_INIT_AUTO
Recognized baud rate 100 kBaud
E 23 Baudrate not detected
No valid baud rate detected within the specified timeout.
Maximum response time is 10 times of timeout value.
E 4 Unsupported parameter
Bus coupling LOW is not supported. Use bus coupling
HIGH.
CANblue II User Manual
4.01.0126.20000 EN 3.2