LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

call an 8.2 dll in Labview 7.0

Solved!
Go to solution

Hello,

 

I have a bunch of applications written in Labview 7.0.  I need to add a small update to these apps, that uses some of the features of 8.2.1.  I have compiled the features into a dll and want to call this in my labview 7.0 application.  I have the runtime installed and a working 8.2.1 example but when i come to try the same code in Labview 7.0 i get an exception to do with memory.dll, line 342 in the 8.2.1 runtime.  I guess my first question is whether or not it is possible to call an 8.2.1 dll from lavbiew 7.0? 

 

Thanks,

 

Simon 

Message Edited by sbosanquet on 04-20-2009 08:44 AM
0 Kudos
Message 1 of 2
(2,523 Views)
Solution
Accepted by topic author sbosanquet

sbosanquet wrote:

Hello,

 

I have a bunch of applications written in Labview 7.0.  I need to add a small update to these apps, that uses some of the features of 8.2.1.  I have compiled the features into a dll and want to call this in my labview 7.0 application.  I have the runtime installed and a working 8.2.1 example but when i come to try the same code in Labview 7.0 i get an exception to do with memory.dll, line 342 in the 8.2.1 runtime.  I guess my first question is whether or not it is possible to call an 8.2.1 dll from lavbiew 7.0? 

 

Thanks,

 

Simon 

Message Edited by sbosanquet on 04-20-2009 08:44 AM

It is possible but you can not use LabVIEW native datatypes as parameters. Those datatypes are allocated on the heap of the currently executing process and since your DLL is in a different version than your LabVIEW host applciation, that DLL runs in the according runtime engine process. By using LabVIEW native datatypes you tell the DLL basically look here is a data handle containing an array or string and then the DLL tries to resize it as needed but since that memory was not allocated in its own process using its own memory manager those memory manager functions can't do otherwise than cause invalid memory access exceptions.

 

If you stick to standard C datatypes (skalars, array and string C pointers) and also make sure to allocate the memory in the caller VI before passing it to the DLL function and making sure it is at least as big as the DLL ever possibly could want to write to, you should be fine in doing what you want to do.

 

Rolf Kalbermatter

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 2
(2,496 Views)