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;Â Â Â (*Thiswillterminatetheforloop*)Â Â 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.