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,597 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,586 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,583 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,578 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,574 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,561 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,554 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,552 Views)

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

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

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

Get CAN Device Name.png

Message 10 of 11
(4,527 Views)