04-21-2020 05:10 AM
Dear Labview Users,
I'm trying to interface with a CAN customer device, with a provided .dbc file, using the USB-8502 device.
I would like to better understand the difference between the NI-XNET and the NI-CAN channel API mentioned here https://www.ni.com/it-it/support/documentation/supplemental/06/the-ni-can-channel-api.html. Furthermore, I would like to understand how to get the .vi mentioned for the ni-can-channel-api (as the CAN Init Start .vi), since I was not able to found them.
In the specific, I would like to understand how to send a single signal (described in the .dbc file) and wait for a response.
Thank you very much for all your support
Solved! Go to Solution.
04-21-2020 07:55 AM
As with all NI toolkits, the best place to look is the examples. Once a toolkit is installed it usually comes with a variety of examples showing code doing common tasks. These aren't setup for a full application, but usually highlight one feature of the toolkit and then expects the developer to integrate that with their full application.
So for NI-CAN and NI-XNet the examples can be found by running LabVIEW, then going to the Help >> Find Examples menu. From here you can search for things, or find all examples from that toolkit.
As for the differences. NI-CAN is legacy, and really has barely been updated in the last 10 years. Taking it's place is XNet. And while the XNet drivers can do all things the NI-CAN can and lots more, they do take a different approach and some people have a hard time understanding the best way to use them. I highly recommend you don't consider using NI-CAN for projects where NI-XNet API can be used. You might be able to get it to work, but there will be more help, examples, and support if you just take the plunge with XNet.
Signal and frame conversion can be done a few ways. Ignoring NI-CAN for a second my first suggestion is to just use the XNet API. It allows for you to import a database, and read and write values as doubles in engineering units. If you want you can also convert raw frames to signals and back using the XNet API, or I've also re-written this conversion in raw G for efficiency, and non-XNet hardware.
I have a CAN blog, that you might find interesting. Most useful will probably be Part 3, Part 5, and Part 6.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-21-2020 08:17 AM
Dear Hoovahh,
really thank you for your answer. I will really read your blog, it seems very clear and detailed