LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help to find a mistake in DLL

I would like to learn to use in LabView DLL, created by means of Visual C ++. I have created DLL in which has made test function (Summa) and working function (readdata). Thus function the Sum works normally, and here function of reading of files does not work. Help to find a mistake, please. Besides would like to learn how to debug DLL, caused of LabView. In the further I plan to use DLL, written on Visual With ++, therefore the information on use such DLL in LabView and their debugging to me very much would be useful.
0 Kudos
Message 1 of 3
(2,258 Views)
Have you taken a look at the examples that ship with LabVIEW? If you go to the Example Finder (Help->Find Examples...) and enter DLL in the search box, you will find a "Call DLL" examples that shows many examples, including several that deal with arrays. In these examples the array is allocated in LabVIEW, as opposed to the allocation being done in the DLL, which is what you're doing in your DLL. You may also want to take a look at this: Passing a Variety of Data Types from DLL to LabVIEW.
0 Kudos
Message 2 of 3
(2,244 Views)
smercurio has already asnwered you with good tips. Generally speaking it is not a good idea in C to have the callee allocate memory and return it to the caller. Instead the caller allocates the necessary memory and passes it to the callee to be filled in. The other way around will require the caller to have specific knowledge about the memory management routines used in the callee and make everything rather complicated. In terms of LabVIEW with its own quite different memory management you really get into difficulties if you try to do it backwards.
 
Rolf Kalbermatter
Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 3
(2,235 Views)