06-05-2014 06:03 PM
Travis,
From the top of the diagram down:
Having the two Waits in parallel does not really accomplish anything. Choose the one you want.
Your digital pulse width is set primarily by the time it takes to write a one point waveform to the file N times. As the file grows the pulse width will probably become more variable. The zero Wait inside the for loop is not needed. Zero Waits are useful for loops which run parallel to other code and have no other waiting function. The DAQmx Read is effectively a wait, although it will not need to wait very long for one sample.
Depending on the trigger delay in the external function generator, you could possibly get one or more samples before the generator actually starts.
To get multiple points I suggest using hardware timed analog input. If you set the sample rate to 1000 samples per second and read 20 samples, you will get 20 samples in 20 ms. You can use a digital trigger for analog input with the USB-6009. Trigger the analog acquisition and the function generator from the same digital pulse. Then you do not need the for loop
Move the Write to file outside the for loop (if you have not eliminated it as suggested above). Write to the file during the time between pulses. If there is not enough time, change to a Producer/Consumer architecture with the DAQ Read in the Producer loop and the file write in the Consumer loop. I do not recall the details in LV 2010 but I think there is a Template in File >> New.. >> VI >> From Template ... (or something similar).
Lynn
06-05-2014 06:06 PM
Travis,
Another thought: Run a continuous acquisition and record both the analog signal and the digital trigger on two (analog in) channels. Then sort the data later in software. We did this back in LV 1.2 before any kind of triggering was available.
Lynn
06-06-2014 10:47 AM
LabVIEW 1.2? This stuff must really be old hat for you, Lynn.
It seems hardware timing is the way to go. I have a pretty nice oscilloscope at my disposal that I'll be using to acquire the data. I think I will explore Producer/Consumer data sharing, however. Thanks again for the suggestion. I'll be a LV expert yet.
Travis
06-06-2014 01:37 PM
Travis,
I have been using LV for a while. But simply doing something for a long time does not necessarily make you an expert. Learning from your mistakes, learning from experts, taking courses, and participating in Forums like this one can all help you get better at it.
Lynn