LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

continue plotting where stopped

I attached VI that is plotting the output voltage from two power supplies on one single graph.
I plot the first power supply until voltage reaches 1000 V and then I go to bottom loop and plot the second power supply until voltage reaches 1000 V.
When I come back to first power supply and I want to continue plotting from 1000 V and up the graph does not plot at all. Just keeps the two previous plots on.
I know there are so many examples about buffering but I have to leave one plot and then come back to it and continue plotting where I stopped.
Both plots look like stairs.
I am aware that you can't run the VI but any help will be greatly appreciated.
0 Kudos
Message 1 of 2
(2,365 Views)
Hello!

It is hard to determine exactly what the problem with your code is (so many case and sequence structures make it difficult to read) but one of the problems might be that you are not placing your graph at the end of the execution.

There are some exceptions but as a rule of thumb you want to use a waveform chart whenever you want to see right away what you are plotting (something like a �real time plot�) and a graph is used when you have previously acquired or stored all the data you want to plot.

One of the options you have here is to build an array to store the data coming from the power supplies and plot it at the end. This way you will always start plotting from the point you left. I am attaching a very simple example that can show you how
to store the data coming from each loop (simulating the data coming from the power supplies) to send it to the graph at the end.

It was not very clear for me how you are switching between loops. I noticed they are starting at the same time but I don�t see how you are able to determine when you are going to or coming from one of the loops. In the example you can see that simply by passing a wire from one loop to the other you can guarantee the order of execution (it would be a good idea to run the program in highlighted execution, so you can see what is going on).

Also, I noticed that you use a lot of local variables. We recommend using local variables the less possible. Local variables break the data flow paradigm in LabVIEW, make the programs harder to read and you cannot guarantee how the value of the variable is being modified (i.e. if you are modifying the variable from two different places in your block diagram using local variables, you cannot guarantee which part modifies
the value first, and you can have strange behaviors).

Hope this helps!

Sylvia V
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,365 Views)