Divide (DIV)

When enabled, the DIV instruction and the operator '/' divides Source A by Source B.
Available Languages
Ladder Diagram
Ladder Diagram_Divide (DIV)_v1
Operands
IMPORTANT: Unexpected operation may occur if:
  • Output tag operands are overwritten
  • Members of a structure operand are overwritten
  • Except when specified, structure operands are shared by multiple instructions.
There are data conversion rules for mixing numeric data types within an instruction. See Data conversions.
Ladder Diagram
Operand
Data Type
Format
Description
SourceA
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
immediate
tag
Value of the dividend
SourceB
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
immediate
tag
Value of the divisor
Dest
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
tag
Tag to store the result of the instruction.
Affects Math Status Flags
Major/Minor Faults
A minor fault will occur if:
Fault Type
Fault Code
Source_B = 0
4
4
See Index through arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
N/A
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in
Rung-condition-in is true
Set Rung-condition-out to Rung-condition-in
Dest = Source A / Source B
1,2
Postscan
N/A
Examples
Ladder Diagram
FTStudio-DIV-LD-EX-V1
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.