11-14-2014 03:28 PM
Is it bad to do a DAQ RESET every time a portion of your code is called? I do a bunch of testing generating signals then reading them back w a DAQ Card (PXI6230). Before I enter a DOWHILE Loop I do a DAQ RESET. I wanted the DAQ to be in a known state before testing began.
Windows 7
LV2012
11-15-2014 04:20 PM
I would imagine that, unless you were repeating the loop incredibly frequently, it would be a good way to go. As long as it's not inside the loop and repeating with every iteration, no problem, I'd say. Much better that than having some spurious data in a buffer that you hadn't expected.
11-15-2014 06:14 PM
11-17-2014 06:28 AM
I clear and release the task w each iteration inside the do/while loop. Take 1000 samples @ 1000 samples/sec. inside that iteration. I do a DAQ reset outside the do/while. You guys said the exact reason why I was doing it. To have the DAQ in a known state when I started the iteration. The reason I asked was I generate a square on say CH1 then read it back on say CH2 of the daq. This is done as simutaneously as possible in a (write/read) vi I wrote. I have itermittent failures on the second time i run the (write read) vi and was concerned the reset was doing something I didn't expect. Time to get a scope out..
Thanks for the help.
11-17-2014 07:29 AM
You shouldn't need to clear your task with each iteration. You should be able to setup the task before your loop and then clear it after your loop. This will make things a little easier on the DAQ card.