This article discusses the application of various arithmetic programming in the Mitsubishi PLC GX Works2 software. Within GX Works2, there are four basic math instructions commonly used in calculation processes: addition (ADD), subtraction (SUB), multiplication (MUL), and division (DIV). As a test, all of these instructions will be used in a program to calculate values.
Program Objective

Addition Instruction (ADD)
The ADD instruction is used to add two values from word memory. It requires three word memory allocations: the initial value, the value to be added, and the storage location for the result. Additionally, one input parameter is needed as a trigger for the instruction.
In this program, the ADD instruction is used to add two values from word memory.
Subtraction Instruction (SUB)
The SUB instruction is used to subtract one value from another stored in word memory. It also requires three word memory allocations: the value to be subtracted, the subtractor value, and the result, along with one input parameter as the trigger.
In this program, the SUB instruction is used to subtract a specific value from word memory.
Division Instruction (DIV)
The DIV instruction is used to divide one value by another stored in word memory. Like the other instructions, the Division instruction requires three word memory allocations: the dividend, the divisor, and the result, as well as one input parameter as the trigger.
In this program, the DIV instruction is used to perform division on a word memory value.
Multiplication Instruction (MUL)
The MUL instruction is used to multiply two values stored in word memory. It requires three word memory allocations: the first value, the multiplier, and the result, along with one input parameter as the trigger.
In this program, the MUL instruction is used to multiply two word memory values.
Simulation Video
In the video below, we showed you the simulation result of this Mitsubishi program.
Math Operations in Mitsubishi PLC

IO Mapping Details
S.No. | Comment | Input (I) | Memory Word |
---|---|---|---|
1 | TRIGGER(+) | M0 | |
2 | TRIGGER(-) | M1 | |
3 | TRIGGER(*) | M2 | |
4 | TRIGGER(/) | M3 | |
5 | DATA_0 | D0 | |
6 | DATA_2 | D2 | |
7 | RESULT(+) | D4 | |
8 | DATA_6 | D6 | |
9 | DATA_8 | D8 | |
10 | RESULT(-) | D10 | |
11 | DATA_12 | D12 | |
12 | DATA_14 | D14 | |
13 | RESULT(/) | D16 | |
14 | DATA_30 | D18 | |
15 | DATA_31 | D20 | |
16 | RESULT(*) | D22 |
Basic Arithmetic Programming

RUNG 0 (Addition)
In this Rung, the ADD instruction will add the value in the DATA_0 (D0) memory word with the value in the DATA_1 (D2) memory word if the TRIGGER(+) (M0) button is pressed.
The calculation result will be entered into the RESULT(+) (D4) memory word.
RUNG 8 (Subtraction)
In this Rung, the SUB instruction will subtract the value in the DATA_6 (D6) memory word from the value in the DATA_8 (D8) memory word if the TRIGGER(-) (M1) button is pressed.
The calculation result will be entered into the RESULT(-) (D10) memory word
RUNG 16 (Division)
In this Rung, the DIV instruction divides the value in the DATA_12 (D12) memory word by the value in the DATA_14 (D14) memory word if the TRIGGER (/) (M2) button is pressed.
The calculation results will be entered into the RESULT(/) (D16) memory word.

RUNG 24 (Multiplication)
In this Rung, the MUL instruction will multiply the value in the DATA_18 (D18) memory word with the value in the DATA_20 (D20) memory word if the TRIGGER(*) (M3) button is pressed.
The calculation result will be entered into the RESULT(*) (D22) memory word.
Read Next:
- Waste-Burning System OMRON PLC Programming
- How to use Sub-Routines with Allen Bradley PLC
- Analog Alarms using PLC Functional Block Diagram
- PLC Example Programming for Star-Delta System
- Programming for Sequential Batch Mixing System