LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waveform chart doesn't show time(dt) correctly

Hello here,

 

Excuse my broken English

I was using a producer/consumer pattern to take data. When I made the producer loop to wait for about 1s to get a roughly 1s/s "sampling rate"(it's not the same rate on sample clock, but rather the rate you get DC/RMS data in file), dt on the waveform chart was about 0.05s instead of 1s, while the data saved in file was all right. Does anyone have some ideas why this happened?

 

Thanks!

 

Yaqiong

0 Kudos
Message 1 of 4
(2,342 Views)

Good morning. It looks to me that your sampling sate is set to 20000 divided by the number of channels. This gives a dt of 50ns for a single channel. You take 1000 such samples and calculate the DC and RMS value, which is plotted to the graph periodically. The dt of the waveform returned by the DC/RMS analysis VI is the period covered by the analog read. In your case, this is 20000/1000=.05s. To get the result you want, you may want to use an x,y graph, plotting the current time on the x axis vs the DC value of the your signal on the y axis. You can keep track of the current time in your produced or consumer loop using a ms timer or "get date time in seconds".

_____________
Creator of the BundleMagic plugin for LabVIEW!
Message 2 of 4
(2,327 Views)

Thank you for the help!

Did you mean that the waveform chart will append the waveforms from two loops together and automatically take out the time? And there's no way that I can let the chart just show the correct time carried with waveform data by changing the property of the chart?

 

0 Kudos
Message 3 of 4
(2,283 Views)

Hi Yaqiong,

 

I don't know if I grasp your questions completely.  I think littlesphaeroid's explination of why you are getting .05 to be your dt was correct and here is where it is defined:

 

Time Execution.png

 

With X being your 20000.

 

Are you meaning that you want to take the exact time the sample was taken and plot it on the X-axis?  Because if you want every sample to reflect the current time with respective dt I would use littlesphaeroid's method of a ms timer or "get date time in seconds."

Peter T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(2,258 Views)