LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get timestamp of DAQmx Read data

Solved!
Go to solution

Hello,

 

I have to read 4 Analog channels using DAQmx AI Read in LabVIEW 2012. I am using DAQmx VIs.

Rate of acquistion is 4000 samples per second and Number of samples  per channel is 200.

I am using only one DAQmx task to read data. I get 4 arrays of data for 4 channels each array length is 200, each time, DAQmx Read happens.

But I want to get the timestamp of these 200 samples per channel. How to get the timestamp of these samples, let me know.

 

Thanks

0 Kudos
Message 1 of 8
(6,021 Views)
Solution
Accepted by topic author Hemagopal
You haven't shown your code. If you choose to read waveform data, the cluster includes t0 and the dt. That's all the information you need.
0 Kudos
Message 2 of 8
(6,010 Views)

That depends on your DAQmx Device.  What device do you have?  How often are you "Reading" the samples - Is it less than 20 times per second? Do you also get buffer overflow errors?  What is the OS you are controlling the device from? Is it deterministic?

 

What instance of DAQmx Read.vi are you using?  Does the device have a real-time clock?  Why would you expect the device can output an array with a timestamp?  Are you getting an array of waveforms from the device? What is the value of T0?


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 8
(6,001 Views)

Hello ,

 

Thanks for letting me know the t0, dt data . I use this for X scale. 

 

But now everytime I set X0, dt and plot data on my mixed signal graph, the graph flickers.

How to avoid this flickering.

That is I am adjusting t0 value dynamically. Data coming on the graph is OK. But the graph flickers.

 

Let me know how to avoid this. Thanks

0 Kudos
Message 4 of 8
(5,956 Views)
I have no idea what you mean. Why used a mixed signal graph? Why would you be setting x0 and dt? Those come from DAQmx.
0 Kudos
Message 5 of 8
(5,946 Views)

Hello,

 

I am plotting 3 different plots on to 3 separate areas of a single mixed signal graph.

 

For the first 15 seconds of graph plot, t0 is fixed as current time on graph, dt comes from plot data.

 

After 15 seconds are over, I want the t0 to be previous t0 + (no. of samples * dt).

The new plot data will come in the end and the old data gets removed from top.

Accordingly the start time of the graph has to be adjusted.

 

I am able to do this now. But I was seeing flickeing due to fast  loop update rate of graph.

 

I made the graph plot to be made every 1 second . Now, I do not see flickering.

 

But I have empty timestamp at the start of the graph as shown in attached picture. Now how to remove this. 

I have done build cluster correctly. First start time, dt and plot data gets bundled and given to mixed signal graph. Plot starts from second division timestamp on graph. Picture attached.  Thanks

0 Kudos
Message 6 of 8
(5,917 Views)
Have you turned off Loose Fit?
0 Kudos
Message 7 of 8
(5,898 Views)

I turned off loose fit. It works. Thank you

0 Kudos
Message 8 of 8
(5,769 Views)