LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dll call in LV (usbm.dll)

Solved!
Go to solution

Hello all,

 

I'm having a hard time figuring out how to call a DLL in Labview. I've read a little bit about it but am still a newbie. The DLL in question is usbm.dll (http://www.usbmicro.com/, the list of functions & types is documented there). I use the call library node to call the DLL.

 

As long as I call functions with no input argument things work fine (for instance my first 2 calls check for device presence and number of devices, and work ok returning the proper output)

 

Then I try using functions with arguments (3rd step in the VI) and Labview doesn't take them (Error 1097). I'm going for function "int USBm_DeviceValid( unsigned char device )" , I believe the argument should be of type uint8 and output of type int8... I've tried all numeric types to no avail.

 

On top of that, if I skip step 3 of the VI and go to step 4 (calling a function which takes 2 parameters and sends a command to my device) : the function is executed (eg the device moves), but then Labview crashes (exits with no error message). Is this due to improperly calling the function ?

 

Any suggestions would be welcome, thanks !

 

 

 

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

What version of LV are you using? I have 2010 and can't even open the VI...LV crashes without any message?!

*************************************************
CLD
*************************************************
0 Kudos
Message 2 of 5
(3,048 Views)

LV 10.0 32bit , under XP64. Yes, it closes with no message.

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

Wow that is what I am using. This seems to be an interesting issue. Did you try with any other DLL? maybe Windows DLL jst to test?

*************************************************
CLD
*************************************************
0 Kudos
Message 4 of 5
(3,025 Views)
Solution
Accepted by topic author degemer

Hi lvrat, thanks for your suggestions.

 

I got around the problem. I recovered an older version of this usbm DLL (together with some LV example files) which works fine. Looks like the more recent DLL I was using has some issue with Labview...

 

I'm attaching these files (they were not easy to find), in case someone else tries to interface to an USBmicro device.

 

 

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