LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a while loop with analog acquisition in pause trigger mode ??

Hello

I'm using Labview to perform analog acquisition, with a pause trigger, ie it acquires only when a signal is High (for example) and doesn't in the other case.

But when it is in pause mode, it seems impossible to stop the loop: the task is continuously waiting for the trigger.
What's going wrong ?

Any idea ?
NB: yep, i'm quite new in Labview...

Sébastien Petit
0 Kudos
Message 1 of 4
(2,902 Views)

Bonjour Sébastien,

 

This depends on the technique you use to make your analog acquisition.

Most of the time, there is a timeout possibility, put it to,  say 100ms, and when it is getting out for a time out reason, check the while loop stop button condition.

 

Hope this helps

It would be nice if you take the time to rate this answer
http://www.machinevision.ch
0 Kudos
Message 2 of 4
(2,897 Views)

ptitseb,

It sounds to me like you should perhaps poll your abort condition in a seperate loop.  If you hit your abort condition, then call the DAQmx Control Task VI, and use abort.  This will cause the currenly running task to be aborting, which will stop the read with an error, which you should be able to trap.  I've attached a brief example.

Hope this helps,
Dan

0 Kudos
Message 3 of 4
(2,893 Views)
Thank you mCDan, I think you've got it for me: i'll try this straight away.

Thank you also Doc : the timeout is also a good solution but doesnt correspond to the application (it will also abort when i don't want to !)

Bets regards,
Sébastien Petit
0 Kudos
Message 4 of 4
(2,890 Views)