Table of Contents

Example: CANopen

This example requests the same temperature value as Example: CAN raw from the NXP microcontroller on the ZSOM-Control, but uses the CANopen VIs (ZCAN) of the SDK. For the hardware, see CAN.

Project: ZSOM-Control_CAN.lvproj, VI CANopen_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.

RT code: front panel
RT code: front panel

Front panel

Control / Indicator Function
NXP Registry: node ID CANopen node ID of the microcontroller (64)
NXP Registry: Object Index, Sub Index Object that is read (2000 / 0)
Temperature (Celsius) Temperature reported by the microcontroller

How it works

RT code: block diagram
RT code: block diagram

FPGA code: block diagram
FPGA code: block diagram

ZCAN library

The ZCAN VIs are part of the example project (folder RT/ZCAN). They are grouped as follows:

Group Content
zcan.init.vi Initialization of the library
HAL Hardware abstraction (zcan.hal.vi)
NMT Network management: read and set the node state, list the nodes
SDO Service data objects: read U32 and 4×U8, write U16, U32 and U8 arrays
PDO Process data objects: zcan.pdo.listener.vi
NXP Firmware update of the microcontroller: load binary file, load RAM, erase, flash, compare