Example: CAN raw
This example requests a temperature value from the NXP microcontroller on the ZSOM-Control using raw CAN frames. Because the microcontroller operates according to the CANopen standard, the commands are formatted accordingly. For the hardware, see CAN.
Project: ZSOM-Control_CAN.lvproj, VI CANraw_example.vi. In LabVIEW, open Help → Find Examples and search for “ZSOM”.
Prerequisite: The firmware of the microcontroller must be flashed once, see Example: CAN NXP firmware update. The same example with the CANopen VIs of the SDK is described in Example: CANopen.
Front panel
| Indicator | Function |
|---|---|
| Temperature (Celsius) | Temperature reported by the microcontroller |
| error out | Error cluster |
How it works
- RT: The VI loads and starts the FPGA and then runs through the states reset, init, send and receive. The state receive is executed twice, because the first message the microcontroller sends is the “I am alive” message.
- The answers (SDO messages) of the microcontroller have the CAN identifier 1472 (0x5C0). Only bytes 4 to 7 of the response contain the value. This is necessary because of the CANopen structure used by the microcontroller. The value is transmitted multiplied by 10 and is divided by 10 in the VI.

