LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ Read and Write Synchronization

Solved!
Go to solution

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. 

 

0 Kudos
Message 1 of 4
(3,456 Views)

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

0 Kudos
Message 2 of 4
(3,420 Views)
0 Kudos
Message 3 of 4
(3,391 Views)
Solution
Accepted by topic author az123

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.  

0 Kudos
Message 4 of 4
(3,382 Views)