Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx read measuring slowly

Solved!
Go to solution

@Kevin_Price wrote:

Couldn't resist trying it out.  Turns out "DAQmx Wait Until Done.vi" with a 0 timeout seems to run with the exact same slowness as querying the Task Done? property node.  I kept getting only 60-some loops/sec.

 

-Kevin P


I guess we now know what is under that p-nodeSmiley Wink


"Should be" isn't "Is" -Jay
0 Kudos
Message 11 of 16
(2,005 Views)

It was that prperty node.. I got rid of it and am now getting 35000 loops per second, which is more than enough.  To exit the while loop, I wired the boolean that checks whether or not the sum of the read voltages is less than the set voltage.  As soon as the read voltages is greater than the set voltage, I get a false, then negate that and the loop exits.

 

I also added the elapsed time express VI as a fail-safe, in case the above condition never occurs.

 

Thank you both and I'll mark Kevin's post as the solution!

0 Kudos
Message 12 of 16
(1,987 Views)

That MIGHT work fine however, I might suggest a small modification that should be a bit more responive and scaleable than a timeout via elapsed timer.

 

Capture1.PNG

That's right, wait until done parallel to the loop with your timeout repurposed to the tmo of the wait until done.  We really don't care why the wait til done finised so clear any errors and write new boolean Indicator "Stop" to True.  Read Stop as a exit condition for the acquisition loop and of course, reset the value of Stop to false in case you do not clear indicators when called.


"Should be" isn't "Is" -Jay
Message 13 of 16
(1,984 Views)

I do like that better.  Do I need to add the 'to elapsed time' as the timeout though?  The task you wired the stop condition to is set up to have a specific rate and number of samples.  And in fact, I want to stop reading when that task is done.  So I could do exactly what you have set up, but just do not wire the timeout?

0 Kudos
Message 14 of 16
(1,976 Views)

@grabillkid wrote:

I do like that better.  Do I need to add the 'to elapsed time' as the timeout though?  The task you wired the stop condition to is set up to have a specific rate and number of samples.  And in fact, I want to stop reading when that task is done.  So I could do exactly what you have set up, but just do not wire the timeout?


The 'to elapsed time' was left in solely to preserve the timeout feature of your unmodified code.  The only reason to leave it in there is to prevent needing to hit "Abort" if some future developer thinks that it would be a good idea to allow regeneration in the output Task (potentially causing an infinite loop.)   IMHO, rip it out and leave a comment on the Task Configuration BD attached to the Task Config constant!  If the next developer is too [insert deragatory term here] to heed the warning and causes an infinite loop anyway - well, that person will learn something that day. Smiley Very Happy


"Should be" isn't "Is" -Jay
0 Kudos
Message 15 of 16
(1,974 Views)

Haha. Ok that's what I thought.  Thanks!

0 Kudos
Message 16 of 16
(1,969 Views)