08-22-2013 10:45 AM
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
08-22-2013 12:57 PM
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".
08-28-2013 10:22 AM
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?
08-29-2013 07:35 PM
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:
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."