LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daqmx question

 

Would you get a memory leak if part of your code is attempting to write values to both analogue and digital lines of a DAQ device without there being a physical DAQ attached? Obviously i get the message at the start about it complaining its unable to create the task etc. But would this continue to give me memory leaks? I’m trying to diagnose why the memory continues to grow in task manger when my application is just idling. I haven’t noticed this before, however i have only just sent the USB6431 back down to the client so no longer have it attached to the computer.

 

0 Kudos
Message 1 of 4
(2,073 Views)

Hello,

 

I should think that this should cause a memory leak. If you open up the VI, you will see that if there is an error present on the cluster, the write/read sub-vi doesn't run any code. Therefore, if you have wired the errors through and the first DAQmx VI throws an error none of the subsequent DAQmx VIs should run.

 

Is there any chance you can upload the code in question, I can see if I can replicate the memory leak here.

 

Also, at what rate is the memory usage growing?

 

Regards

Nick
0 Kudos
Message 2 of 4
(2,034 Views)

Hi niNickC

I assigned a virtual DAQ in the end from C&S interface; this didn’t initially solve my issues.

By segregating my code using diagram disable structures, then turning parts of my code on in turn, i was able to trace my memory leak back to the DAQmx vi’s, but not due to the device being abscent. Instead, i very quickly realised I was stupidly recreating a the DAQ task each time my loop iterated, which in turn was allocating a portion of memory for each task creation. Solution was to take that tsak creation vi out of the loop. Memory leak gone!

Thanks for your time anyway.

 

0 Kudos
Message 3 of 4
(2,031 Views)

Great, i'm glad you have things working.

 

I wish you luck with your application!

Nick
0 Kudos
Message 4 of 4
(2,028 Views)