10-17-2008 06:01 AM
How do I get a variable (integer) outside a for loop that is changed within the for loop?
10-17-2008 06:18 AM - edited 10-17-2008 06:19 AM
10-17-2008 06:40 AM
I have the code in this way:
I added also the VI for the previous verson. I want to store the output in Y outside of the forloop.
10-17-2008 07:00 AM
Hi,
You have disable the auto-indexing and i have shown the difference in the attached VI.
http://zone.ni.com/reference/en-XX/help/371361D-01/lvhowto/auto_indexing_1/ This gives more info. Hope the VI helps.
10-17-2008 10:14 AM
Also, if you want to see the new value with each iteration, then you obviously need to place the indicator inside the for-loop. Although, since the for-loop will run very fast, you're not likely to see each new value unless you run the code in highlight mode.
To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.
10-17-2008 10:21 AM