LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Kvaser CAN bus interface

You can also look at Hooovahh's CAN blog 
https://hooovahh.blogspot.com/2017/03/can-blog-introduction-and-downloads.html

 

It has drivers for Kvaser. 

0 Kudos
Message 11 of 15
(284 Views)

@dkfire wrote:

And how is that lib call setup ?


SAme as the others except this on is set to run in the UI thread instead of any thread

 

kv5Capture.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 12 of 15
(279 Views)

@RTSLVU wrote:

I don't know what this is telling me.

...

Probably a mistake on my part somewhere. Probably the two integers need to be static (or const, or both). Since we saw that the dll can be called from within 32bit LabVIEW, I think there's not much diagnostic value left in determining if the dll itself is working properly.

 

For completeness, I guess this should work

cd "C:\Program Files (x86)\Kvaser\Canlib\Bin\"

function Can-InitializeLibrary{
    $Signature = @"
[DllImport("canlib32.dll", EntryPoint = "canInitializeLibrary")]

public static extern void canInitializeLibrary();
 
public static void InitLibraryExport() {
    canInitializeLibrary();
}
"@
    Add-Type -MemberDefinition $Signature -Name InitLibraryType -Namespace User_
    [User_.InitLibraryType]::InitLibraryExport()
}

Can-InitializeLibrary

 

0 Kudos
Message 13 of 15
(269 Views)

@RTSLVU wrote:

@dkfire wrote:

And how is that lib call setup ?


SAme as the others except this on is set to run in the UI thread instead of any thread

 

kv5Capture.PNG


I need to check how mine is setup. 
But you can try to change the Thread. Could be that is has loaded the lib in ui thread, and can't find it in the other threads. 

0 Kudos
Message 14 of 15
(260 Views)

@dkfire wrote:

@RTSLVU wrote:

@dkfire wrote:

And how is that lib call setup ?


SAme as the others except this on is set to run in the UI thread instead of any thread

 

kv5Capture.PNG


I need to check how mine is setup. 
But you can try to change the Thread. Could be that is has loaded the lib in ui thread, and can't find it in the other threads. 


Did a check on the working production code, that dll call is set to Any thread. 

0 Kudos
Message 15 of 15
(234 Views)