LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling C++ DLL function in labview

I found it. It's in Labview.exe .

Thanks, Rolf.

-Joe
0 Kudos
Message 11 of 14
(1,312 Views)
Joe Guo wrote:
> Rolf, I have hard time to find the LabVIEW library. What's the exact
> name? Thanks.

Just use LabVIEW as library name. It won't show the functions in the
ring control but since you already know which function you want to call
this is not a problem and you can enter its name directly.

With "LabVIEW" as library name this VI will run on any LabVIEW platform
whereas if you select the LabVIEW.exe file it will be broken on
non-Windows platforms.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 12 of 14
(1,312 Views)
This is an interesting problem. I am writing a dll that calls Matlab API and LabVIEW API using the "Call Library Function". This requires me to set up the prototype using the configure option in LabVIEW. The types determined by the configure option are

long BWD_Read(void *Path, LStrHandle ID_Name, double *ID, LStrHandle Signal_Array_Name, void *Signal_Array, LStrHandle Data_Array_Name, Array2DDouble **Data, LStrHandle Units_Array_Name, void *Units_Array);

but when I click on the generate .c file I get a prototype of

long BWD_Read(Path Path, LStrHandle ID_Name, double *ID,
LStrHandle Signal_Array_Name, TD1Hdl Signal_Array,
LStrHandle Data_Array_Name, TD2Hdl Data, LStrHandle Units_Array_Name,
TD1Hdl Units_Array)


So I use the former, i.e.

long BWD_Read(void *Path, LStrHandle ID_Name, double *ID,
LStrHandle Signal_Array_Name, void *Signal_Array,
LStrHandle Data_Array_Name, Array2DDouble **Data,
LStrHandle Units_Array_Name, void *Units_Array);

When I go to run I get

The function name specified for this node cannot be found in the library. Right-click the Call Library Function node and select Configure, then choose the correct function name.
Jim Johnson Technical Specialist TRW Automotive (734)855-2482 jim.johnson@trw.com
0 Kudos
Message 13 of 14
(1,312 Views)

@Jim at TRW wrote:
This is an interesting problem. I am writing a dll that calls Matlab API and LabVIEW API using the "Call Library Function". This requires me to set up the prototype using the configure option in LabVIEW. The types determined by the configure option are

long BWD_Read(void *Path, LStrHandle ID_Name, double *ID, LStrHandle Signal_Array_Name, void *Signal_Array, LStrHandle Data_Array_Name, Array2DDouble **Data, LStrHandle Units_Array_Name, void *Units_Array);

but when I click on the generate .c file I get a prototype of

long BWD_Read(Path Path, LStrHandle ID_Name, double *ID,
LStrHandle Signal_Array_Name, TD1Hdl Signal_Array,
LStrHandle Data_Array_Name, TD2Hdl Data, LStrHandle Units_Array_Name,
TD1Hdl Units_Array)


So I use the former, i.e.

long BWD_Read(void *Path, LStrHandle ID_Name, double *ID,
LStrHandle Signal_Array_Name, void *Signal_Array,
LStrHandle Data_Array_Name, Array2DDouble **Data,
LStrHandle Units_Array_Name, void *Units_Array);

When I go to run I get

The function name specified for this node cannot be found in the library. Right-click the Call Library Function node and select Configure, then choose the correct function name.





Hello Jim,

A few questions about your issue.

1. In what language with what compiler are you creating your DLL?
2. Is the prototype you use in your DLL the one from the Configure dialog?
3. Have your confirmed that the BWD_Read function is being exported from your DLL?
0 Kudos
Message 14 of 14
(1,292 Views)