LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

stop acquisition in finished mode

Solved!
Go to solution

Good morning ,

I do data acquisition in my interface I can choose between finished or continuous acquisition mode, I want to add a functionality to stop the acquisition even in finished mode. zst there is a way to force the task to stop?

0 Kudos
Message 1 of 3
(276 Views)
Solution
Accepted by ameletudiante99

Sure, but the way you set up your code is not the way to do it.

 

Problems:

1. You call DAQmx Read without wiring the input to specify the # samples to read.  In Finite acquisition mode, this defaults to meaning, "wait for *all* configured samples to be acquired, then return them".   By the time you get out of the DAQmx Read call, your finite task will already be done!

 

2. Dataflow.  You want to conditionally stop the task depending on the state of a GUI boolean.  However, by the rules of dataflow, the value of that boolean is likely being read immediately when you start the vi, even before the task is fully configured and started.  Anything you do to that GUI boolean after that time will *not* affect the value wired into the case structure.

 

If you simply want to abandon the task and don't care about partial data, don't call DAQmx Read until *after* you're done deciding to let the task run to completion.

    If you want partial data up until the point you stop the task, you can query the task with a DAQmx Read property node for "Available Samples", call DAQmx Read while requesting that same #, and *THEN* stop the task.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
Message 2 of 3
(245 Views)

Hi ,

Thank you

0 Kudos
Message 3 of 3
(183 Views)