From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Restarting a DAQ Task Inside a For Loop

Solved!
Go to solution

Hello,

 

I need to iterate my data acquisition. Currently, I am doing this by creating, implementing, and clearing DAQ tasks inside a For Loop that is iterated as necessary. Unfortunately, the creation of these DAQ tasks significantly slows down my code.

 

I would like to be able to create the tasks outside the loop, pass them in, and restart the tasks at the beginning of every iteration. Is there an easy way to do this?

 

Alternatively, is there a way to make the standard DAQmx Digital Start Trigger trigger multiple times (so that it starts data acquisition at every pulse in a long pulse train as opposed to just the first pulse)?

 

Thanks!

 

- Evan

0 Kudos
Message 1 of 6
(3,418 Views)

Can you share your code, or at least the relevant portion of your code?  How are you configuring the DAQ task?  Is there some reason you can't just restart the existing task, instead of destroying the task and recreating it?

0 Kudos
Message 2 of 6
(3,416 Views)
Solution
Accepted by topic author ERM19

I whent ahead and created this example for you (And many others.)

daq.png


"Should be" isn't "Is" -Jay
Message 3 of 6
(3,412 Views)

Awesome! 

 

I'll give this a shot tomorrow and post my code if it doesn't work.

 

Thanks for the quick responses!

 

- Evan

0 Kudos
Message 4 of 6
(3,404 Views)

@ERM19 wrote:

Awesome! 

 

I'll give this a shot tomorrow and post my code if it doesn't work.

 

Thanks for the quick responses!

 

- Evan


I don't think you will post your code... 🙂

 

-----

The best solution is the one you find it by yourself
Message 5 of 6
(3,401 Views)

Worked like a charm 🙂

 

Thanks again!

Message 6 of 6
(3,385 Views)