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: 

Re: Connecting to multiple KVASER - Leaf Light HS at once....

Solved!
Go to solution

I am trying to connect 2 Kvaser (USB) dongles to my computer using LabVIEW simultaneously...

They are connected to the computer with a USB Hub but that shouldn't make any difference.

 

I have: CANKing CAN bus monitor program and the Kvaser SDK and their LabVIEW library also - all installed.

 

When I run CANKing, the program can detect both USB devices and also the 2 virtual channels - 4 in all.

 

When I call the CanGetNumberOfChannels.vi the value returned is 3 - but should be 4.

 

I am assuming that the CANKing program uses the same API calls.

 

Any ideas, why the second device is not recognised??

 

0 Kudos
Message 1 of 5
(3,294 Views)

Hi Sammy,

 

If you use the devices one at a time, does the CanGetNumberOfChannels.vi return the proper value?

 

Best,

Jeff S.
National Instruments
0 Kudos
Message 2 of 5
(3,263 Views)
Solution
Accepted by sammy346

I have seen this behaviour before, it is nearly impossible to cleanly unload the Kvaser dll when it is misbehaving.  Re-starting LabVIEW may help.  If the Kvaser hardware configuration tool shows 4 channels, then the CanGetNumberOfChannels dll call should reflect this.  It is not a good idea to add or remove a device with the driver loaded.

All the best,

Michael.

0 Kudos
Message 3 of 5
(3,256 Views)

Yes,

 

I was playing around with it further again yesterday and just calling a dll directly without using the VI (which is basically the same thing).

 

Results have been inconsistent although I was able to get the dll to recognise four channels at one point.

 

 

0 Kudos
Message 4 of 5
(3,248 Views)

Just came across your question here.  An answer to your question is on our website at:

 

http://www.kvaser.com/en/support/faq/270-labview.html

 

As the FAQ at the link states, the problem arises due to when the DLL is unloaded.

0 Kudos
Message 5 of 5
(3,199 Views)