BRK (Break) Ladder Logic Instruction

Definition

Use the Break instruction to interrupt a routine that was called by a FOR instruction. The BRK instruction is not necessary, rather optional.

List of possible arguments

None

Note: Can’t think of any notes for this one.

FOR Ladder Logic Instruction

Definition

Use the For instruction to scan a Ladder routine repeatedly. The For instruction is handy for populating elements in arrays as an example. The instruction will repeatedly scan a routine until the Index Value exceeds the Terminal Value.

List of possible arguments

  • Routine Name             ROUTINE                             Routine to call
  • Index                              DINT                                      Routine run count
  • Initial Value                 SINT or INT                        Starting value
  • Terminal Value           SINT, INT, OR DINT        Stop value
  • Step Size                         SINT, INT, OR DINT       Value to add every index

Note: Don’t call the main routine with the FOR instruction, why would you do that anyway? It’s possible to end the FOR instruction early with a BRK instruction. Running the FOR instruction too long could cause a Watchdog Fault, so watch your scan time.