09-20-2012 02:40 AM
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?
09-20-2012 03:40 AM
PS:the arrays 1 and 2 should be filled with the number 100,90,80...10 in this order
x from 1-10
09-20-2012
04:31 AM
- last edited on
05-02-2025
03:52 PM
by
Content Cleaner
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.
09-20-2012 07:28 AM
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????
09-20-2012 07:33 AM
@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.
09-20-2012 07:47 AM
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
09-21-2012 12:06 AM - edited 09-21-2012 12:10 AM
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?
09-21-2012 12:15 AM
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.