LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting XY graph with two values and time

Hi,

 

I need to plot a graph for two values (Power and Temperature). The two values come from two different spreadsheet files and both have a time stamp of when they were recorded. One of the files records data every 1 minute and the other records every 30 minutes. I require a graph to correlate the power against temperature but also taking into account the time of both recordings. Any ideas?

 

The data is basically like  this;

Power             64,               64,                 65,                69

Time         00.30.00       01.00.00       01.30.00      02.00.00

 

Temperature      10,          13,            11,          10

Time                 00.01      00.02       00.03      00.04

 

Thanks

0 Kudos
Message 1 of 55
(3,393 Views)

 

It is not clear what is giving you problems and what the question is::

 

Reading the files?

Correlating the data?

Graphing the data?

 

Please show us your current code so we can better see where we need to fill in the blanks. Thanks.

 

0 Kudos
Message 2 of 55
(3,342 Views)

It's correlating and graphing the data in the way I explained. Two files which contain recorded data and both were recorded at different time interval gaps (1minute and 30minutes). I would like to correlate the two data types with each other taking into account the time at which each reading of both files were recorded.

 

I do not have any code for this yet, becuase I am still unsure on how to proceed. I will obviously have the two spreadsheet files read in, and then index arrays to take the columns I need. The problem is how to correlate these. Is it possible to plot the two data types against each other, but also including the time that each recording was taken?

 

The temperature file has more data values than the power, because it is recorded every minute.

0 Kudos
Message 3 of 55
(3,335 Views)

You can plot data points of Temperature vs Power, and use the color of the data points to show the evolution of these values over time.  The following code will Parse your two data files, find the correlated time points, and then assign the data point a color ranging from black (earliest time point) to dark green to light green (latest time point).  To get more color gradiation, you can use a rainbow or hot/cold color scheme instead of just 'greenness'.  You might need to change the code slightly so that it reads the time format of  your input file properly, depending on how you are recording it.

.

PlotPowervsTemp.png

0 Kudos
Message 4 of 55
(3,326 Views)

Thanks Ion_Cloud, could you post the vi of that code so I can take a closer look?

0 Kudos
Message 5 of 55
(3,323 Views)

Patel:

 

The image is a VI snippet, a special type of *.PNG file, that you can drag it into LABview as code.  I've attached the VI, regardless.

0 Kudos
Message 6 of 55
(3,314 Views)

@Patel33 wrote:

It's correlating and graphing the data in the way I explained. Two files which contain recorded data and both were recorded at different time interval gaps (1minute and 30minutes). I would like to correlate the two data types with each other taking into account the time at which each reading of both files were recorded.

 

I do not have any code for this yet, becuase I am still unsure on how to proceed. I will obviously have the two spreadsheet files read in, and then index arrays to take the columns I need. The problem is how to correlate these. Is it possible to plot the two data types against each other, but also including the time that each recording was taken?

 

The temperature file has more data values than the power, because it is recorded every minute.


You still have not explained what you mean by "correlate" Are you talking about some mathematical or statistical analysis or do you simply want to plot both graphs, either keeping only the points where both contain data (or interpolate the missing data for the sparser data)? I would do a linear interpolation. Can you attach at least two typical datafiles? This should be trivial to solve.

 

(Personally, I would not do it as suggested by others here. Searching an array for DBLs is way too dangerous!)

 

I would create a time ramp mathcing the more freqeunt data then iterploate the sparse data using the same ramp and plot them against each other.

0 Kudos
Message 7 of 55
(3,306 Views)

Yes, plotting them against each other to see the effect temperature causes to the power level at a certain time

Download All
0 Kudos
Message 8 of 55
(3,295 Views)

The radio data has three columns, the first two being some date/time format. What are the units of the second column?. The other file has two columns, the first is relative time in xx:yy format. What is the conversion between two two time formats?

 

Also, the weather data seem to start over several times. Does this need to be unwrapped?

0 Kudos
Message 9 of 55
(3,291 Views)

The second column of the radio data is the time in the format hr.min.sec, so the first time in the table is 00.05.29.

0 Kudos
Message 10 of 55
(3,281 Views)