10-14-2016 05:46 AM - edited 10-14-2016 05:47 AM
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!
10-14-2016 05:58 AM
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!
10-14-2016 06:22 AM - edited 10-14-2016 06:23 AM
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.
10-14-2016 07:35 AM - edited 10-14-2016 07:52 AM
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.
10-14-2016 07:58 AM
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
10-14-2016 08:13 AM - edited 10-14-2016 08:15 AM
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.
10-14-2016 08:17 AM
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.
10-14-2016 08:30 AM - edited 10-14-2016 08:33 AM
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!
10-14-2016 08:35 AM
Oops. I accidently marked it as solved. Duh...
10-14-2016 08:36 AM
You can unmark it. 😞
😄