 # Math Instructions in PLC Ladder Logics

Different Math Instructions are used in Ladder Logics for various arithmetic operations like addition, subtraction, division, multiplication, etc.

Source is the address(es) of the value(s) on which the mathematical, logical, or move operation is to be performed.

This can be word addresses or program constants.

An instruction that has two source operands does not accept program constants in both operands.

Destination is the address of the result of the operation. Signed integers are stored in two’s complementary form and apply to both source and destination parameters.

Location of math instructions in ladder logic determine to operation performed (i.e. if the operation A(B+C) is desired, the ADD operation must appear before the MUL).

# Math Instructions – Add two values. Dest=(A+B)

## SUB:

– Subtract one value from another. Dest=(A-B)

## MUL:

– Multiply two values Dest=(A*B)

## DIV:

– Divide one value by another. Dest=(A/B)

## SQR:

– Take the square root of a value

## NEG:

– Negate a value (2’s complement)

## TOD:

– Convert from integer to BCD

## FRD:

– Convert from BCD to integer

All integer operations only

*Other operations available with the Micrologix PLC.

1 Like