12.07.2015 Views

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

Logix5000 Controllers General Instructions - SLAC Confluence

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

472 For/Break <strong>Instructions</strong> (FOR, FOR...DO, BRK, EXIT, RET)For (FOR)The FOR instruction executes a routine repeatedly.Operands:Relay LadderOperand Type Format DescriptionRoutinenameROUTINEroutinenameroutine to executeIndex DINT tag counts how many times the routine hasbeen executedInitial value SINT immediate value at which to start the indexINTtagDINTTerminalvalueSINTINTimmediatetagvalue at which to stop executing the routineDINTStep sizeSINTINTimmediatetagamount to add to the index each time theFOR instruction executes the routineDINTStructured TextFOR count:= initial_value TOfinal_value BY increment DO;END_FOR;Use the FOR...DO construct. See Appendix B for information onstructured text constructs.Description:IMPORTANTDo not use a FOR instruction to call (execute) the main routine.• You can put a FOR instruction in the main routine or any otherroutine.• If you use a FOR instruction to call the main routine and then puta RET instruction in the main routine, a major fault occurs (type 4,code 31).Publication 1756-RM003I-EN-P - January 2007

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!