LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dll error message

 HI
I want to call a dll in the labview,
 
some mistake was occured, but I do not know the reason of the  mistake  .
 
can anybody help me .
 
the error message is in the appendix
 
the introduction of the dll is also in the appendix.
 
thank you very much
Download All
0 Kudos
Message 1 of 10
(3,838 Views)

Your Call Library Node is configured incorrectly for the DLL function you are trying to call.  This is a very tricky subject.  When calling a DLL function, you have to specify the Labview equivalent type to the DLL type.  Such as:  DLL DWORD is Labview U32, WORD is U16, HANDLE is U32, BYTE is U8.  Search NI website for DLL and you will see whitepapers on this subject and how the C types translate to Labview types.  Some C types do not translate directly to Labview types, and another approach must be taken (wrapper DLL or CIN).

Another thing to look at is the Calling Convention.  Try both the Standard (WINAPI) and the C convention.  One of these will work and the other will cause crashes.  It depends on how the DLL was written and I have yet to figure out the differences because I don't write DLLs, hence I don't know much about them except how to call the functions in Labview and other languages.

- tbob

Inventor of the WORM Global
Message 2 of 10
(3,825 Views)

:):):)

Glad to see you are back Tbob...

Chilly Charly    (aka CC)
0 Kudos
Message 3 of 10
(3,817 Views)

thanks tbob

I really appreciate your help

0 Kudos
Message 4 of 10
(3,810 Views)

HI tbob

Can you give me a link of the LabView dll white paper (about the parameter difference between LabView and dll), I search “dll white paper

 

” there is nothing subject , searchdll” there is  too many subject .

0 Kudos
Message 5 of 10
(3,806 Views)
 

Here is a good start:  http://zone.ni.com/devzone/conceptd.nsf/webmain/5CF9A9FFD774028586256869005FF2ED 

- tbob

Inventor of the WORM Global
Message 6 of 10
(3,788 Views)

thank your tbob

can you tell me In what way labview can call one of this function in the dll?
"the function parameter is a pointer,which point to the return value.
the parameter is a LPDWORD,and the return value is DWORD. "
I tried to config the parameter and retrun value in the clf (according to  the dll guide in the ni develop zone),but the error message always say the dll corrupted the labview memory.(the error message is in the appendix)
 
I do not know what can I do, how can I config the parameter and return value in the clf.
 
thanks
0 Kudos
Message 7 of 10
(3,779 Views)

by the way how can i make a dll to a wraper dll

someone say that make a wraper dll can avoid the labview crash.

0 Kudos
Message 8 of 10
(3,760 Views)
I've answered your first question in another thread you posted.  Please post only one thread, more than one makes it confusing.  Try changing the calling convention before attempting to write a wrapper.  A wrapper DLL is a DLL written in C that does the data type conversion from Labview types to the original C DLL types.  It is complicated and requires a great knowledge of C programming.  Too much to go into any details here.  Wrappers are usually used when complex C Structures are involved.  The wrapper would break down the structure into simpler data types.  The simpler types would interface with Labview.  These types would be combined into the complex structure needed by the C DLL.  Then the wrapper calls the C DLL with its built up structure.
- tbob

Inventor of the WORM Global
Message 9 of 10
(3,743 Views)

sorry to posts many threads ,

thank you very much and I will try it.

0 Kudos
Message 10 of 10
(3,731 Views)