09-23-2016 12:30 PM
I would like to continuously acquire data (AI) and occasionally write data (AO).
Currently, I have one subvi that continously reads at 125 kHz. The data is passed to a queue. Another subvi accepts a user input and outputs a voltage that affects the reading. I plot both the reading and the command voltage on a graph. I notice that over time, the input and output lose alignment. Initially, it is +/- 10 ms and then shifts to 100+ ms--as in the command voltage precedes the expected reading by 100 ms. I pass the command voltage to the acquisition subvi via a global variable and insert it into an array with the readout.
I'm quite sure this isn't the way to do it, but I can't seem to see how triggering can help me here, since the reading must be continuous. I just need to align the output with the input on my plot.
Solved! Go to Solution.
09-23-2016 04:02 PM
You need to post the code (attach one or more VIs -- if >3, compress the folder they are in and attach the .zip file).
Bob Schor
09-24-2016
03:39 AM
- last edited on
12-19-2024
09:28 PM
by
Content Cleaner
09-24-2016 08:42 AM
I have solved the task:
I put a "get date/time" VI in a case structure with DAQ write. I then used the build waveform function and wired a single value array (the AO value) with the timestamp (to). Then instead of using a waveform chart, I used an X-Y graph and plotted this waveform as well as the analog input waveform (combined in an array). Thus, if I send a voltage pulse at time t=100 ms, I see a rise at t=100 +/-1 ms. Earlier, I would see the rise at t=100 + dt ms (dt~10 to 100), because the data was being pulled from the buffer too slowly.
Since I am acquiring data continously, regardless of the output, triggering is not really useful here.