Event-driven sequencer application example, E–27, Event driven sequencer ladder program – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 470: Ld, ldi, and res instructions, see chapter 8, Sqo and sqc instructions, see chapter 13

Advertising
background image

Appendix E
Application Example Programs

E–27

The following application example illustrates how the FD (found) bit on an
SQC instruction can be used to advance an SQO to the next step (position).
This application program is used when a specific order of events is required
to occur repeatedly. By using this combination, you can eliminate using the
XIO, XIC, and other instructions. For a detailed explanation of:

LD, LDI, and RES instructions, see chapter 8.

SQO and SQC instructions, see chapter 13.

Event Driven Sequencer Ladder Program

Rung 2:0
Ensures that the SQO always resets to step (position) 1 each RRUN mode
entry. (This rung actually resets the control register’s position and EN
enable bit to 0. Due to this, the following rung sees a false to true
transition and asserts step (position) 1 on the first scan.)

Eliminate this rung for retentive operation.
| S:1 R6:0 |
|––] [–––––––––––––––––––––––––––––––––––––––––––––––––––––––(RES)––––|
| 15 |
| |

Rung 2:1
The SQC instruction and SQO instruction share the same Control Register.
This is acceptable due to the careful planning of the rung state
condition. You could cascade (branch) many more SQO instructions below the
SQO if you desired, all using the same Control Register (R6:0 in this
case). Notice that we are only comparing Inputs 0–3 and are only
asserting Outputs 0–3 (per our Mask value).

| R6:0 +SQC–––––––––––––––+ |
|––]/[––––––––––––––––––––––––––––+–––––––+SEQUENCER COMPARE +–(EN)–+–|
| FD | |File #N7:0+–(DN) | |
| | |Mask 000F+–(FD) | |
| | |Source I:0.0| | |
| | |Control R6:0| | |
| | |Length 9| | |
| | |Position 2| | |
| | +––––––––––––––––––+ | |
| | R6:0 +SQO–––––––––––––––+ | |
| +––]/[––+SEQUENCER OUTPUT +–(EN)–+ |
| FD |File #N7:10+–(DN) |
| |Mask 000F| |
| |Dest O:0.0| |
| |Control R6:0| |
| |Length 9| |
| |Position 2| |
| +––––––––––––––––––+ |

Rung 2.2

| |
|–––––––––––––––––––––––––––––––––––––+END+–––––––––––––––––––––––––––|
| |

The following displays the FILE DATA for both sequencers. The SQC compare
data starts at N7:0 and ends at N7:9. While the SQO output data starts at
N7:10 and ends at N7:19. Please note that step 0 of the SQO is never
active. The reset rung combined with the rung logic of sequencers
guarantees that the sequencers always start at step 1. Both sequencers
also ”roll over” to step 1. ”Roll Over” to step 1 is integral to all
sequencer instructions.

SQC Compare Data

Addresses

Data

(Radix=Decimal)

N7:0

0

1

2

3

4

5

6

7

8

9

N7:10

0

0

1

2

3

4

5

6

7

8

Event-Driven Sequencer
Application Example

Advertising