
CAN Networking on Roboteq Controllers
12
CANBus Networking Manual
V2.0 July 8, 2019
Common Configurations
CAN Mode:
Used to select one of the 4 operating modes. Off disables all CAN receive
and transmit capabilities.
Node ID:
CAN Node ID used for transmission from the controller. Value may be be-
tween 1 and 126 included.
Bit Rate:
Selectable bit rate. Available speeds are 1000, 800, 500, 250, and 125 kbit/s.
Default is 125kbit and is the recommended speed for RawCAN and Mini-
CAN modes.
Heartbeat:
Period at which a Heartbeat frame is sent by the controller. The frame is
CANopen compatible 0x700 + NodeID, with one data byte of value 0x05
(Status: Operational). The Heartbeat is sent in any of the selected modes. It
can be disabled by entering a value of 0.
MiniCAN Configurations
ListenNodeID:
Filters to accept only packets sent by a specific node.
SendRate:
Period at which data frames are sent by the controller. Frames are struc-
tured as standard CANopen Transmit Process Data Objects (TPDOs). Trans-
mission can be disabled by entering a value of 0.
RawCAN Configurations
In the RawCAN mode, incoming frames may be filtered or not by changing the Listen-
NodeID parameter that is shared with the MiniCAN mode. A value of 0 will capture all
incoming frames and it will be up to the user to use the ones wanted. Any other value will
cause the controller to capture only frames from that sender.
Using RawCAN Mode
In the RawCAN Mode, received unprocessed data packets can be read by the user. Like-
wise, the user can build a packet with any content and send it on the CAN network. A
FIFO buffer will capture up to 16 frames.
CAN packets are essentially composed by a header and a data payload. The header is an
11 bit number that identifies the sender’s address (bits 0 to 6) and a packet type (bits 7 to
10). Data payload can be 0 to 8 bytes long.
Checking Received Frames
Received frames are first loaded in the 16-frame FIFO buffer. Before a frame can be read,
it is necessary to check if any frames are present in the buffer using the
?CF
query. The
query can be sent from the serial/USB port, or from a MicroBasic script using the getval-
ue(_CF)
function. The query will return the number of frames that are currently pending,
and copy the oldest frame into the read buffer, from which it can then be accessed. Send-
ing
?CF
again, copies the next frame into the read buffer.
The query usage is as follows:
Syntax:
?CF
Reply:
CF
=number of frames pending