How Can I Address Multiple Nodes with NI-Industrial Communications for CANopen?

Updated Dec 22, 2023

Reported In

Hardware

  • PCI-8531
  • PXI-8531
  • NI-9881

Software

  • CANopen Library Toolkit

Issue Details

I am using NI-Industrial Communications for CANopen to communicate with nodes on a CANopen bus using e.g. PCI-8531, PXI-8531 or NI 9881 C Series module. How can I communicate with multiple nodes on the bus simultaneously?
 

Solution

NI-Industrial Communications for CANopen VI’s such as NMT Write.vi, TPDO Create.vi, RPDO Create.vi, or SDO Create.vi have a Node ID input terminal. You can use NMT Write.vi to send a message to every node on the bus by using the Node ID 0. If you want to communicate with multiple nodes on the bus, you will need to open connections to each of them and send the message. In the example below, all nodes on the bus are set into a pre-operational state at once with the CANopen NMT write VI. After that, SDO data is read from node 4 and 3.



Note:
  • This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
  • The Node ID is only supported by the NMT Write.vi