NI Labs Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a question about "for loop"

I have builded two similar VI.  just as below.

1.PNG

in this VI, i add two for loops.

2.PNG

in this VI, i remove the two for loops.

after doing these, i run the two VI, and i have got the same result. why ?

i may not understant how "for loop" works.

i appreciate your help!

Download All
0 Kudos
Message 1 of 2
(3,165 Views)

Hi there, a couple thoughts:

1. This questions is more appropriate for the LabVIEW Discussion Forum http://forums.ni.com/t5/LabVIEW/bd-p/170

2. You can also search for for loop information, some results answer the question. http://search.ni.com/nisearch/app/main/p/bot/no/ap/global/lang/en/pg/1/q/for%20loop/

The code is functionaly equivalent.  The fundamental mathematical operations (multiply, divide, absolute power, etc) are smart enough to work on arrays as well as scalars.  So your multiply by 100 is done on all elements of your 2D array, the second version is just simpler to read and implement.

I would strongly recommend some of the free training and information at NI.com:

http://www.ni.com/gettingstarted/

Also, get the LabVIEW for Everyone book:

http://www.amazon.com/LabVIEW-Everyone-Graphical-Programming-Easier/dp/0132681943

And check out your local user groups, free seminars, etc.

Thanks,

Matt

Message 2 of 2
(2,415 Views)