Skip to content

Hex can

This documentation provides basic defines for CAN bus standard used by hexfellow.

Physical Definition

XT30 2+2

PCB's view

image.png

Cable's view

image.png

CANOpen

CANOpen is a widely used protocol for CAN bus in industrial automation. There are countless tutorials on the internet. Here is a nice one: CANOpen Tutorial.

We understand that most of the time, people aren't concerned with the specific details. You're likely here to change certain product parameters (such as acceleration, baud rate, etc.). Therefore, we recommend an easy-to-use tool for operating the Object Dictionary.

CANOpenLinux

CANOpenLinux is a tool to read and write the Object Dictionary of the device. It is a command line tool that can be used to read and write the Object Dictionary of the device.

CANOpenLinux

  1. Go and clone the repo:
git clone https://github.com/CANopenNode/CANopenLinux.git
  1. Build the project, according to the README.md in the repo.

  2. Run the tool:

./canopend can0 -i 1 -c "stdio"

Change can0 to your can bus name. We will not explain the parameters here, run ./canopend -h to see the help message.

  1. Read the Object Dictionary:

Let's read the Object Dictionary Index 0x1018(Identity) sub-index 0x01(Vendor ID) of the device number 0x10 as example:

0x10 r 0x1018 0x01

As you can see, if nothing goes wrong, the output will be arranged as bytes. To read them as specific data type, add the type also.

0x10 r 0x1018 0x01 u32

od_r

  1. Write the Object Dictionary:

Warning

Changing parameters of the device might brick the device. Please be careful, make sure you know what you are doing.

Let's write some Object Dictionary as example. As XSTD Standard Object Dictionary shows, the baudrate of a device is controlled by Index 0x2100, sub-index 01. Data type is UNSIGNED32, and only 100_000 | 125_000 | 250_000 | 500_000 | 1_000_000 is allowed to write.

So let's try to change the baudrate to 1_000_000(1Mbps):

Warning

After rebooting the device, the baudrate will be changed to what you set, in that case you might have to reconfigure your canbus to the new baudrate. If you don't want to change the baudrate, do not run command below.

0x10 w 0x2100 0x01 u32 1000000

od_w

XSTD Standard Object Dictionary

xstd.eds

readme