Divide (DIV)
dest := sourceA / sourceB;
Compute/Math Instructions (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS)
The DIV instruction divides Source A by Source B and places the result in the
Destination.
Operands:
Relay Ladder
Operand
Source A
Source B
Destination
Structured Text
Use the divide sign '/' as an operator in an expression. This expression divides
sourceA by sourceB and stores the result in dest.
See
Structured Text Programming
within structured text.
Function Block
Operand
DIV tag
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Type
Format
SINT
Immediate Tag
INT
DINT
REAL
A SINT or INT tag converts to a DINT value by sign-extension.
SINT
Immediate Tag
INT
DINT
REAL
A SINT or INT tag converts to a DINT value by sign-extension.
SINT
Tag
INT
DINT
REAL
for information on the syntax of expressions
Type
FBD_MATH
Description
Value of the dividend
Value of the divisor
Tag to store the result
Format
Description
structure
DIV structure
Chapter 6
275