LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to correctly use LabView with Kvaser hardware

Solved!
Go to solution

Hello,

I have been using the Kvaser BlackBird v2 for a while now, and i can easily connect it to my PC and being able to interact via CAN with a Texas Instruments F28379D that I am programming, using the software Kvaser CanKing.

I recently found out that it is possible to use the Kvaser hardware with LabView, but I am new to LabView and I need some help to get started.

I followed the instructions I found at https://www.kvaser.com/knowledge-base/how-to-install-labview-drivers/ :

I installed the Kvaser Driver for Windows and the firmware updates.

Then i downloaded the Kvaser CANlib SDK and installed it.

Then i downloaded the Kvaser LabView VI Library for CAN, it is a folder with a kvCanVI.llb file.

If i try to open it and then select kvCanExample1.vi i get this list of errors.

I think it has something to do with the canlib32.dll not being found but as I said, I am a beginner with LabVie, it's my first time using it and i have absolutely no idea on how to proceedkver.PNG

What I would like to accomplish is using the BlackBird v2 to sniff the messages in the CAN bus and using LabView as some sort of monitor to see the message.
For example, in the BUS the F28379D board sends a message and i would like to use the data to updates some graph according to the message ID.

I hope i was clear enough, thankyou in advance for your help.

 

- Alessandro Fano

0 Kudos
Message 1 of 11
(4,008 Views)

A couple of quick questions:

Which version of LabView are you using?

Are you using the latest Kvaser Labview VI wrappers from the Kvaser website?

Which version of kvcanlib.llb are you using?

Which version of the Kvaser driver for Windows did you install?

 

- Troy

 

0 Kudos
Message 2 of 11
(3,945 Views)

I'm using LabView 20.0f1 (64-bit)
I'm using the 2016 v19.3.0 Kvaser LabView VI Library
I'm using 2016 version of kvCanVI.llb

I installed the v5.34.317 Kvaser Drivers for Windows

I also have installed the v5.34.317 Kvaser CANlib SDK

0 Kudos
Message 3 of 11
(3,919 Views)
Solution
Accepted by topic author Alessandro_Fano

Attached is a version of kvCanVI.llb that has been saved in the Labview 2020 32 bit version.  We have seen some issues during up conversion where wires get broken.  So, this should prevent any issues from an up conversion.

 

The other issue could be you are using a 32 bit version of the llb in a 64 bit version of LabView.  To try and get around this issue, place the canlib32.dll from the CANlib SDK install directory C:\Program Files (x86)\Kvaser\Canlib\bin_x64\ in the same directory as the kvCanVI.llb.

 

-Troy

0 Kudos
Message 4 of 11
(3,913 Views)

Thank you very much Troy, this was extremely useful, now it doesn't give any errors.
I tried a quick example to read messages and it works just fine.

 

Best regards,

 

- Alessandro Fano

0 Kudos
Message 5 of 11
(3,909 Views)

Hi Troy,

I had the same question with it.  I need to use 64bit labview in order to calling 64bit dll, but the kvaser  dll was 32bit. how can i use both of them with 64bit labview ?

Is this Kvaser VI 200818 2020.zip ‏602 KB can be called by 64bit labview 2020 ?

 

thanks 

Jieqiang

0 Kudos
Message 6 of 11
(3,535 Views)

The VIs provided in the zip file were created using a 32 bit version of LabView.

 

To use in 64 bit version of LabView, we need to make the VIs reference the 64 bit version of the canlib32.dll.  (The 64 bit version is still called canlib32.dll.)  That is where my previous instructions to "... place the canlib32.dll from the CANlib SDK install directory C:\Program Files (x86)\Kvaser\Canlib\bin_x64\ in the same directory as the kvCanVI.llb." apply.  This should make the 64 bit version of canlib32.dll the first version found by LabView when attempting to load the VIs.

 

When you install the Kvaser drivers for Windows on a 64 bit OS, the 32 bit and 64 bit versions of the canlib32.dll are installed in the sysWoW64 and system32 directory respectively.  So, by placing the dll directly in the same directory as the llb, you are ensuring the program attempts to associate the correct version.

 

-Troy

0 Kudos
Message 7 of 11
(3,517 Views)

thanks a lot,it works!

0 Kudos
Message 8 of 11
(3,494 Views)

Is there anyway I can get CanOpen library or VIs for Kvaser hardware? 

0 Kudos
Message 9 of 11
(3,429 Views)

@TroyVia wrote:

 

When you install the Kvaser drivers for Windows on a 64 bit OS, the 32 bit and 64 bit versions of the canlib32.dll are installed in the sysWoW64 and system32 directory respectively.  So, by placing the dll directly in the same directory as the llb, you are ensuring the program attempts to associate the correct version.


Actually since your driver installer installs the DLLs in the appropriate system folders, you should not place private copies of those DLLs in folder besides your LabVIEW LLB. Instead edit all VIs to reference the canlib32.dll by name only (without any path) and remove the private canlib32.dll. When the LabVIEW Call Library Node references DLLs by name only it lets Windows do the finding and loading of the DLLs and that will pick up the latest and greatest that your installer placed in the system locations, and automatically the right bitness too.

 

This does mean that built executables won't copy a private copy of the DLL into the executable directory and therefore your driver installer needs to be executed on any computer where such an executable is to be run, but that is anyhow the right thing to do. Applications should not try to contain private copies of hardware drivers but instead use the ones that were installed by the driver installer.

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 11
(3,418 Views)