
|
|
|
|
|
|
| Appendix D How to Use PLC Function | |||
| Program Example: |
|
|
|
|
|
| |||
Ladder diagram: |
| Command code: Operation: | ||||||||
| X0 | M0 | LD | X0 |
| Load A contact of X0 | ||||
|
| |||||||||
|
|
|
| PLF |
|
|
|
|
| |
PLF | M0 |
| M0 |
| ||||||
|
|
|
|
| ||||||
| M0 |
|
|
| ||||||
|
| LD | M0 |
| Load the contact A of M0 | |||||
|
|
|
| SET | Y0 |
| ||||
|
|
|
|
| ||||||
|
|
|
|
|
| SET | Y0 |
| Y0 latched (ON) | |
Timing Diagram: |
|
| ||||||||
|
|
|
|
|
| |||||
X0
M0
Y0
a scan time
Mnemonic
END
Operand
Function
Program End
None
Explanations:
It needs to add the END command at the end of ladder diagram program or command program. PLC will scan from address o to END command, after executing it will return to address 0 to scan again.
D.5.9 Description of the Application Commands
Transmission Comparison
Four
Fundamental
Operations of
Arithmetic
API
10
11
12
15
20
21
Mnemonic |
|
| P |
|
|
|
|
| Steps | ||
Codes |
|
|
|
| Function |
|
|
|
| ||
|
|
|
| Command |
|
|
|
|
|
| |
16 bits | 32 bits |
|
|
|
|
|
| ||||
CMP |
|
|
|
| Compare |
| 7 |
| |||
|
|
|
|
|
|
|
|
|
|
| |
ZCP |
|
|
|
| Zone compare |
| 9 |
| |||
|
|
|
|
|
|
|
|
|
|
| |
MOV |
|
|
|
| Data Move |
| 5 |
| |||
|
|
|
|
|
|
|
|
|
|
| |
BMOV |
|
|
|
| Block move |
| 7 |
| |||
|
|
|
|
|
|
|
|
|
|
| |
ADD |
|
|
|
| Perform the addition of |
| 7 |
| |||
|
|
|
| BIN data |
|
|
|
| |||
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
| |
SUB |
|
|
|
| Perform the subtraction |
| 7 |
| |||
|
|
|
| of BIN data |
|
|
|
| |||
|
|
|
|
|
|
|
|
|
| ||
|
|
|
|
|
|
|
|
|
|
|
|
Revision June 2008, 04EE, |