Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

daq bug

I am using DAQmx 8.0 in RedHat Linux to simultanaously measure digital and analog signals. I am
attaching a sample code of what I want to do. However, when running more
than one instance of this software (e.g. typing ./DAQtest 1 & and
./DAQtest 2 & in my terminal) they start eating up memory after a while. I
have not been able to recreate the problem with only one instance running,
but it never fails to appear with two or more instances running (I have
seven DAQ boards installed).

This is what I type in my terminal to see this problem :

for ((i=1;i<7;i++)) do
  ./DAQtest $i > Testlog$i &
done

for ((i=1;i<12000;i++)) do
  ps -C DAQtest -o pid,ppid,rss,vsize,pcpu,pmem,cmd | grep -v PID >> memlog
  usleep 1000000
done &

tail -f memlog | grep 1$

And I can now see that the memory used by './DAQtest 1' starts increasing
after about 100 seconds (sometimes more sometimes less).
I have pasted below what the last command shows. Memory usage
is in the third and fourth column, column five and six also shows something
though I am not sure how to interpret that. I cannot see anything wrong
with my code, though I could see that when I gave a very small buffer size
to cfgSampelClkTiming I could not recreate this behaviour. Hence I am guessing
that there is something wrong with the handling of this buffer in daqmx.
Does anybody know of this problem?

Thanks for any help!

Fredrik

Memory data :
...
  9708  2661 23356 101292  5.0  2.3 ./DAQtest 1
  9708  2661 23356 101292  5.0  2.3 ./DAQtest 1
  9708  2661 23356 101292  5.0  2.3 ./DAQtest 1
  9708  2661 23356 101292  5.0  2.3 ./DAQtest 1
  9708  2661 21168 99236  5.1  2.0 ./DAQtest 1
  9708  2661 21548 99640  5.1  2.1 ./DAQtest 1
  9708  2661 21912 100036  5.1  2.1 ./DAQtest 1
  9708  2661 22280 100300  5.1  2.2 ./DAQtest 1
  9708  2661 22644 100696  5.0  2.2 ./DAQtest 1
  9708  2661 23012 101096  5.0  2.2 ./DAQtest 1
  9708  2661 23380 101492  5.0  2.3 ./DAQtest 1
  9708  2661 23744 101880  5.0  2.3 ./DAQtest 1
  9708  2661 24112 102144  4.9  2.3 ./DAQtest 1
  9708  2661 24480 102540  4.9  2.4 ./DAQtest 1
  9708  2661 24848 102936  4.9  2.4 ./DAQtest 1
  9708  2661 25212 103340  4.8  2.4 ./DAQtest 1
  9708  2661 25584 103604  4.8  2.5 ./DAQtest 1
  9708  2661 25944 104000  4.8  2.5 ./DAQtest 1
  9708  2661 26316 104396  4.8  2.6 ./DAQtest 1
  9708  2661 26680 104804  4.8  2.6 ./DAQtest 1
  9708  2661 27048 105068  4.8  2.6 ./DAQtest 1
  9708  2661 27420 105464  4.8  2.7 ./DAQtest 1
  9708  2661 27784 105860  4.9  2.7 ./DAQtest 1
  9708  2661 28148 106264  4.9  2.7 ./DAQtest 1
  9708  2661 28520 106528  5.0  2.8 ./DAQtest 1
  9708  2661 28884 106924  5.0  2.8 ./DAQtest 1
  9708  2661 29256 107320  5.1  2.8 ./DAQtest 1
  9708  2661 29620 107728  5.2  2.9 ./DAQtest 1
  9708  2661 29984 107992  5.4  2.9 ./DAQtest 1
  9708  2661 30356 108388  5.4  3.0 ./DAQtest 1
  9708  2661 30720 108784  5.5  3.0 ./DAQtest 1
  9708  2661 31092 109188  5.6  3.0 ./DAQtest 1
... and so on until the computer hangs

0 Kudos
Message 1 of 2
(3,246 Views)
Don't stop to think about this question. It was a bug in my own code - I did not clear the task if an error occured which led to an error next time I access the device, which led to not clearing that task, which led to an error next time....
That ate up all the memory. As simple as that.

Best regards,
Fredrik
0 Kudos
Message 2 of 2
(3,195 Views)