From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read CAN Interface of USB-8473 by programmation

Solved!
Go to solution

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.

 

vi

 

Data location in MAX:

max

 

I'm working with:

LabVIEW 2012 SP1 (12.0.1f3), 32 bits

MAX 5.4.0f0

NI-CAN 2.7.4

 

Thanks,

Francis M
0 Kudos
Message 1 of 11
(4,591 Views)

Find the attached code.

 

Device Identification Prototype.png


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 2 of 11
(4,580 Views)

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...

Francis M
0 Kudos
Message 3 of 11
(4,577 Views)

@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.

 

All devices.png

 

I dont know, but you might be correct, as this is you who actually running it and getting no results...!!


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


0 Kudos
Message 4 of 11
(4,572 Views)

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).

 

help1

 

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?

Francis M
0 Kudos
Message 5 of 11
(4,568 Views)
Solution
Accepted by topic author Cisco

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:

 

canconnect.png

 

Edit - you can easily try something similar to create an array of connected interfaces (if you have multiple devices)

---
CLA
Message 6 of 11
(4,555 Views)

Hi thoult,

 

Thank you for your idea Smiley Happy! 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:

solution.png

Francis M
0 Kudos
Message 7 of 11
(4,548 Views)

The function you want is ncGetHardwareInfo in the Frame API palette. See the help for exact details on how to get the device name.

Message 8 of 11
(4,546 Views)

Ah yes - you can just cycle through cards/ports to list all the interface numbers.

---
CLA
0 Kudos
Message 9 of 11
(4,532 Views)

This is a lot less code for a similar result, using ncGetHardwareInfo:

Get CAN Device Name.png

Message 10 of 11
(4,521 Views)