LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph does not update in labview

I am writing a vi and am having trouble with a graph. I am collecting some data every 5 seconds within a while loop. If I send my data outside the loop to an xy graph and turn on auto-indexing, I can get the graph I desire. However, the graph doesn't update. In fact, it waits until I abort the vi by pressing the stop button before it ever draws anything on the graph. I am new to Labview, so perhaps I am missing something simple. Any help would be appreciated. I would like my graph to update with every measurement I take (every 5 seconds). Thanks!
0 Kudos
Message 1 of 4
(3,699 Views)
If you want your graph to update with every measurement, it is necessary for it to be within the loop. I attached a sample for you to review, there are additional example in LabVIEW examples and in this forum.
0 Kudos
Message 2 of 4
(3,699 Views)
> missing something simple. Any help would be appreciated. I would
> like my graph to update with every measurement I take (every 5
> seconds). Thanks!

The problem isn't specific to graphs. Data leaves a loop when the loop
completes, therefore your program states that you want to wait until the
loop completes, then send that data to the graph.

What you want is to place your graph terminal inside the loop. If you
just send an individual point to a graph, that doesn't make a very
interesting plot, so what you really want is to place the graph terminal
inside the loop and plot all the data accumulated thus far. To do this,
add a shift register to the loop and use an array builder to accumulate
the data, plotting it as you go. You probably also want
to popup up on
the left shift register and create a constant to start the loop out empty.

Greg McKaskle
0 Kudos
Message 3 of 4
(3,699 Views)
Your question already has fine answers. I'd like to add that there is a
troubleshooting tool that is very useful. Up in the top left of your
diagram there is a lightbulb. Click on that and run your program and you
can see what goes on in the diagram. In this case you would see the data
going to the output of the loop but no further till the loop ends. Since it
isnt getting to the graph the graph never updates. Just thought I'd
mention.
0 Kudos
Message 4 of 4
(3,699 Views)