LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 7 crashes when a vi containing a dll is closed

Dear All,
 
I've written a dll in C language to use a USB dongle. Before making my C code into a dll, I throughly tested it as a console application, using Borland C++.
 
In Labview, I call my dll, using the call library function node. The first time I run my program, it does what I expect with the dll. If I try to run it again, it doesn't work. I found a program on the internet, called listdll, which displays the dlls that are currently loaded in memory. The dll that I wrote as well as the other dlls that this function uses (loaded statically), appear in the list.
 
To get my program to run properly once again, I need to shut down labview and open it up again. However when I shut down Labview, I get a Labview-Application Error message, that says that the instruction at "0x06b323d1" referenced memory at "0x06b323d1". The memory could not be "read".
 
How can I possibly get around this problem and how can I run my program several times without shutting Labview down in the meantime?
 
My Labview program was written in Labview 7, but if needed be, I've also access to LAbview 8.
 
Thanks in advance for your help,
 
Regards,
 
Alan
 
0 Kudos
Message 1 of 2
(2,466 Views)
Hi Alan,

LabVIEW pre-allocates memory for calls to DLL's, if the DLL's goes over the memory allocation this can cause problems such as a LabVIEW crash. Are any of the parameters arrays or strings?

Regards

Jon B
Applications Engineer
NI UK & Ireland
0 Kudos
Message 2 of 2
(2,440 Views)