07-22-2009 11:42 AM
Hi
See the attached VI. The DAQ acquires data without problems for a couple of minutes, and then suddenly the event structure won't do anything but timeout. I'm intentionally ignoring error -200279 which is generated when two triggers are too close to each other, because I just want to ignore those triggers, but perhaps that is also stopping the tasks at some point? I also tried starting and stopping the task again in the timeout event case, but that doesn't help (it causes an error). Is there a way to either prevent the DAQ board (I'm using the USB-6251) from stopping the data acquisition or a better way to ignore triggers that are too close together?
I hope I'm making some sense here 🙂
Thanks,
Jeremy
Solved! Go to Solution.
07-23-2009 04:05 PM
Jeremy,
I took a look at the program and overall your logic looks good for clearing the error associated with the trigger. However, I'm curious how your program can run for a few minutes since your time to run value is set to 10 seconds, and from the looks of things, stops the loop when it expires. Are you calling this VI from some other part of your program?
I don't think it's a problem with the DAQ card so much as you're stopping the loop. Also, I'm curious what your reasoning behind using an event structure is to see when your buffer is full, unless it takes a long time for the buffer to fill.
I guess the best course of action at this point would be to elaborate on what your program is supposed to be doing and why you made the choices you did in terms of logic. Then we might be able to suggest a more appropriate/working method of accomplishing the same thing.
Thanks, I look forward to hearing back from you.
07-23-2009 04:26 PM
Hi Chris,
The time to run value is 10 seconds by default, but when it stops after several minutes I had changed it to be 1000 or so, and the event structure would go to timeouts before the 1000 seconds was used up.
As for the event structure, I was using that because the time to fill up the buffer is so variable, between 0.04 ms to almost a second. Would the program still work without an event structure? I do need to keep them in blocks of 10 for future processing.
As for the overall program logic, I'm using a linear gate/stretcher to read in a square wave from the DAQ board's analog input. The digital trigger can sometimes come a few microseconds before the beginning of the analog waveform, so I'm acquiring 10 samples each time the trigger goes off so that I can properly get the amplitude of the square wave (the width is not important). I need to read in these square waves for an exact period of time (10 s by default, but it can be anything). I need the DAQ board to just ignore triggers that occur before the 10 samples have been acquired as a result of the previous trigger.
One more thing: I noticed that the acquisition seems to stop if the CPU reaches 99%, even if only for a second. Could that be causing the acquisition to stop? Or perhaps the same thing that causes the acquisition to stop also uses up all of the CPU resources. Is there a way to restart the task automatically after it stops?
Thanks so much for your help,
Jeremy
07-24-2009 11:06 AM
Jeremy,
Thanks for letting me know about the 99% cpu usage. This is definitely the cause of your crash and can be avoided by putting a wait funtion with maybe 10 milliseconds in your timing loop. However, if you'd like to maintain strict software timing with no blocking nodes, you'll need to re-structure your VI to use the Elapsed Time Express VI from the Timing palette. You can find examples of how to use this VI in the detailed help at the very bottom.
Hopefully this helps, have a great weekend!
07-24-2009 11:14 AM
Yes, that fixed it! Can't believe I didn't think of the timing loop thing.
Thanks,
Jeremy