LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a VB dll with boolean parameter in labview

hi ,
     I havea problem with labview calling dll.
     I need to call a customer's dll(VB) , but I find labview have no  boolean type parameter, so how can I do it ?
     I have used labview 7.1 and only have dll without source code.
 
sonic
Sonic

Diffrent Strokes for Different Folks
0 Kudos
Message 1 of 9
(7,090 Views)

Hey,

Just use a singned 8-bit numeric as parameter and then cast it to a boolean in LV.

BR, Christian

0 Kudos
Message 2 of 9
(7,067 Views)
In the past I had similar trouble passing a boolean parameter (DLL was written in C) using LabVIEW 7.0. Every possible combination of input paramater configuration in LabVIEW caused the DLL to crash.

I am sorry to say that my solution in the end was to recompile the DLL (I had access to the C source) with the boolean parameter as integers. If you are not able to recompile the DLL I do not know how to help you here.

Edit: I am referring to passing booleans into a DLL

Message Edited by nrp on 10-18-2007 09:58 AM

Message 3 of 9
(7,066 Views)

Hey,

Since LabVIEW 8.5 the implementation of DLL errorhandling is much better. So you have the option to set the Error Checking Level to Disable, Default or Maximum in the configuration of the Call Library Function node. This would avoid crashes according to e.g. wrong parameters.

Christian

0 Kudos
Message 4 of 9
(7,060 Views)

 

Hi,BR, Christian

"Just use a singned 8-bit numeric as parameter and then cast it to a boolean in LV."

I have build a simple sample to do it with labview 7.1,but I find it can't.

whatever input or output parameter,I can't use 8-bit numeric as parameter to transform to bool.

maybe I didn't understand  what you means, can you bulid a little sample  to me ?

thanks

Sonic

Diffrent Strokes for Different Folks
0 Kudos
Message 5 of 9
(7,055 Views)
Open the Example Finder that comes with LabVIEW (Help->Find Examples)
Switch to the "Search" tab.
Enter "DLL" in the search box.
Open the VI called "Call DLL".
Run it.
Select the data type that best matches what you're looking for and click the "Open Example VI...".

As for the data type itself, is this a VB6 DLL or a VB.NET DLL? I'm assuming it's a VB6 DLL, otherwise you would just use the .NET functions. In that case, VB6 Booleans were stored as 16-bit integers. So, you can open the second example displayed in the listbox for the "Call DLL" VI (BOOLEAN <-> U8) and replace the conversion to U8 to a convesion to I16. The Call Library Function Node needs to be configured so the input is a 16-bit integer. That should work.
Message 6 of 9
(7,034 Views)
hi   semercurio :
    I have bulid a dll by lv 7.1 with boolean and  then call lt  from LV7.1,but i have some issue of it .
    I also use U8 and I16 type and all pop up a errer message,you can see it from accathed.
    do you have any suggestion about it ?
Sonic

Diffrent Strokes for Different Folks
Download All
0 Kudos
Message 7 of 9
(7,013 Views)
Now I'm the one who's confused. That code isn't even VB. It looks like you were trying to create a CIN, which is something completely different from a DLL. You will need to be a little more specific in what you're doing.
Message 8 of 9
(6,994 Views)
Hi smercuri:
      because i have no source code , i have ask customer to change the boolean to integer(1,0)     : )
     and  i find that  Tsetsand support the boolean, damn it
 
sonic
Sonic

Diffrent Strokes for Different Folks
0 Kudos
Message 9 of 9
(6,967 Views)