D-22, Program control instructions – Rockwell Automation 1785-Lxxx Enhanced and Ethernet PLC-5 Programmable Controllers User Manual

Page 322

Advertising
background image

Publication 1785-UM012D-EN-P - July 2005

D-22 Instruction Set Quick Reference

Program Control Instructions

Sequencer Output
SQO

Status Bits:
EN - Enable
DN - Done Bit
ER - Error Bit

When the rung goes from false-to-true, the SQO instruction
increments to the next step in the sequencer File (#N7:1). The
data in the sequencer file is transferred through a Mask (0F0F)
to the Destination (O:014) for every scan that the rung
remains true.

See page F-8 for a description of prescan operation for
this instruction.

Instruction

Description

SQO

SEQUENCER OUTPUT

File

Dest

#

O:014

0F0F

R6:20

Mask

Control

Position

Length

0

4

#N7:1

Instruction

Description

Master Control Reset
MCR

If the input conditions are true, the program scans the rungs
between MCR instruction rungs and processes the outputs
normally. If the input condition is false, rungs between the
MCR-instruction rungs are executed as false.

Jump
JMP

If the input conditions are true, the controller skips rungs by
jumping to the rung identified by the label (10).

Label
LBL

When the controller reads a JMP instruction that corresponds
to label 10, the controller jumps to the rung containing the label
and starts executing.

Important: Must be the first instruction on a rung.

FOR Loop
FOR

The controller executes the rungs between the FOR and the
NXT instruction repeatedly in one program scan, until it reaches
the terminal value (10) or until a BRK instruction aborts the
operation. Step size is how the loop index is incremented.

See page F-8 for a description of prescan operation for
this instruction.

Next
NXT

The NXT instruction returns the controller to the corresponding
FOR instruction, identified by the label number specified in the
FOR instruction. NXT must be programmed on an unconditional
rung that is the last rung to be repeated in a For-Next loop.

Break
BRK

When the input conditions go true, the BRK instruction aborts a
For-Next loop.

(

)

MCR

(

)

JMP

10

LBL

10

FOR

FOR

Label Number

Initial Value

0

0

N7:0

10

Index

Terminal Value
Step Size

1

NXT

NEXT

0

Label Number

BRK

Advertising