LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot each result of the iteration after one another?

hallo everyone,

 

as the question says I want to plot each result of the iteration directly after it's evaluated. I have a for loop with 10 iterations, so I should have 10 plots, but I want them to appear after one another; like when the first iteration is done, the result is plotted and when the second is done the result is plotted and etc but the problem seems that the code evaluates the for loop 10 times and then plots the whole thing directly, so any help please?

 

 

 

 

0 Kudos
Message 1 of 8
(3,591 Views)

PS:the arrays 1 and 2 should be filled with the number 100,90,80...10 in this order

      x from 1-10

0 Kudos
Message 2 of 8
(3,582 Views)

I cannot open your VI since it's 2012. Always try saving it to the oldest version possible when posting it in the forums.

From what I understand you want a waveform grap inside the for loop. Put a wait of a few seconds inside the loop as well. Your data will be displayed sequentially after each iteration.

It will be overwritten though, use a waveform chart to have all the data in one plot.

Refer to this for different types of graphs: https://www.ni.com/docs/en-US/bundle/labview/page/types-of-graphs-and-charts.html

If you create the data with auto-indexing in the for-loop your best bet is probably the waveform chart.

LabVIEW 2012 32 bit

I am not an expert!
0 Kudos
Message 3 of 8
(3,567 Views)

well I solved the first problem but now I have another one which is the for loop doesn't stop until I press stop from the menu above!!! it should do only 10 iterations but it does infinite????

0 Kudos
Message 4 of 8
(3,554 Views)

@valdi wrote:

well I solved the first problem but now I have another one which is the for loop doesn't stop until I press stop from the menu above!!! it should do only 10 iterations but it does infinite????


I am not seeing this "infinite run" behavior. I ran your VI under LV 2011.

 

You do have unnecessary auto-indexing. For the first two array you're already auto-indexing, so branch off the wire inside the loop - there's no need to create another auto-indexing tunnel.

0 Kudos
Message 5 of 8
(3,550 Views)

I dont understant what you mean! but I need to pass the elements of each array into the for loop, this is a simplified version of the code

0 Kudos
Message 6 of 8
(3,544 Views)

I can't see the infinite execution neither. When you press the "Run" button (Not the "Run Continuously") your VI stops executing after 10 seconds... I ran it with LabVIEW 2012.

Where is your problem?

0 Kudos
Message 7 of 8
(3,523 Views)

By the way, I also had a possible solution for your original problem but had browser problem when loading it up yesterday. Now it seems to work...

The VI works with double/double array instead of dynamic data. The clue is as you might have noticed, placing the indicator inside the for loop. Always bear the LabVIEW dataflow princliple in mind. I also deacitvated the indicators autoscale option.

0 Kudos
Message 8 of 8
(3,518 Views)