LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Handling time changes when graphing existing data

My challenge is to graph existing temperature and event data from several files in one graph. On the surface, this is fairly easy. I've been able to use a XY graph to plot the data and add cursors where events occur. If only life were so simpe.

 

Our main (non-labview) system writes the CSV files using what we call an event sequence index. This is a sequential number that is the same in each file and ties the records together in case the user decides to change the time or date, which they do. Users are a pain like that. 🙂 So, I use it to tie everything together, build a bunch of arrays using the time tied to the event sequence number in what we condsider the main CSV file and graph the data. The problem is, the Labview XY graph seems entirely time based and I can't graph the data in a strip chart form, at least as far as I can figure out. If data is graphed that appears older than some, but really isn't, it is drawn to the left in date/time order. I haven't tried yet to see what happens if there is data for the same date and time. that should be fun.

 

I'm probably missing something simple, at least I hope. 

 

Any ideas would be appreciated!

0 Kudos
Message 1 of 24
(3,459 Views)

Hi Steve,

 

a XY graph plots data as you provide it. When a data point is to the left of another point then its X value is smaller (using a default X axis with bigger values to the right).

 

Maybe you need to check your data? Or even better: attach a VI with some meaningful default data inside!

Best regards,
GerdW


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

Thanks for responding. 

 

I'm graphing using the time stamp from the primary CSV file tied to the Event Sequence ID I'm using to tie everything together. This is my "X" value. The graph plots data based on time in this case and not by where it is in the array, at least the way I've managed it. 

 

I guess I could use my Event Sequence ID as my X value. That would solve the issue but create two new problems. The first is that the Event Sequence ID means nothing to a user, so I'd have to figure out a way to hide it and display the corresponding date/time label in it's place, which seems difficult. The other problem is that each data point is not linear. Most are 1 minute apart, but if events occur, they may only be a second or two apart. That may cause the graph to look a bit funky.

0 Kudos
Message 3 of 24
(3,443 Views)

It occurs to me that my words may to confusing. I have that effect some times. So, I've attached an example of my problem. In this example, I have an array of clusters that include a "time" stamp and the associated data for each. I've sequenced the first five"time" elements from 5 to 9. I then made the sixth element 1. This is the same issue I'm running into when I use a true time stamp. In this example, I need to somehow make the "1" time with the data at "8" appear to the right of the "9" time stamp.

0 Kudos
Message 4 of 24
(3,421 Views)

If you want to plot a single array of equally-spaced elements, use a Chart.  If you want to plot X,Y pairs, which plot as X,Y (so if X goes 5, 6, 7, 8, 1, it plots the last point to the left of the other four), use a Graph.  If you want to plot X,Y pairs as though they were equally spaced points, ignoring the X values, either plot the Y points as a Chart or replace the X points with 1, 2, 3, 4, ... .

 

Bob Schor

0 Kudos
Message 5 of 24
(3,410 Views)

I guess my suggestion would be to decide which of the plots is going to be your reference and use those timestamps for all plots.  The fact that the customer wants a unique number for each piece of data indicates that they expect the data to be taken at the same time.  Since no timestamp is exactly accurate, I don't consider this "fudging" data.  it is merely a method of aligning data.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 24
(3,406 Views)

Alternatively just use the reference number for your chart and just use the timestamps as references.  That would probably be the best way to go, actually.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 24
(3,400 Views)

Billko,

I agree. I could use the Event Sequence ID (reference as you called it) and the main problem is solved. I would just need to figure out how to make the timestamps visible to the user after that. I suppose I could use cursors for that. The problem then becomes the spacing of those cursors and what to do as the user zooms in and out. It also creates a problem with regard to the non-linear timing of my samples, but I think we can live with that.

 

Bob,

Thanks for the reply. I'm just having a hard time determining how I would chart it versus graphing it. I'm dense like that. I'll keep playing around.

 

Thanks all!

0 Kudos
Message 8 of 24
(3,394 Views)

Oops. I accidently marked it as solved. Duh...

0 Kudos
Message 9 of 24
(3,391 Views)

You can unmark it.  😞

 

😄

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 24
(3,388 Views)