07-11-2013 08:45 AM
Hello,
I'm looking for an example to obtain the CAN interface name of my card usb-8473. I've developped an application for colleagues and I don't know the CAN interface name they use (CAN0, CAN1, ...). It will be great if I could read this name in my application, to correctly set the object name of the CAN communication I'm configuring and opening.
As joined, an example I've started but I cannot finish.
Data location in MAX:
I'm working with:
LabVIEW 2012 SP1 (12.0.1f3), 32 bits
MAX 5.4.0f0
NI-CAN 2.7.4
Thanks,
Solved! Go to Solution.
07-11-2013 08:58 AM
Find the attached code.
07-11-2013 09:05 AM
Thank you moderator1983.
Unfortunally, it doesn't run in my case. It's a CAN card, not supported by the DAQ driver... the vi you've send give me 3 empty tables...
07-11-2013 09:26 AM
@Cisco wrote:
It's a CAN card, not supported by the DAQ driver..
Hi Cisco, this property node has nothing to do with the DAQ driver or DAQ devices...!!
Please check its description.
I dont know, but you might be correct, as this is you who actually running it and getting no results...!!
07-11-2013 09:34 AM
Hi,
i think it' wrong. In the detailled help, it is precised that is a DAQmx - system property (I work with a french version of LabVIEW).
The link in red box go to another page. It's written that this property give data of NI-DAQmx configuration...
I cannot see my CAN usb card with this property. In the example of my first post, the element "USB-8473 (High-Speed CAN)" appears inthe table.
Perhaps with ActiveX?
07-11-2013 10:16 AM - edited 07-11-2013 10:17 AM
If it were an XNET device it would be discoverable in a similar method, but I *think* the only way I've found to do this in the past is to provide an array of interface names and use ncOpen.vi. Something like the following:
Edit - you can easily try something similar to create an array of connected interfaces (if you have multiple devices)
07-11-2013 10:28 AM - edited 07-11-2013 10:29 AM
Hi thoult,
Thank you for your idea ! I don't know if it is the only way, but it is a good way. I can use my first post example to determine if a usb-can card is connected, and your example to choose the good can interface. The result:
07-11-2013 10:37 AM
The function you want is ncGetHardwareInfo in the Frame API palette. See the help for exact details on how to get the device name.
07-11-2013 10:57 AM
Ah yes - you can just cycle through cards/ports to list all the interface numbers.
07-11-2013 11:06 AM
This is a lot less code for a similar result, using ncGetHardwareInfo: