LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait(ms) becomes highly erratic...!?

Scott,

This advice probably won't solve your problem, but I'd like to offer a suggestion. When you mention a 3.5 second data acq freezeup, I assume you're using traditional NI-DAQ to perform a buffered read requesting a bunch of data, and it takes 3.5 seconds for that much new data to accumulate in the read buffer. I'd suggest trying to avoid this freezeup.

1. Thought 1: try DAQmx for the data acq. It's multi-threaded and will yield CPU as needed.

2. Thought 2: Those data acq freezeups used to cause me grief. So I made it a habit never to request data that the daq driver needs to wait for. I would instead query the # of available points in a loop including a short Wait (msec) delay. I wouldn't ask to read N points until seeing that at least N were available. This way the DAQ call doesn't cause a freezeup.
One way to query the # of available points in traditional NI-DAQ is to call 'AI Read' while requesting 0 samples. This will return immediately with no data, but another of its outputs tells how many samples are backlogged.

Good luck with the real problem too!

-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 11 of 13
(672 Views)
Scott,

In your screenshot, the Wait ms.vi is in the same sequence with your pump valve control but has no data flow dependancy with them. So the Wait ms may be occuring in parallel with the pump control and can explain the timing variations. Consider changing the screenshot shown to use 5 frames in the sequence. In Frame 1, open the dump valve. In frame 2 wait 20 seconds, frame 3 close dump valve, frame 4 wait 5 seconds and in frame 5 talk to the scale.

Regards,
Aaron

Message Edited by Aaron G on 04-29-2005 12:52 PM

LabVIEW Champion, CLA, CPI
Message 12 of 13
(667 Views)
Aaron,

Thanks for that suggestion. I'm an old BASIC programmer and it is still hard for me to get used to Labview's data flow execution....but I like it.

To everybody else who responded:

Thanks a lot for all the suggestions. The state machine idea, redoing my data acq., etc. etc. are all sound suggestions which will probably make this little problem go away and never show up again.
Scott Little
1406 Old Wagon Road
Austin TX 78746
little@earthtech.org
0 Kudos
Message 13 of 13
(652 Views)