10-14-2006 06:32 AM
10-16-2006 09:04 AM
A few quick thoughts:
1. With your board you will have to rely on software timing to produce your 12-bit DO patterns. Software timing isn't strictly reliable under Windows. The best approach available would be to use a Timed Loop structure which is automatically given a high execution priority.
2. It isn't clear to me what you expect to "count" with your counter task. With an external DAC, I would kinda expect you'd want to perform an analog measurement.
3. You don't need to stop and reinit tasks inside your loop. Config & Start them 1 time outside your loop, perform your Write / Reads inside the loop, then Stop & Clear it once after your loop.
4. Updating an XY graph every 10 msec in "real time" will probably not be the best plan. There's gonna be a conflict between your desire for precise 10 msec intervals and your desire to update a visible GUI object frequently. You'll end up needing to trade off their relative importance.
Hope this helps as a starting point. Note that a different piece of DAQ hardware (such as an M-series board capable of hw-timed digital output) could give you perfect timing intervals in hardware. The time required to architect and implement software that can still only approximate that precision isn't likely worth it, unless you're in a student-like situation where your time is deemed "free" by the powers-that-be.
-Kevin P.
10-18-2006 03:41 AM
@Kevin Price wrote:
A few quick thoughts:
1. With your board you will have to rely on software timing to produce your 12-bit DO patterns. Software timing isn't strictly reliable under Windows. The best approach available would be to use a Timed Loop structure which is automatically given a high execution priority.
2. It isn't clear to me what you expect to "count" with your counter task. With an external DAC, I would kinda expect you'd want to perform an analog measurement.
3. You don't need to stop and reinit tasks inside your loop. Config & Start them 1 time outside your loop, perform your Write / Reads inside the loop, then Stop & Clear it once after your loop.
4. Updating an XY graph every 10 msec in "real time" will probably not be the best plan. There's gonna be a conflict between your desire for precise 10 msec intervals and your desire to update a visible GUI object frequently. You'll end up needing to trade off their relative importance.
Hope this helps as a starting point. Note that a different piece of DAQ hardware (such as an M-series board capable of hw-timed digital output) could give you perfect timing intervals in hardware. The time required to architect and implement software that can still only approximate that precision isn't likely worth it, unless you're in a student-like situation where your time is deemed "free" by the powers-that-be.
-Kevin P.
10-18-2006 05:18 AM
10-18-2006 05:30 AM
10-18-2006 12:26 PM
I'm not near a LV PC now, so can't look at your example yet. Maybe I help a little in the meantime though.
If in a "normal" while loop, I couldn't get 10ms times, why can I get it in the timed loop? I know the timed loop has a higher execution priority but the question is: the loop is made in the time I want even if that implies that the code inside it it's not runed? Or in other words, labview ignores what's inside the loop to grant the execution time?
The timed loop suggestion needs to stay coupled with the producer/consumer suggestion where you have 2 (or more) parallel loops. If you only have a single loop, I'm not sure that making it a timed loop would matter much. The idea is that data acq is done in a high priority timed loop that should do quite well at waking up and executing 1 time every 10 msec. A regular OS like Windows won't be 100% reliable at this, but a timed loop will probably be more regular more often than a standard while loop with delay.
Your other question is very important and the answer is that all the code in the loop WILL execute. Even if you have too much code and it requires more than 10 msec to finish. There are different settings to tell the timed loop when to start the next (late) iteration, depending on the needs of your app.
Another thing is: I want the first frame to be executed without delays, I mean, for the first frame I don't need time precision, I want do do it as quickly as it is possible and then for the second frame to make it in 10ms.
It's possible to wire in values to the outside timing terminals of a timed loop to define an initial delay of 0, and then wire a value to the right-hand-side timing terminal inside the loop to change it to the normal 10 msec thereafter.
Just another thing: How can I be sure that the times are fully acomplished?
Timed loops provide left-hand-side terminals you can use to verify your timing.
-- Oops, on review, I realize I was mentally merging this thread with another one I got involved in. So as to the stuff above about producer / consumer? Well, here's that other thread. I would recommend the same for you, so you can separate the parts of the code that need to run as regularly as possible (data acq) from those that aren't so critical (GUI graph updates).
-Kevin P.