×

Subscribe to newsletter

subscribe to our weekly newsletter to get notified with latest story and article Subscribe now!




PLC BLOG | abb | ABB PLC Arithmetic instruction : ADD, SUB, MUL, DIV and MOD

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


ABB PLC Arithmetic instruction : ADD, SUB, MUL, DIV and MOD

ABB PLC have Arithmetic instruction like ADD, SUB, MUL, DIV and MOD. arithmetic instruction used for mathematical calculation. each instruction have numerical inputs to perform mathematical operation. mathematical operation depend on instruction type. output of these instruction store result of operation. maximum value range for input and output depends on selected data type. each data type have maximum and minimum rang. arithmetic instruction inputs and outputs select data any type BYTE, WORD, DWORD, SINT, USINT, INT, UINT, DINT, UDINT, REAL and LREAL. Two TIME variables can also be added together resulting in another time (e.g., t#45s + t#50s = t#1m35s).


abb plc addition instruction

ADD instruction perform addition of numerical value. add instruction comes with two inputs and three inputs. Inputs of these instruction added and result store in output. below is the example of two input and three input add instruction. input_1, input_2, input_2 and output_1 and output_2 are int data type.

abb plc addition instruction

abb plc subtract instruction

SUB instruction perform subtraction of two input variable and store result in output. A TIME variable may also be subtracted from another TIME variable resulting in third TIME type variable. Note that negative TIME values are undefined. below is the example of subtraction instruction in abb plc.

abb plc subtract instruction

abb plc multiplication instruction

MUL instruction preform multiplication between two input variable and store multiplication result in output. Below is the example of multiplication instruction MUL two multiply input_1 to Input_2.

abb plc multiplication instruction

abb plc division instruction

DIV abb plc division instruction perform division. input 1 is a dividend, input 2 is a divisor, and output is a quotient. if input 1 and input 2 is non real value or integer number and output is also integer(INT) data type than output store number without decimal. for example if input 1 is 5 and input 2 is 2 when division preform than output only store 2 not actual result i.e. 2.5. so make a real data type for output. below is the example of Division instruction. first instruction have all inputs and output are int data type and second DIV instruction inputs are integer type and output is real type.

abb plc division instruction

abb plc MOD instruction

MOD instruction perform Modulo operation. The modulo operation finds the remainder when the dividend is divided by the divisor. input 1 is dividend and input 2 is the divisor. output is remainder. Inputs of these instruction have only integer value not real value. below is the example of MOD instruction in abb plc. all inputs and output is real data type.

abb plc MOD instruction

Simmilar

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


Suggested Post


 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

comment