01-11-2024 04:32 PM
Hallo !
Has anyone an idea about the following:
I want to use a waveform CHART (as opposed to graph) because I like the possibility of pushing single values into it.
But I while my code pushes values into the chart, the X-axis (also the y axis) SHOULD be fixed.
I set the autoscale OFF, but still the chart updates the X axis.
In the attached code I set it to 0..15, but LabView changes it to 9..24.
He keeps the difference max-min = 15 but not the exact values.
I dont understand... what is the meaning of X autoscale-off, if not staying like I set it to be...
What am I missing ?
Is there a secret property I can set ?
If not, is there a easy way of preventing the chart (only the chart) of updating at all, but still rembering the values
I push in for a later update?
The reason to do is, is to zoom in and zoom out with a given X_min & X_max.
This is LabView2015 on Linux.
Thanks in advance for any hint.
Solved! Go to Solution.
01-11-2024 04:34 PM
here is the VI
01-11-2024 04:36 PM
Heres the screenshot
01-11-2024 05:10 PM
Then dont write your data to chart before it should be displayed. Store the data in a intermediate array.
01-12-2024 03:22 AM
Hi Seb,
@Seb77 wrote:
I want to use a waveform CHART (as opposed to graph) because I like the possibility of pushing single values into it.
But I while my code pushes values into the chart, the X-axis (also the y axis) SHOULD be fixed.
I set the autoscale OFF, but still the chart updates the X axis.
In the attached code I set it to 0..15, but LabView changes it to 9..24.
He keeps the difference max-min = 15 but not the exact values.
I dont understand... what is the meaning of X autoscale-off, if not staying like I set it to be...
Charts and graphs have their use cases, advantages and disadvantages. You need to evaluate all of their properties when selecting the tool for your requirement!
AutoScaling the X axis for a chart influences the number of samples shown in the chart:
When you set a history buffer size of 16 samples/elements then the chart will show those 16 elements of the history - and it will also show the indices of those 16 elements. As you write new samples into the history buffer the indices of those elements will change too.
When you want to use fixed X axis values then you should use a graph, maybe even a XY graph!
01-12-2024 04:28 AM
Thanks, Quiztus2
yes not sending new values and instead buffering somewhere I take care of would be a workaround,
but that kind-of removes the benefits of a chart over a graph.
Also IF new incoming values fall in the range X_min...X_max I also want them
to be displayed right away, but the workaround would "freeze" the chart.
Still looks like I will have to go for this workaround...
Thanks a lot GerdW.
OK, I understood the difference between charts and graphs like this:
arrays into CHARTS: can be send into "history"-> they always overwrite the entire (!) history
scalars into CHARTS: can be send into "value" and then they append to history
arrays into GRAPHS: yes, just display
scalars into GRAPHS: no, there is nothing like "appending"
So do I understand you correctly, that in a CHART the "X-autoscaling-OFF"
actually does mean the following:
"autoscaling of range (x_max-x_min) is OFF but autoscaling of X_min is still ON"
...and there is no easy workaround?
Maybe let me add this information: I use a TRANSPARENT chart on top of a graph.
I got this idea from your or Altenbachs old posts I think.
In the GRAPH I have a lot of old data (plots), that dont change, except
the axis scaling and all NEW values coming in I send to that CHART.
After one hour or so the plot in the chart is completed and I send it to the backround (the GRAPH).
This way I dont have to resend big data every time a new value comes but
just one value to the chart.
Works really good as long as my chart sees no reason to
autoscale (the above topic).
01-12-2024 04:49 AM
Hi Seb,
@Seb77 wrote:
So do I understand you correctly, that in a CHART the "X-autoscaling-OFF"
actually does mean the following:
"autoscaling of range (x_max-x_min) is OFF but autoscaling of X_min is still ON"
...and there is no easy workaround?
No, there is no "easy workaround". Charts only have limited capabilities regarding X axis handling.
@Seb77 wrote:
Maybe let me add this information: I use a TRANSPARENT chart on top of a graph.
I got this idea from your or Altenbachs old posts I think.
In the GRAPH I have a lot of old data (plots), that dont change, except
the axis scaling and all NEW values coming in I send to that CHART.
After one hour or so the plot in the chart is completed and I send it to the backround (the GRAPH).
This way I dont have to resend big data every time a new value comes but
just one value to the chart.
Works really good as long as my chart sees no reason to
autoscale (the above topic).
Altenbach usually gives very good suggestions!
What's the problem to place a transparent graph over your background graph? Then you get full control of the graph's X axis and only need to collect your measurement data on your own. Should be easy enough to create/handle an array of samples…
(Or the other way around: why don't you increase the chart history buffer so you don't have problems with the scrolling of the X axis?)
01-12-2024 06:16 PM
How does your code fit in the rest of your project?
01-15-2024 10:56 AM
Dear Altenbach,
thanks a lot for your reply.
The code example from the top post was just to demonstrate the issue. Its not my (very large) project
Yes, I get your point with the sequence structure and the sine.
And yes, the property nodes... but unfortunately labview has no "set-this-way-at-compile-time"-property-node.
Let me get back to the main issue, because I feel that this is important for many users in physics and related:
One wants to plot incoming measurement points in real time, maybe 2 values a second, and
give the user the possibility to EITHER use autoscale-X (timescale) or a manually set (by him) X-scale .
With this you run into a problem as pointed out by GerdW if you use a CHART.
You cannot really turn-off the autoscale-X (time) in a chart (instead, only the range x_max-x_min).
This is what I wanted to point out with the top example.
The "history length" was set to a larger value than what would ever enter the chart.
30 in the example, 36,000 in my real code.
GerdW suggested to use a GRAPH instead of a chart. OK. Sounds good.
But then I loose the possibility to send a SINGLE VALUE.
which makes life easy if you -lets say - get new measured values from a queue.
So comparing CHARTS and GRAPHS, let me show this:
Whith GRAPHS, if I record data for a long time I will end up sending an array with huge size every loop iteration.
So the question here is: How to append one value to a existing plot ( with long length) efficiently.
There have been posts to this subject, but they somehow dont reveal to me.
Or am I missing something ?
01-15-2024 01:03 PM
Hi Sebastian,
@Seb77 wrote:Whith GRAPHS, if I record data for a long time I will end up sending an array with huge size every loop iteration.
It is your responsibility (as programmer) to handle the internal arrays in an efficient way!
It doesn't make sense to plot 36000 samples on a chart/graph with only ~500 pixels width, so why do you think you need to create such large arrays in the first place?
@Seb77 wrote:
- There is no such thing as a property node that sends a single value to a GRAPH, right ?
- And there is also no way to manipulate (append to) the active plot that is within a GRAPH, right ?
No, there is no property node to append single samples to existing plots.
There is a way to manipulate graph plot data: hold the data in a shift register and append samples using BuildArray. This is quite efficient and allows you to manipulate the plot data in any way you like!