03-30-2015 07:16 AM
Hello all,
I have succesfully built an application using LIN with a 9866 module in a cDAQ chassis. Now another customer wants us to add CAN support to an existing application that has no cDAQ onboard, and I want some guidance on the differences between various modules available. I know I can use a single 9862 module in a single-slot chassis, but it is almost three times the cost of a USB-8473 unit so I'm wondering what are the differences between NI-CAN (used by the USB board) and NI-XNET used by cDAQ module.
The application I have to write must be flexible, in that I must communicate with different devices each with its proper .dbc file. In the LIN application I had listed the content of the .ldf file on screen, letting the user choose which signal to read and monitor; creating a session for signal_in_single_point made easy to monitor all and only the desired signals. I wander if a similar framework can be used in CAN environment too, and whether NI-CAN can do this or I must go the XNET way.
Every suggestion is welcome at this moment, as we already are in the design step of the process.
BTW, the application is built in LabWindows/CVI, if that's a discriminant.
03-30-2015
07:28 AM
- last edited on
02-13-2025
11:13 AM
by
Content Cleaner
The cheap 8473 has no hardware timed retransmit, and it has no built in support for channel (signal) API. It is essentially a dummy device similar to a serial port where you can read things, and write things immediatly. If you don't have tight timing on frames that must be sent out, say once every 100ms and if it were 150ms things would be fine, then you might be able to get away with it but you'll need another library to convert from frames to channels and back. Luckily there exists one already.
https://forums.ni.com/t5/Example-Code/CAN-Frame-Signal-Conversion/ta-p/3534000
The more expensive XNET option is much more flexible. Allowing for importing databases into the hardware which handles the conversion, there are multiple ways to read and write frames or signals and multiple sessions can be open for the hardware at the same time. There's hardware filtering, cool buffering for reading/writing.
Here is a presentation I did recently for a user group going over some of the differences but it is more meant to be a into to CAN as much as an into to XNET.
If it were me I would not use the 8473 for any project that is supposed to be scalable. I realize it is much more costly but it comes with the benefits that make developing and upgrading it easier. But if you are unfamiliar with the API you may want to get your feet wet with some examples. It does things in a different way than the older NI-CAN does and that takes a little getting used to.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
03-30-2015 09:35 AM
Hello and thanks for answering
I tend to consider that going the path to learning another library (NI-CAN) and trying to pack your conversion tool into a DLL to call in CVI (including installing all necessary software like that VIPM you mention as a prerequiiste) takes me more than the extra cost of using the XNET device
One item I would like to discuss a bit is timing: the system I am to manage communicates with a device at a time (actually they're battery managers - BMS) which sends 3-4 different frames each scheduled on 100 msec. I'm not interested in operating in XY or waveform, I can stand with single point but I must honour the scheduling, while maintaining control on my equipment on the same time. Is the 9862 capable of acknowledging the frames from the BMS or has the ACK to be issued from my program? That's just to understand how much care is needed in designing the system. Messages from me to the BMS are very rare, if any.
03-30-2015 09:44 AM
Acks of a frame are handled by the hardware, the CAN tranceiver will tell the other nodes on the bus that the message was seen. Then that message will sit in a buffer waiting for a read from your software. Then an array of frames will be returned, which is the frames that came in since the last read.
If there is more hand shaking involved neither hardware gives you a good solution, simply because software timing is then involved. Like lets say a node sends a frame as a request, and you need to send a reply which is another frame within some amount of time. Your PC will need to be polling the bus looking for frames, and sending the frames that it was requested to send. The only way around this is a real time or FPGA system that is embedded.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
04-03-2015 09:43 AM - edited 04-03-2015 09:49 AM
I have not yet decided on the hardware to choose but I went to my customer and he said that part of the deveices he wants to connect are CANOpen
Does the 9862 module handle CANOpen protocol too? Do I need a different device or an additional software library or what? And does it exist a module that handles both protocols (not contemporary, of course)? Sorry for bothering you, but I stumbled into this CANOpen new and I'm a bit lost at this!
04-08-2015
03:57 PM
- last edited on
02-13-2025
11:14 AM
by
Content Cleaner
I think the only module for CANopen is the 9881, but The NI 9881 requires a cRIO-911x/903x/906x/908x chassis and the LabVIEW FPGA Module. Otherwise it looks like PCI/PXI cards.
Here is the CANopen interface NI page https://www.ni.com/en-us/shop/category/industrial-communication-buses.html
Also when using the 9862, don't forget you have to power that module.
04-09-2015
12:52 PM
- last edited on
02-13-2025
11:15 AM
by
Content Cleaner
To add some additional information about CANopen, please check out this KnowledgeBase article:
What CANopen Software is Available and What Hardware is Compatible with National Instruments Products?
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6yhSAC&l=en-US
CANopen is only an application layer, so technically you can develop your own Application Layer to be used with the 9862. Also, when considering your customer's application, please keep in mind that our CANopen specific devices, like the 9881, can only be used as a CANopen Master. If you require a CANopen slave, you may need to develop your own application layer. Systems Engineering at National Instruments has developed a non-supported (as in the code is as-is) application layer to be used older CAN C series modules. Please see that example here:
CANopen Reference Example for the NI-9853 C-Series CAN Module
Additionally, the CANopen module (9881) does handle both CAN and CANopen. The example project for the 9881 contains example VIs on how to read and write raw CAN frames. The CANopen module does not have CVI support, only LabVIEW.
Hope this helps!
04-17-2015 07:52 AM
Hello, first of all thanks to all for answering and giving useful hints on this subject. Thanks to _Bryan for underlining the power supply requirements that I was missing.
After reading all posts, is seems to me that grouping CAN, CANopen and CVI requirements results in a garbled situation that has no easy solution... I will search other alternatives that are more user friendly.