PLC BLOG | Mitsubishi | Mitsubishi FX Series Arithmetic Instructions: PLC Programming with ADD, SUB, MUL, DIV

Share on Facebook Share On Twitter Share on LinkedIn Share on Whatsapp


lg-12 col-12 fb-share-button">

Share on Facebook

Share on twitter

Share on Whats-App

Mitsubishi FX Series Arithmetic Instructions: PLC Programming with ADD, SUB, MUL, DIV

arithmetic instructions perform mathematical operation and calculation on numerical data. Arithmetic Instructions are very useful in industrial control system. Mitsubishi fx series cpu have ability to perform mathematical instruction. for example if you have a program to calculate capacity of cylindrical water tank. To measure the capacity of the cylindrical water tank, you will need to do some simple calculations. your calculation is to multiply the area (A) of the round end by the height H. you can obtain height by level transmitter and formula for area is A= πxR2. where R is the radius of water tank which is fixed in our case. so volume of cylindrical water tank is area (A) x height (H), but the result in meter3. for capacity in liter multiply volume by 1000. so in this case you need multiplication instruction in your. you can use also assigned a konstant value in your Arithmetic Instructions by Using K and H. in this article only about instrunction we discuss flags of Arithmetic Instructions in next article.


Mitsubishi FX Series Addition Arithmetic Instructions

addition instruction is used to add two source numerical value and result stored in the destination value. numerical value may also constant value example k10, k45 etc. in Addition instruction have two Source S1 and S2 and a destination D where the result store. in Mitsubishi FX Series following are addition instruction which are categorized by numerical value type

Mitsubishi FX Series Addition Arithmetic Instructions

above is the example of Mitsubishi FX Series Addition Arithmetic Instructions


Mitsubishi FX Series Subtraction Arithmetic Instructions

Subtraction instruction is used to subtract two source numerical value and result stored in the destination value. following is the subtraction instruction in Mitsubishi FX Series PLC

Mitsubishi FX Series Subtraction Arithmetic Instructions

above is the example of Mitsubishi FX Series Subtraction Instructions


Mitsubishi FX Series Multiplication Arithmetic Instructions

Mitsubishi FX Series Multiplication Arithmetic Instructions use for multiplication of two source value S1 and S2 result of this instruction is stored in destination. Following are the available instruction in Mitsubishi Fx series plc

Mitsubishi FX Series Multiplication Arithmetic Instructions

above is the example of multiplication instruction


Mitsubishi FX Series Division Arithmetic Instructions

Mitsubishi FX Series Division Arithmetic Instructions use to divide source value S1 to S2, result of this instruction is stored in destination D. Division instruction use for 16 bit, 32 bit and floating point value. Following are type of DIV instruction available in Mitsubishi. We know The formula for a division is Dividend ÷ Divisor = Quotient + Remainder so in Mitsubishi Division Instruction Quotient is store in destination data register and remainder is store next data address of data register. For 16 bit numerical value if data register D1 is Dividend, D2 is divisor, D3 is Quotient than data register D4 is remainder. for 32 bit numerical value if data register D1 is Dividend, D5 is Divisor so D8 is quotient than D9 also used as quotient and remainder store in D10 and D11. when source and Destination is zero and Division operation perform than this instruction set a error flag and our plc show error message. we discuss error flag details so avoid divide 0 to 0.

Mitsubishi FX Series Division Arithmetic Instructions

above is the example of Division instruction Mitsubishi Fx series plc.


Mitsubishi FX Series increment (INC) Arithmetic Instructions

Mitsubishi FX Series increment (INC) Arithmetic Instructions increment value by 1. in this instruction source value is incremented by a value of 1 On every execution of the instruction.

Mitsubishi FX Series increment (INC) Arithmetic Instructions

Above is the example of Mitsubishi FX Series increment (INC) Arithmetic Instructions in this example when X001 is set to high than value D0 is incremented by value 1, when destination value is reached to +32767 than in next increment value of destination set to -32768 (lower range of 16 bit value.).


Mitsubishi FX Series decrement (DEC) Arithmetic Instructions

Mitsubishi FX Series decrement (DEC) Arithmetic Instructions Decrement source value by 1 and store result into destination. On every execution of the instruction the device specified as the destination D, has its current value decremented (decreased) by a value of 1. In 16 bit operation, when -32,768 is reached the Next increment will write a value of +32,767 to the destination device. In 32 bit operation, when -2,147,483,648 is reached the next increment will write a value of +2,147,483,647 to the destination device.

Mitsubishi FX Series decrement (DEC) Arithmetic Instructions

above is the example of Mitsubishi FX Series decrement (DEC) Arithmetic Instructions in this example when X001 is set to high than value D1 is decremented by value 1, when destination value is reached to -32767 than in next decrement value of destination set to +32768.