LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Receive and capture CAN frames

I'm using LabVIEW 2019 on a Win-10 system. I have a cDAQ-9194 with a NI 9862.

my goal is to send a request to my micro for the ECUID, capture the reply and then parse out the info I need.

I can send the request and using Bus Monitor I can see the reply but I can't figure out how to read and capture the reply using LabVIEW NI-XNET NI-CAN. Can someone point me to a good tutorial or example that will help?

 

0 Kudos
Message 1 of 2
(2,154 Views)

For future reference you'll probably find more support for these types of questions over on the Automotive sub-forum.

 

Okay it sounds like this is either XCP/CCP or ISO-15765 which is used in UDS, Diagnostics, KWP2000 and a few other prototocols.  If you are going the toolkit route NI sells the ECU Measurement & Calibration Toolkit for XCP/CCP, and the Automotive Diagnostic Command Set for ISO-15765 stuff.  Both come with trials, and both do a pretty good job if you know what you are doing.

 

If you want to go the low level approach look into the installed examples under Help >> Find Examples.  There you can search for various XNet session types like Frame Out Stream (which allows for sending single frames as needed), and Frame In Stream (get all frames one at a time) or Frame In Queued (get all frames for a single ID).  XNet has several session types and can open multiple at the same time.  Using a combination of them is often needed which is why NI offers so many.  I have a blog post here describing XNet session types.  I also have a blog post on the ISO-15765 protocol here with examples for non-NI hardware.

 

Basically it sounds like what you will want is a subVI where you use the Frame Out Stream to send a single request, then in a loop read all frames and filer out by ID using Frame In Stream, or wait for a single frame using the Frame In Queued.  Of course you'll want a timeout in case there isn't a reply after something like 2 seconds then generate an error.  If you get stuck post the code you have.

0 Kudos
Message 2 of 2
(2,063 Views)