LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call library function node - see no params while declared in the dll

When I compile a msvc++ dll and will caall it from LV71, I see the implemented functions. When I select one of them, the parameters don't apear on the parameter list.
 
Is it normal?
 
Do you have some tool to get the correct parameters into this "Call Library Function block"?
 
I also tested some examples and I alwaays get a "void funtion(void)"   void" back in the params list.
 
exmpl: void GetSphereSAandVol(void);
 
Woutert  Smiley Sad
 
Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 1 of 6
(3,456 Views)
In the internal DLL the exported functions are done so by name with no parameter information.  So when you create a new Call Library Function the "prototype" shown in the bottom pain will be "void funcName(void);".  LabVIEW has no way to know the parameters up front because of the way functions are exported.
 
You will have to add the callback type and parameters yourself using the Add Parameter After button on the right.  Click this and it will create a new param, then set its data type/ size etc...
0 Kudos
Message 2 of 6
(3,451 Views)
I should clarify that by adding this to the discussion.  Most DLLs do not come with the Type Library (LIB file) but since you are doing this yourself autopopulation of the params should be possible.  I would start here for more information:
 
0 Kudos
Message 3 of 6
(3,448 Views)


@chaos wrote:
I should clarify that by adding this to the discussion.  Most DLLs do not come with the Type Library (LIB file) but since you are doing this yourself autopopulation of the params should be possible.  I would start here for more information:
 


The only DLLs I have come across which support this are DLLs created in LabVIEW. Not really a well supported feature I would think. It is also not that Microsoft would make a lot of effort to tell people that this is even possible.

Rolf Kalbermatter


Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 6
(3,440 Views)
Hi,
 
I tried, even with the samples found in labview\samples\dll and it didn't work.
 
I build an excample with CVI and it didn't work.
 
The way to make .lib files can be done by the LIB.exe program found on the older VC cd's.
 
My project dll was build and I found a .lib file. Even so I could get the correct function call+params.
 
I think that Labview is not able to do this job correctly.
 
It could be a challenge to develop a VI that does this work correct. Maybe from the .H file or .def or .lib files.
 
The NI example Call Dll.vi doesn't work either.
 
Wouter
Have program a realtime simulator for powerplants written in C++.I translates the RT sim to NI components and software (Labview).


My rt pxi turbine simulator for simulating grid incidents was succesfully used in a nuclear plant in 2006.

Look at http://sine.ni.com/cs/app/doc/p/id/cs-755
0 Kudos
Message 5 of 6
(3,435 Views)


@woutert wrote:
Hi,
 
I tried, even with the samples found in labview\samples\dll and it didn't work.
 
I build an excample with CVI and it didn't work.
 
The way to make .lib files can be done by the LIB.exe program found on the older VC cd's.
 
My project dll was build and I found a .lib file. Even so I could get the correct function call+params.
 
I think that Labview is not able to do this job correctly.
 
It could be a challenge to develop a VI that does this work correct. Maybe from the .H file or .def or .lib files.
 
The NI example Call Dll.vi doesn't work either.
 
Wouter


The DLL itself has to be linked accordingly to support this. LabVIEW can do nothing about that after the DLL has been created, but if you use LabVIEW to create a DLL from your VIs it does add the information.

And it is not in the lib file (in there is the compiled binary code of all object files implementing the functionality but it is instead part of the type library (*.tlb). This type library is usually also responsible for providing the interface information used by interactive development environments such as LabVIEW or VB to connect to the Active X objects in a DLL. To create a type library you have to write an IDL script or something like that and invoke the Windows IDL compiler, then add the resulting tlb file as an extra parameter to the link step that binds the .lib, .obj, .tlb and .res files into an executable image for the resulting exe or dll file.

So if you want LabVIEW to be able to pickup the type information for your DLL you have to pest the original developer of your DLL to add type library support for the DLL interface to the DLL.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 6 of 6
(3,335 Views)