Hi everybody, I'd like to know whether it's possible to initialize the i in a for loop, so as to reproduce the function : "for i going from xx to yy". As I've remarked, i is a control so I can't attribuate a specified value to start the loop.
you can add an offset (xx) to your i. If you use a while loop you can check if i (or i+xx) is equal (or greater than) yy. If you use a for loop you can wire yy-xx+1 to N. If you want something like "FOR t= x TO y STEP z" you should use a while loop with some math to generate t from loop count i (t=i*z+x).
Hope this helps, GerdW
Best regards, GerdW
using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
What you can also do is to calculate the "For i=x to y step z" into a small function outside the for-loop which generated an array of the "i" values you require. For example for i=0 to 3000 step 5 would produce an array with 0,5,10,15,20.......2995,3000.
You can then use this array to Autoindex your for-loop. If you pass an array with 100 elements through a for-loop and set "autoindex" on the tunnel to true, then the for loop will execute as often as there are array elements present (i.e. 100, or 601 in the 0..3000 case above). Care is required as if there is more than one array trying to dictate how often the loop runs, the array with the least number of elements will end up deciding. Beware empty arrays!
Using the values from your array within the for loop instead of the "i" terminal should get you what you want.