LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I update the XY graph with a certain time delay?

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.

 

 

0 Kudos
Message 1 of 6
(2,294 Views)

Can you share whatever code you already have?  Makes it easier to see what's going on and where to suggest changes.

 

Andy

0 Kudos
Message 2 of 6
(2,279 Views)

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

0 Kudos
Message 3 of 6
(2,263 Views)

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

0 Kudos
Message 4 of 6
(2,255 Views)
  • It is difficult to tell what's connected to what because you have overlapping wires going in all directions, often hidden below functions.
  • Since hopefully the parameters don't change while the curve is plotting, the controls belong before the loop. OTOH, if you try to plot one point at a time, the graph terminal belongs inside the loop.
  • The event structure has no purpose.
  • Why are you generating 128 points of gaussian noise?
  • Gove your controls intuitive names. What's the "3" in the name?
  • 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.

Please attach your actual VI. We cannot run or debug images.

0 Kudos
Message 5 of 6
(2,238 Views)

@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:

 

slowGaussian.png

 

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.

0 Kudos
Message 6 of 6
(2,233 Views)