09-22-2022 07:00 AM - edited 09-22-2022 07:01 AM
Hello,
For a project I am working on during my studies I am trying to plot the date from two sensors in an xy-plot.
My problem is that the programm only shows me the complete graph after I stopped it.
Previoulsy I had the xy-plot inside the while-loop but then it always overwrote the plot point with the new one and it didn't save the old one.
My goal is that the xy plot shows all the data I am gathering while the program runs.
This is my first time working with LabView so any help would be great.
I am on Version 20.0.1f1 of LabView
- FloJ
09-22-2022 07:03 AM - edited 09-22-2022 07:05 AM
Please review the LabVIEW Help (press Ctrl-H and hover over the control then click the link) to see the difference between a Graph and a Chart. Charts keep their own history, while Graphs need all the data given to them each time. You have to buffer the data yourself (by building an array inside the loop and writing that to the XY Graph) in order to see the entire history. (edit: fixed a typo)
09-22-2022 07:57 AM
Hey,
thank you for the response.
At the moment this is what I am doing.
I´m building two arrays within the loop and sending them to the xy-graph.
As soon as I press the stop button the graph shows.
I want to know if it is possible for the graph to show the new data points whenever a new one is aquired.
-FloJ
09-22-2022 08:21 AM - edited 09-22-2022 08:22 AM
It works now,
found a simple solution.
As I tried before, I put the xy plot inside the while loop.
But I forgot to connect the shift registers.
09-22-2022 11:48 AM - edited 09-22-2022 12:09 PM
@FloJ wrote:found a simple solution..
Dataflow of course dictates that the while loop only outputs data when the loop has complete, so to have live updates, the graph terminal needs to be inside the loop, of course.
Your solution is not "simple", but contains a totally bewildering array of unnecessary array operations (see also).
To append to an existing array, you use built array. If you use a complex array (X=RE, Y=IM), all you need is one shift register and a built array node. (Not sure why you made your graph a type definition. You need to disconnect it to accept a complex array instead)
There are plenty of other questionable code constructs.