Is there ANYTHING in CodeSys that allows you to force a for loop block to move to the next iteration? Like the "continue" command in most other languages? Is there an equivalent?
Elric.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you put the var higher as the to value it will not enter the loop, (except when to value is 127 in SINT, then it will never end.)
and you can check with IF statement. (in some cases RETURN works as it will leave a POU)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There if you want to leave a loop you can also use the EXIT command.
FORscounter :=0to100DO
  IF(data[scounter] <>255THEN
    data[scounter] :=data[scounter] +1;
  ELSE
    EXIT;   (* This will terminate the for loop *)
  END_IFEND_FOR
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all.
Is there ANYTHING in CodeSys that allows you to force a for loop block to move to the next iteration? Like the "continue" command in most other languages? Is there an equivalent?
Elric.
If you put the var higher as the to value it will not enter the loop, (except when to value is 127 in SINT, then it will never end.)
and you can check with IF statement. (in some cases RETURN works as it will leave a POU)
There if you want to leave a loop you can also use the EXIT command.