Download MODEL PC100 TEMPERATURE CONTROLLER USER MANUAL
Transcript
FOR/NEXT Function: Loop definition command for local programming Syntax: FOR Im , <Beginning Value>,<Ending Value> or FOR Im , <Beginning Value>,<Ending Value>, + or FOR Im , <Beginning Value>,<Ending Value>, NEXT Im Description: The FOR/NEXT loop command provides looping capability for local program operation. Commands contained within the boundaries of the FOR statement and the NEXT statement are repeated as defined by the FOR statement. The beginning or ending value may be any integer value or an I variable value. The FOR/NEXT loop either increments the beginning value until the beginning value is equal to or greater than the ending value or decrements the beginning value, when the minus option is used, until the beginning value is equal to or less than the ending value. The number of loop executions is equal to the absolute value of the ending value minus the beginning value. Without regard to the beginning and ending values, the loop is always executed one time. FOR/NEXT loops may be nested four deep when considering the first loop as nest#1. Restrictions: None Example: DEL STORE FOR I5,1,5« FOR I2,5,I5,« BKPNT I2« NEXT I2« NEXT I5« END« RUN clear program (remote) load local program FOR I variable #5, step 1,2,3,4 FOR I variable #2, 5, I variable #5, dec step 5,4,3,2 (Pass 1) step 5,4,3 (Pass 2) step 5,4 (Pass 3) step 5 (Pass 4) set breakpoint, display I variable #2 end FOR/NEXT nest #2 end FOR/NEXT nest #1 end program store run program When the program is run, the breakpoint value will display the step sequence for the FOR/ NEXT I2 variable loop. 52 PC100 Manual ver 0709