Examples For Read-Requesting CAN Frame Values

Updated May 3, 2018

Reported In

Software

  • LabVIEW

Driver

  • NI-XNET

Issue Details

I need to validate a system sending CAN messages to my NI-XNET device. I need to read request CAN frames to ensure the information from the device is correct. What is the best NI-XNET example to start with?

Solution

If you have your frame defined in the NI-XNET Database Editor, you can use the CAN Frame Output Single Point.vi to send the frame out to the other node(s) and then the CAN Frame Input Single Point.vi to read the response back from the node that replies with data. 

If you do not wish to define your frame in the NI-XNET Database Editor, you can use the CAN Raw Frame Output Stream.vi to send the frame out to the other node(s) and then the CAN Raw Frame Input Stream.vi to read the response back from the node that replies with data. 

These examples can all be found in the Frame Sessions folder of the example finder by opening LabVIEW and clicking the following: Help >> Find Examples >> Hardware Input and Output >> CAN >> NI-XNET >> Intro to Sessions >> Frame Sessions folder

Additional Information

There are two different ways to initiate a request to another node on your CAN bus. 
  • You can use remote frames which is where one node sends an empty CAN frame with a specific Arbitration ID to another node on the CAN bus. When the other node sees this CAN frame on the bus it replies back with actual payload data inside of a frame with same Arbitration ID.
  • The other option is to send a diagnostic frame that the other node knows how to handle if received. A diagnostic frame is no different than a normal frame but the node will know how to interpret the frame and will send back relevant data based on the message that was sent to it. Usually diagnostic frames and the frames returned by the other node will not have the same Arbitration ID.  

WAS THIS ARTICLE HELPFUL?

Not Helpful