LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Logging Elapsed Time

I have a program that monitors a pressure reading from a transducer.  The initial readings are logged at 10 second intervals until the pressure is increased by a set value and the logging interval increases to 100 points per second.  Currently, when I graph the data, the elapsed time on the x-axis is inaccurate because the computer doesn't know when the 10 second stopped and the 100 points per second began.  Is there a way to keep track of the time the points are being logged?  Some sort of method of having the elapsed time between points logged so this can be used to create the x-axis?
 
Thanks in Advance!!
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 1 of 8
(3,940 Views)

What do you mean by "the elapsed time on the x-axis is inaccurate?"  Are the points on the x-axis displaying incorrect values, or are thy just not evenly spaced? 

Also, what is the data type of the data you are collecting?  The waveform data type includes the value as well as the t(0) and the dt between points, and that might be the information you need.  Another possible way to collect the elapsed time (dt) between logged points is to place one Tick Count.vi outside of a while loop, and one inside.  Then subtract their value to get the elapsed time of the loop.  That time could them be written to a 2D array, one column containing the value read and one column with the elapsed time.

Your answers will help me find the best solution possible for your posting.

Thanks!

Todd S.
LabVIEW Community Manager
National Instruments
0 Kudos
Message 2 of 8
(3,915 Views)
I'm sorry I wasn't exactly clear on what I'm trying to accomplish.  I'm collecting temperature and pressure data simultaneously during a test.  The temperature data is collected at 10 second intervals, the pressure data is collected at 10 second intervals until an event occurs and the collection rate goes to 100 points per second.  The problem occurs when I try to plot both sets of data on the same graph.  As it is now the x axis for both sets of data is built from the number of points collected so the temperature plot reflects the time of the test accurately but the pressure test does not.  What I need is a way to collect time data so when I plot both sets of data the total test times match regardless of the rate at which the points were collected.
LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 3 of 8
(3,901 Views)
Hello,
 
It sounds like you'd like to have two plots on the same graph, but the x-axis scale and values are different for your two plots.  You can control how data is plotted to a waveform graph by bundling the array of data you are plotting with an x0 (initial value) and a delta-x (distance between samples).  The order for the bundle (into a cluster of course) should be, x0 value, delta-x value, y-array of data.
 
I have attached an example to illustrate this by allowing you to change the x0 and delta-x for two plots dynamically (the Generate Sine Pattern.vi is used as a subVI, where the other is the top level VI); I think this is exactly what you are looking for!
 
I hope this helps!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 8
(3,879 Views)

How on earth can I also log the time at which the data points were taken?this should be something simple.. I am new in Labview and I simply cannot find a way!!

I just want to measure 3 Temperatures , voltage, current and the time each data point for each channel was logged!

Sorry to post this here...I dont know were I can post it...any-any help would be very much appreciated!

0 Kudos
Message 5 of 8
(3,321 Views)

More information about your set-up might help with the solution.  Have you tried implementing a simple time stamp?

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 6 of 8
(3,310 Views)

hi! thnx for the reply!

each channel is logged at different logging rate. T is logged at 1 Hz. V, I logged at 10Hz. How can I create an excel (or a TDMS file) having a time column (time at which the data were taken) before the data column? eg: time||V||time||current||time||Temperature

 

0 Kudos
Message 7 of 8
(3,295 Views)

That is hard to answer without some insight to the architecture of your program.  Can you attach a snapshot or attach the program you are working with?

LabVIEW 2016 - Windows 7

CLAD
0 Kudos
Message 8 of 8
(3,289 Views)