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: 

build a DLL in LabVIEW & Use the DLL in LabVIEW

I am trying to build a DLL for the simple vi with LabVIEW and want to use the DLL in LabVIEW. is it impossible?
 
I wrote a vi and it have 2 terminals. one is the input for numeric dbl data type and one another is the output for numeric dbl 1D array data type.
 
It was built with the Application builder for LabVIEW 8.0 and DLL was created successfully.
 
I want to use this DLL in new vi with LabVIEW.
 
Call library function used. I wrote a new vi to use that DLL.
 
In config dialog I config each parameter for dll and connected terminals. but it doesn't work
 
pleas refer to the attatched file and let me know what I missed.
 
0 Kudos
Message 1 of 4
(2,548 Views)
At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...

In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:
return type: void
iteration: Numeric, Signed 32-bit Integer, pass by value
array1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" format
len: Numeric, Signed 32-bit Integer, pass by value

Then I called the DLL like this:

Message Edited by smercurio_fc on 03-16-2007 12:57 PM

Message 2 of 4
(2,528 Views)

"smercurio_fc" <x@no.email> wrote in message news:1174068608588-493193@exchange.ni.com...
At first I kept scratching my head wondering why someone would want to do this. Create a DLL in LabVIEW to call it from LabVIEW. Seems redundant. But, perhaps it's an exercise or perhaps it's for testing the DLL...In any event, calling the DLL worked for me in 8.2. How are you configuring your Call LIbrary Function node? I have it set up as follows:return type: voiditeration: Numeric, Signed 32-bit Integer, pass by valuearray1D2: array type, Signed 32-bit Integer, 1 dimension, "Array Data Pointer" formatlen: Numeric, Signed 32-bit Integer, pass by valueThen I called the DLL like this:<img src="http://forums.ni.com/attachments/ni/170/236090/1/Example_BD.png"> Message Edited by smercurio_fc on 03-16-2007 12:57 PM



Example_BD.png:
http://forums.ni.com/attachments/ni/170/236090/1/Example_BD.png



This can be useful when you need jet another dll that needs callback pointers. With GetProcAddress, you can get a pointer to your own LabVIEW dll function. This function can in turn generate a LabVIEW event. Very convenient.


Regards,


Wiebe.
0 Kudos
Message 3 of 4
(2,508 Views)
Hmmm.... Didn't think about this possible use. Still, I've never had much luck with callback functions and tend to do that sort of stuff outside of LabVIEW entirely. Case in point: LabVIEW 8.2 was supposed to handle .NET callback pointers. It doesn't, at least not very well. When I tried it LabVIEW consistently crashed. Yet, when I do it inside my own DLL it works without errors. In general, I try to not use external function calls from within LabVIEW since that just adds more possibilities for things going wrong. Sometimes, however, I have no choice since LabVIEW just can't do everything.
0 Kudos
Message 4 of 4
(2,496 Views)