09-02-2014 07:51 AM - edited 09-02-2014 08:02 AM
Hello
I'm having a problem with DAQmx clear (and DAQmx stop as well) - it hangs. I've encountered this issue during converting complicated application form one PXI to another. I don't want to put all the code here, but I reproduced this error in the attached sample code.
When data aqusition (timed loop controled from hardware) finishes, the task should be cleared - but PXI (in LabView RT mode) stops responding (cant even abort the execution with the "red button" in LabView). The only way to regain control is to reset PXI. The PXI system is PXIe-8133 controller with PXIe-6368 DAQ card (and some oher cards as well, but not used in this application). LabView version 2011, DAQmx version 9.4.0.
I tried to stop the task before clearing it - but then it hangs at Stop task vi. I tried to add Wait until done - but it just times out. Simmilar code works OK in LV 2009 on PXI 8106 controller with PXI 6221 card.
I've read this thread: http://forums.ni.com/t5/LabVIEW/daqmx-close-task-freezes/m-p/2638469#M788300 with quite simmilar problem. It was solved by upgrading DAQmx, however i'm not sure if I can do it - the hardware does not belong to me and I don't know if the owner will let me change any software on PXI. So I'll be glad to hear any other ideas to solve the problem in any way?
09-03-2014 09:38 AM
Hey,
Since you cannot update DAQmx you can try to test some workarounds. The first thing will be to create both channels at the same time with one vi (see the modified vi attached). Another solution that solved this problem for other users was decreasing the Sample Rate, so maybe you could try and test i with different values and see if the behavior changes.
Please let me know if this helped or if anything changes and we will continue from there.
Have a nice day,
Andreea
09-03-2014 11:17 AM
Your Task is in the verified state prior to entering the timed loop. try adding a "DAQmx Control task.vi" with a "reserved" state just prior to the loop.
And remove those breakpoints--- I almost wonder if you are at the breakpoint and not actually "Hung" (Sometimes though, you have to ask the silly questions)
09-03-2014 11:24 AM - edited 09-03-2014 11:29 AM
Breakpoints were there to find where exactly the whole program hangs and to see what errors massages (if any) are sent from DAQmx vis. I swear they are not the cause of the problem 🙂
Reducing sample rate doesn't help either (tried with 1kHz).
I'll try to check proposed solutions tomorrow.
I also switched to "Continous samples" and then all works fine. It only hangs when "Hardware timed,..." is selected.
09-04-2014 01:55 AM - edited 09-04-2014 01:56 AM
So... here goes the update:
- Dei159 - I cant open your VI (too new LV version) but I just removed 1 chanel - it didn't help
- reduced sample rate down to 100Hz - hangs
- added Control Task and set "reserve" - hangs
- removed breakpoint 🙂 - hangs
09-04-2014 02:49 AM
Hey again,
I think the problem is related to the Hardware-Timed Sampling Mode. For this sampling mode, the samples are acquired/generated without a buffer and this is done at relatively fast rates. First of all I recommend you to take a look at this: http://www.ni.com/white-paper/3215/en/#toc10. There is also a sample code what you can try out.
However, I think I’ve found a solution for you and that is changing the wait mode for reading. The problem is that for counters using the hardware-timed single-point sample mode, the default read mode is Wait for Interrupts. At fast rates the driver receives so many interrupts the CPU cannot keep up and the computer appears to hang. So you have to use a Read Node and set the Wait property to either Poll or Yield . (http://digital.ni.com/public.nsf/allkb/EDA7DD4E22CF2A1886256E9A0063E98D?OpenDocument)
Please let me know if this helped clearing the hang.
Andreea