552 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 15 Advanced Math Instructions (LN, LOG, XPY)
X to the Power of Y (XPY)
The XPY instruction takes Source A (X) to the power of Source B (Y) and stores
the result in the Destination.
Operands:
Relay Ladder
Structured Text
Use two, adjacent multiply signs ‘∗∗’ as an operator within an expression. This
expression takes sourceX to the power of sourceY and stores the result
in dest.
See Structured Text Programming
for information on the syntax of expressions
within structured text.
Function Block
Operand Type Format Description
Source X SINT
INT
DINT
REAL
Immediate
Tag
Base value
Source Y SINT
INT
DINT
REAL
Immediate
Tag
Exponent
Destination SINT
INT
DINT
REAL
Tag Tag to store the result
Operand Type Format Description
XPY tag FBD_MATH Structure XPY structure
dest := sourceX ** sourceY;