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,428 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,426 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,422 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,414 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,411 Views)

Worked like a charm 🙂

 

Thanks again!

Message 6 of 6
(3,395 Views)