Programming Example | Section | |
|
|
|
4-4-2 Example Program
The following ladder program will be used to demonstrate how to write a pro- gram with the Programming Console. This program makes output IR 01000 flicker ON/OFF (one second ON, one second OFF) ten times after input IR 00000 is turned ON.
00000
00004
00007
00010
00014
Start input
00000 C000
20000
20000 T002
20000 T002
20000 |
| T001 | Count input | CP |
| ||||
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
|
|
|
20000 |
|
|
|
|
| R |
| ||
|
|
|
|
|
|
|
|
| |
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
| Reset input |
|
|
20000 |
| T001 |
|
| |||||
|
|
|
| ||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20000
TIM 001 |
|
#0010 | |
|
TIM 002
#0020
CNT 000
#0010
Flicker output (10 counts)
01000
ON
OFF
00017
| END(01) | 1S |
|
The mnemonic list for the example program is shown in the following table. The steps required to enter this program from a Programming Console are described in
Address | Instruction |
| Data |
| Programming example |
|
|
|
|
| procedures in |
|
|
|
|
| Programming Procedures |
|
|
|
|
|
|
00000 | LD |
| 00000 | (1) | |
|
|
|
|
|
|
00001 | OR |
| 20000 |
|
|
|
|
|
|
|
|
00002 | AND NOT | C | 000 |
|
|
|
|
|
|
|
|
00003 | OUT |
| 20000 |
|
|
|
|
|
|
|
|
00004 | LD |
| 20000 | (2) | |
|
|
|
|
|
|
00005 | AND NOT | T | 002 |
|
|
|
|
|
|
|
|
00006 | TIM |
| 001 |
|
|
|
|
|
|
|
|
|
| # | 0010 |
|
|
|
|
|
|
|
|
00007 | LD |
| 20000 | (3) | |
|
|
|
|
|
|
00008 | AND NOT | T | 002 |
|
|
|
|
|
|
|
|
00009 | TIM |
| 002 |
|
|
|
|
|
|
|
|
|
| # | 0020 |
|
|
|
|
|
|
|
|
00010 | LD |
| 20000 | (4) | |
|
|
|
|
|
|
00011 | AND | T | 001 |
|
|
|
|
|
|
|
|
00012 | LD NOT |
| 20000 |
|
|
|
|
|
|
|
|
00013 | CNT |
| 000 |
|
|
|
|
|
|
|
|
|
| # | 0010 |
|
|
|
|
|
|
|
|
00014 | LD |
| 20000 | (5) | Flicker output (10 counts) |
|
|
|
|
|
|
00015 | AND NOT | T | 001 |
|
|
|
|
|
|
|
|
00016 | OUT |
| 01000 |
|
|
|
|
|
|
|
|
00017 | END (01) |
| (6) | END(01) instruction | |
|
|
|
|
|
|
103