This article discusses the use of the Binary and BCD Increment and Decrement instructions in Omron PLC. In PLC programming, these instructions function similarly to Counter instructions. The Increment instruction increases the value in a word memory, while the Decrement instruction decreases the value in a word memory.
Program Objective
Binary Increment Instruction: ++(590)
The ++(590) instruction will add a value of “+1” to a word memory in every PLC scan cycle. Data will be displayed in Hexadecimal format. This instruction has a value range of 0000-9999. This instruction requires 1 trigger input and 1 word memory allocation. If the value addition is required once per button execution (when the condition changes from OFF to ON), the input contact must use the Differentiate UP type. Or, if using the @++(590) version instruction, the addition will occur only once, when the button is pressed (when the condition changes from OFF to ON).
Binary Decrement Instruction: –(592)
The –(592) instruction will subtract a value of “-1” from a word memory in every PLC scan cycle. Data will be displayed in Hexadecimal format. This instruction has a value range of 0000-9999. This instruction requires 1 trigger input and 1 word memory allocation. If the value subtraction is required once per button execution (when the condition changes from OFF to ON), the input contact must use the Differentiate UP type. If using the @–(592) version instruction, the subtraction will occur only once, when the button is pressed (when the condition changes from OFF to ON).
BCD Increment Instruction: ++B(594)
The ++B(594) instruction will add a value of “+1” to a word memory in every PLC scan cycle. Data will be displayed in BCD (Binary Coded Decimal) format. This instruction has a value range of 0000-9999. This instruction requires 1 trigger input and 1 word memory allocation. If the value addition is required once per button execution (when the condition changes from OFF to ON), the input contact must use the Differentiate UP type. Or, if using the @++B(590) version instruction, the addition will occur only once, when the button is pressed (when the condition changes from OFF to ON).
BCD Decrement Instruction: –B(596)
The –B(592) instruction will subtract a value of “-1” from a word memory in every PLC scan cycle. Data will be displayed in BCD (Binary Coded Decimal) format. This instruction has a value range of 0000-9999. This instruction requires 1 trigger input and 1 word memory allocation. If the value subtraction is required once per button execution (when the condition changes from OFF to ON), the input contact must use the Differentiate UP type. If using the @–B(592) version instruction, the subtraction will occur only once, when the button is pressed (when the condition changes from OFF to ON).
In this program, each Instruction will be used to add and subtract values in a word memory allocation. The Binary Increment / ++(590) instruction will share the same word memory address with Binary Decrement / –(592), and the BCD Increment / ++B(594) instruction will share the same word memory address with BCD Decrement / –B(596). Each Instruction has its own trigger.
Simulation Video
In the video below, we simulated the PLC program, and the results are displayed.
Binary and BCD Increment in Omron CX-Programmer
IO Mapping Details
S.No. | Comment | Input (I) | Memory Word |
---|---|---|---|
1 | TRIGGER_INC | 0.00 | |
2 | TRIGGER_DEC | 0.01 | |
3 | TRIGGER_INC_B | 0.02 | |
4 | TRIGGER_DEC_B | 0.03 | |
5 | DATA_1 | D0 | |
6 | DATA_2 | D2 |
Omron PLC Tutorial
RUNG 0 (Binary Increment)
In this Rung, if the TRIGGER_INC (0.00) button is pressed, the value in the memory word DATA_1 (D0) will increase by +1. Because the TRIGGER_INC (0.00) button uses a Differentiate UP type NO contact, the value will only increase once, namely when the condition changes from OFF to ON.
RUNG 1 (Binary Decrement)
In this Rung, if the TRIGGER_DEC (0.01) button is pressed, the value in the memory word DATA_1(D0) will decrease by -1. Because the TRIGGER_DEC (0.01) button uses a Differentiate UP type NO contact, the value will only decrease once, namely when the condition changes from OFF to ON.
RUNG 2 (BCD Increment)
In this Rung, if the TRIGGER_INC_B (0.02) button is pressed, the value in the memory word DATA_2 (D2) will increase by +1. Because the TRIGGER_INC_B (0.02) button uses a Differentiate UP type NO contact, the value will only increase once, namely when the condition changes from OFF to ON.
RUNG 3 (BCD Decrement)
In this Rung, if the TRIGGER_DEC_B (0.03) button is pressed, the value in the memory word DATA_2 (D2) will decrease by -1. Because the TRIGGER_DEC_B (0.03) button uses a Differentiate UP type NO contact, the value will only decrease once, namely when the condition changes from OFF to ON.
Read Next:
- PLC SCL Programming for Marking Machine System
- Structured Text Programming for Automatic Gate Control
- How to Program PID Control in PLC with Structured Text?
- Why is Baud Rate Important in Modbus Network?
- Structured Text PLC for Sequential Process Data Storage