01-31-2015 06:19 AM - edited 01-31-2015 06:22 AM
I would like to ask for advice for how to handle the best way the following scenario:
I frequently update an XY graph, with 12 curves. I have created a ActionEngine subVI which acts as a buffer (add points, read data out) for the graph, and has some other actions, like empty the buffer, decimating the data points, etc. So at 1 Hz rate I send the 12 curves data to this XYGraph, and it redraws itself, all is OK.
There are 12 ongoing DAQ tasks, with 1 Hz rate, I want to show the user how the curves are evolving. It is also important to have a vertical cursor line so the user can examine the values at different time stamps (X -values are absolute time stamps). All is working nice, except that, when I turn off the X-autoscale, so the user can only see lets say the last 1 hour of data points (3600 points X 12 curves, I know I should decimate usually, but LabView usually handles quite OK the situation when you have more points then pixels...at least I can live with this).
So the problem: if X autoscale is off, and I send the new datasets to the Graph at every second, the Graph does not show the new points at the right side, like in the case of a chart. How shell I make the Graph handle this situation? Shell I set the "max" (X-scale - Range - Maximum property) of the x-scale via property nodes at every second? Is this OK to do? Any other idea?
A kind of workaround could be to use the XY-Graph AND a Chart. The user could inspect lets say the latest 1 hour of data with the chart (or by turning off autoscale, the last few minutes if needed), and the XY-Graph would work as an overview, the user could update it manually by a button, and after that playing with the zoom functions, etc...
What do you think? How do you handle such a DAQ application? So the user needs to see whats happening recently with the curves (pressures, flows, temperatures), but also be able to inspect the evolution of the curves of the last 24 hours...
edit: hmm, usually I get new ideas after writing down my problem 😄 I think I try to attack the problem from the wrong side: instead of fighting with the Graph properties, I could just create a "Set Range" action in my buffer subVI, so when the user want to see lets say only the last 10 minutes of data, I only send these data points from the subVI to the Graph... hmm I think this would be a nicer solution... what do you think?
Solved! Go to Solution.
01-31-2015 08:21 AM
You could try using sweep mode to update your chart.
01-31-2015 08:23 AM
01-31-2015 08:51 AM
Ah, missed that. I mean, you could replicate the functionality fairly easily using an xy graph I think. Initialize an array, use a 2nd locked cursor for the sweep position, and replace array subset with each new update. Could even be part of your action engine
01-31-2015 09:14 AM
You mean, I add second locked cursor (could be invisible by its colour), and update its location at every update to the last time stamp? Why is this better compared to setting the max of the X-range property?
01-31-2015 09:26 AM
It was just an idea! My thought was that way you could real time update the data, while having old data stationary for your users to view, zoom in on, etc.
01-31-2015 09:29 AM
hmm, I see! I will think about it, and test different scenarios to see what is more handy for the users...
01-31-2015 10:36 AM
Here are some options. You can consider them based on your actual application:
02-04-2015 01:03 AM
Hello,
Thanks for the useful hints! I just decided for now, I try to go with the built in functions (zoom, autoscale on/off, etc.) of the XY Graph, and I proceed the following way:
I keep a maximum amount of data of 24 hours (24 * 3600 * 12 sensors of data points) in an Action Engine SRs. The user can set how many minutes/hours he/she desires to see of the newest part of the data. Usually the operator only needs to see an about 10 minute large time window for monitoring purpose, so it is good, I use less points (600) compared to how many pixels I have horizontally in this XYGraph.
If the user wants to see larger amount of data (maximum 24 hours), I feed the data into the Graph, stop updating the Graph, and the user can zoom in/out, and pull a cursor to examine data at the different time stamps.
So I think for this particular application this approach should be OK...
I was searching the forum for some Graph related info, and I read interesting suggestions to improve performance in case of large data display. Like this one:
See the last two posts from Darin.K and Ben.
Regarding to this I have some questions:
Thanks!
02-04-2015 10:34 AM
Blokk wrote:
Regarding to this I have some questions:
- Also, if I feed SGL precision data into my XYGraph, I should get better performance, is that correct?
- Plot styles: hmm, what can impact the Graph drawing speed, like the antialiasing I guess, is that correct?
- I wonder if I should set the "skip when tabbing" property node ON for the Graph when a larger data is loaded into (I have a TAB control, and the Graph is in the second page)? So if the user wants to check some indicators on the first page, and "TABs" away, the Graph will not slow down the application.