NIDave wrote:
> Thanks for the reply Jeremy, I try to change them manually after the
> program stops. I use a property node to alter other controls but not
> the one I discovered the problem on. I am suspecting a memory leak
> within the dll or some problem with the way I am passing strings and
> arrays in and out of my call library function nodes. (I initialize
> the strings and arrays before the function is called, so I am leaning
> toward an issue in the C code.
Well here you go. Calling a DLL and then getting (delayed) crashes in
LabVIEW absolutely always means that the DLL is trashing some memory it
shouldn't. This either happens by passing wrong data (DLL expects by
reference and you pass by value) or arrays and string not initialized or
not intialized to be large enough. Last but not least the DLL of course
can just simply be buggy and do stupid things.
So you will have to verify somehow that the DLL works correct outside of
LabVIEW. If you have verified that, then you need to check all
parameters of all function calls into the DLL to be correct and also
large enough for the DLL.
Especially make sure that for strings you allocate 1 more byte than the
longest string the DLL may want to write into, and for arrays that you
allocate the right number of elements of the right type. Sometimes the
documents state that the array must be at least 100 elements long but if
this is an integer then that amounts actually to 400 bytes.
> Also another oddity, when I first open labview and run the code it
> works great, however if I try to close the VI but not labview then
> run it again it fails. I think that labview is not dropping the dll.
> Is there a way to force it to release the dll?
Not really. A DLL should not depend on being unloaded to be callable
again. But the error you describe could be because of several reasons.
Basically make sure you call any existing Close or similar function at
the end as well as initialization function in the beginning. Also the
error could be related to the DLL trashing memory somewhere. So try to
get the DLL to work properly without any bad effects after having it run
once including no crash when unloading the VI, closing any front panel,
doing some LabVIEW edit functions or last but not least closing LabVIEW.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390