LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use no of iteration of for loop as the input for the for loop

hi all,

i wanna need some help here..

 

i'm using for loop to iterate to ceratin no of iteration.. then, i would like to use back the no of iteration as the input of 'N' for the next iteration..

 

in other word, eg:

 

1st run:

i insert a control to 'N', let say 80

then the iteration run until 80-1 = 79..

 

2nd run:

 

i need to insert the no of "N", let say a control of 120.. i want the loop run for "120 - 79", where the 79 is the no of previous run..

 

easy to say,

how can i connect the "i' as a control to ''N''

 

n how to make a "run' or ' GO' and ''stop'' button in the front panel and block diagram after the first run without using the stop and run from the labview window

 

thanks..

0 Kudos
Message 1 of 4
(2,956 Views)

Hi zulhairy,

 

maybe like this:

Indices.png

There are other options involving ShiftRegisters or WhileLoops too...

Message Edited by GerdW on 04-11-2010 07:38 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,949 Views)

sorry, but i'm very new to this software..

 

i'm not famiar with the array..

 

i'm using labview 8.2 student addition, i tried to create as your pic, but it apear the connection wire still give some error..

 

actually i use the for loop to run a stepper motor to a position. i can run the motor succesfully. so what i need is to insert the new position so that the motor can know the current position and calculate the step (iteration) needed to run into new position.. my problem is in using the no of iteration back in order to know the current position..

 

 

0 Kudos
Message 3 of 4
(2,935 Views)
Example_VI.png
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 4 of 4
(2,925 Views)