ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Called Library Function name

I am calling a DLL interface function of my own construction,
naming the function identically in the Called Library Function node
configuration dialog.

Labview cannot resolve it - says cannot find the function name in the
DLL.

Can anyone help with the idiosyncracies of this?
Thanks!

George P. Cotsonas
Motorola, Inc.
Personal Communications Sector
0 Kudos
Message 1 of 4
(2,946 Views)
Hi George,

you have to export the function inside the dll to get access from other
applications. with the normal declaration like

int f1( int a, int b);

it won't be visible outside the dll.
Cause i don't know which compiler you use i give a example for borland
c++ builder. The others won't be much different.

extern "C" __declspec(dllexport) int f1( int a, int b);

After compiling labVIEW will find you function.

good luck
Henrik


"George P. Cotsonas" wrote:
>
> I am calling a DLL interface function of my own construction,
> naming the function identically in the Called Library Function node
> configuration dialog.
>
> Labview cannot resolve it - says cannot find the function name in the
> DLL.
>
> Can anyone help with the idiosyncracies of this?
> Thanks
!
>
> George P. Cotsonas
> Motorola, Inc.
> Personal Communications Sector
0 Kudos
Message 2 of 4
(2,946 Views)
George,

LabVIEW 6i automatically presents a list of functions marked for export for
a given DLL, so I assume you are using a previous version of LabVIEW.
Besides ensuring that your function is marked for export (the documentation
for your compiler should tell you how to do this), you should also ensure
that the function has not been "decorated" by the compiler. If your DLL's
source file has a .cpp (C++) extension, the function name is probably being
decorated by the compiler, which means extra characters are added to the
function name. LabVIEW will only recognize the decorated name. There are
two ways around this: either find out what the decorated name is, which is
tricky, or disable decoration. You can typically disable decoration either
by using .c as the
source file extension or declaring the function as extern
"C".

Steven Harrison

"George P. Cotsonas" wrote in message
news:3A26D7EA.E62176D4@motorola.com...
> I am calling a DLL interface function of my own construction,
> naming the function identically in the Called Library Function node
> configuration dialog.
>
> Labview cannot resolve it - says cannot find the function name in the
> DLL.
>
> Can anyone help with the idiosyncracies of this?
> Thanks!
>
> George P. Cotsonas
> Motorola, Inc.
> Personal Communications Sector
>
0 Kudos
Message 3 of 4
(2,946 Views)
All,

I have a vi entitled 'get dll exports' i believe i got from NI's website.
in any case, you select the file and it will tell you all the dll exports
names. It works in labview 5.1. i dont know if it will show the decorated
characters steve speaks of. I am emailing it to george. Anyone else who
wants it, email me and i will send it to you

jared.

"Steven Harrison" wrote:
>George,>>LabVIEW 6i automatically presents a list of functions marked for
export for>a given DLL, so I assume you are using a previous version of LabVIEW.>Besides
ensuring that your function is marked for export (the documentation>for your
compiler should tell you how to do this), you should also ensure>that the
function has not been "decorated" by the comp
iler. If your DLL's>source
file has a .cpp (C++) extension, the function name is probably being>decorated
by the compiler, which means extra characters are added to the>function name.
LabVIEW will only recognize the decorated name. There are>two ways around
this: either find out what the decorated name is, which is>tricky, or disable
decoration. You can typically disable decoration either>by using .c as the
source file extension or declaring the function as extern>"C".>>Steven Harrison>>"George
P. Cotsonas" wrote in message>news:3A26D7EA.E62176D4@motorola.com...>>
I am calling a DLL interface function of my own construction,>> naming the
function identically in the Called Library Function node>> configuration
dialog.>>>> Labview cannot resolve it - says cannot find the function name
in the>> DLL.>>>> Can anyone help with the idiosyncracies of this?>> Thanks!>>>>
George P. Cotsonas>> Motorola, Inc.>> Personal Communications Sector>>>>
0 Kudos
Message 4 of 4
(2,946 Views)