Chapter 6
Compute/Math Instructions (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS)
Add (ADD)
dest := sourceA + sourceB;
266
The ADD instruction adds Source A to Source B and places the result in the
Destination.
Operands:
Relay Ladder
Operand
Source A
Source B
Destination
Structured Text
Use the plus sign "+" as an operator within an expression. This expression adds
sourceA to sourceB and stores the result in dest.
See
Structured Text Programming
within structured text.
Function Block
Operand
ADD 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 to add to Source B
Value to add to Source A
Tag to store the result
Format
Description
Structure
ADD structure