On/off circuit application example – Rockwell Automation 1761-HHP-B30 MicroLogix 1000 with Hand-Held Programmer (HHP) User Manual

Page 490

Advertising
background image

Appendix E
Application Example Programs

E–47

The following application example illustrates how to use an input to toggle
an output either on or off. For a detailed explanation of:

LD, LDI, OUT, SET, RST, and OSR instructions, see chapter 8.

JMP and LBL instructions, see chapter 12.

If the output is off when the input is energized, the output is turned on. If the
output is on when the input is energized, the output is turned off.

On/Off Circuit Ladder Program

Rung 2:0
Does a one-shot from the input push button to an internal bit – the
internal bit is true for only one scan. This prevents toggling of the
physical output in case the push button is held ”ON” for more than one
scan (always the case).

| push button|OSR #1 | push button |
| Input | | false-to- |
| | true |
| I:0 B3 B3 |
|––––] [–––––––[OSR]––––––––––––––––––––––––––––––––––––––––––( )–––––|
| 0 1 0 |

Rung 2:1
If the push button input has gone from false–to–true and the output is
presently OFF, turn the output ON and jump over the following rung to the
rest of the programs. If the JMP instruction was missing, the following
rung would be true and would turn the output back OFF.

|push button|Toggling Toggling |
| false-to- |Output Output |
| true | |
| B3 O:0 O:0 |
|––––] [––––––––]/[––––––––––––––––––––––––––––––––––––+––––(L)–––––+–|
| 0 0 | 0 | |
| | Go to rest | |
| | of program | |
| | | |
| | 1 | |
| +–––(JMP)––––+ |
| |

Rung 2:2
If the push button input has gone from false-to-true and the output is
presently ON, turns the output OFF.

|push button|Toggling | Toggling |
| false-to- |Output | Output |
| true | |
| B3 O:0 O:0 |
|––––] [––––––––] [–––––––––––––––––––––––––––––––––––––––––––(U)–––––|
| 0 0 0 |

Rung 2:3
Contains the label corresponding to the jump instruction in rung 1. The
remainder of your actual program is placed below this rung.

| Go to rest| Dummy Bit |
| of program| |
| | |
| 1 B3 |
|–––[LBL]–––––––––––––––––––––––––––––––––––––––––––––––––––––( )–––––|
| 2 |

Rung 2:4

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

On/Off Circuit Application
Example

Advertising