06-19-2019 05:07 AM
Hello everyone,
I'm very new to LabVIEW, and i'm struggling with plotting the graph the way I want to. I have generated a gaussian function and I only can manage to display all the plot points at a time, but how do I generate one plot point at a time with a 100ms delay, when running the program? Should I use a time or event structure, a loop, or something else? I don't think it should be complicated? Thank you all.
06-19-2019 05:21 AM
Can you share whatever code you already have? Makes it easier to see what's going on and where to suggest changes.
Andy
06-19-2019 06:14 AM
It's obviously wrong at the moment, but here it is. Most of the code is just calculating the output of the function, i just don't really know how to handle the structures so that the graph would update point by point
06-19-2019 07:09 AM
OK, as a general rule it's better to post the actual VI (or create a VI snippet from the block diagram Edit menu) rather than a picture. Pictures can obscure the connections and the routes that wires are taking and mean anyone trying to help you has to recreate all or part of the VI themselves.
Having said that, here are some comments on what you seem have so far.
1) The output from the Bundle is a cluster containing two 1D arrays (this is a valid input to the XY graph).
2) The Build Array seems to be pointless. If you remove it and set the Tunnel Mode at the output from the loop to Indexing, the XY graph will contain one plot for each iteration of the loop.
3) If you actually want the data from all the iterations of the loop to be a single plot, you could output the X and Y arrays separately from the loop, set the Tunnel Modes for these outputs to be Concatenating, then use Bundle to format the data for the graph.
I'm not entirely clear what you mean by "update point by point" when for each loop of the iteration you are generating 1D arrays of data.
Andy
06-19-2019 10:08 AM - edited 06-19-2019 10:09 AM
Please attach your actual VI. We cannot run or debug images.
06-19-2019 10:35 AM
@altenbach wrote:
- I would just generate the gaussian once, then play it back in a loop, replotting subsets of increasing time.
- It is easiest to feed a 1D complex array to an xy graph. No need to bundle and stuff.
See if this gives you some ideas:
Of course since the x points are spaced equally, you could even use a simple chart, setting x0 and dx of the x axis accordingly.