Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding iteration functionality

Hello,

 

I would like to add the availability of how many iterations the vi runs, which will allow the user to increment values of voltage (automatically) output by the myDAQ. When I change the while loop to a for a loop the timing of the vi is compromised. Is there a way to keep the same functionality as the vi below will show using a for loop?

 

Cheers.

 

0 Kudos
Message 1 of 2
(3,411 Views)

Seral1994 wrote:  When I change the while loop to a for a loop the timing of the vi is compromised.

Then you did something wrong.  Simply changing the While loop into a FOR loop should have no affect on the loop rate.

 

I think I typed too soon.  I think this is what you are after.  The While loop will iterate until the time elapsed or you press the stop button.  The output of the DAQ only updates after the time has elapsed.  This setup also allows to abort the FOR loop if you need to.

Of course, you should have some kind of wait inside of the While loop otherwise this will use 100% CPU.  Alternatively, you could use an Event Structure instead of the While loop.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 2
(3,406 Views)