LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Faster way to write waveform data to file

Solved!
Go to solution
I suppose I could consolidate the 500ms loop into the main loop, the separation merely stems from me working on this piece by piece for the past week and was from past code.

I am going to add to the LED loop later. The reason I haven't added it so far, is because I need one of the digital outputs to be on for as long as the acquisition (eg for 500ms) But may want the LED (the second digital output) to stay on for more than that (say 2000ms or 250ms) in which case I didn't see how that was possible within one while loop.
0 Kudos
Message 11 of 14
(937 Views)

There are several ways to have multiple timing options in one loop. Set the loop delay (Wait) to a value which is a common factor to all the other delays, such as 25 or 10 ms. For each separate timing have a shift register holding the time at which the next task should occur. If current time >= set time, then perform the task and reset the timer.

 

This can also be done in a state machine.  It is a little more work to set up, but more versatile and expandable in the long run.

 

Lynn

0 Kudos
Message 12 of 14
(932 Views)
Solution
Accepted by egyptiandude

Couple of other things:

 

  Don't run wires behind structures.

  The Timed Loop isn't doing what you think it's doing. Set up the sample rate and number of sample correctly, and the acquisition loop will run mostly as you expect.

 

This is by no means enough to get you what you need, but it might be a little useful:

 

neuron_monitor_Express_8_20_13_fixing timing_BD.png

0 Kudos
Message 13 of 14
(931 Views)

Thank you all very much for the help. I now have a functioning VI. I need to make some adjustments to it (brute forced the LED wiring just to get it working... lots of overhead). However, it does everything I need it to and is fully functional. I've attached the final VI. Thanks again!

0 Kudos
Message 14 of 14
(874 Views)