LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to graph two signals taken at different times on same graph?

Solved!
Go to solution

Hello, 

 

I am trying to graph 2 different tdm files on one graph. The files look like

 

Time Sensor 1 Sensor 2 Difference Sensor 3
07/03/2013 08:26:30.214 AM -0.001 0 0.001 3.2109957
07/03/2013 08:26:31.489 AM -0.001 -0.226 0.225 3.251679525
07/03/2013 08:26:32.249 AM -0.149 -0.198 0.049 3.1567506
07/03/2013 08:26:33.192 AM -0.135 -0.248 0.113 3.315462225
07/03/2013 08:26:34.336 AM -0.135 0.17 0.305 3.2682213

 

I need to graph two signals (time vs Sensor 3 data from two different files). The signal recording rate changes per file and within each file, so I need to preserve the time interval between each reading, but need the two waveforms to graph on top of each other regardless of what day/time each file was recorded at. Please see attached for an example. 

 

I can read the data in from the file and graph multiple waveforms (generic generated sine waves) on the same graph, the part I am stuck on is how to get the time/x-axis to work properly. 

 

Thank you

0 Kudos
Message 1 of 5
(2,506 Views)

Hi Ark,

 

as you have shown in your picture: get rid of absolute timestamps and calc the "delta t", i.e. set all waveforms to use the same time origin...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,502 Views)

Hi GerdW, 

 

Is there a setting for using the same time origin? Do I need to manually calculate the delta t's?

 

Thanks for the fast reply!

 

0 Kudos
Message 3 of 5
(2,499 Views)

Hi Ark,

 

there's a full palette with functions to manipulate waveforms. You have to set a new start time t0 for your waveforms...

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,469 Views)
Solution
Accepted by ARK92

Two options:

 

i) Use relative time instead of absolute time. If dt's are not constant, you cannot use waveforms. Use an XY Graph, and subtract the first timestamp from each timestamp in the file/data set. I.e. your start time will be zero (or 1904 if you will).

 

ii) Plot both data sets in an XY Graph, using two x scales. Right-click the x-scale and select 'Duplicate Scale' (or something close to it), then go to 'Settings' -> 'Scales' and edit the new scale. Now go to the 'Plots' tab (still in 'Settings') and configure your two plots to use separate x-scales. 

Best regards,

Jarle Ekanger, MSc, PhD, CLD
Flow Design Bureau AS

- "The resistance of wires in LabVIEW is not dependent on their length."
0 Kudos
Message 5 of 5
(2,464 Views)