Arithmetic instructions
82
Part II IEC Instructions
EXPT
Raises 1st input variable by the power of the 2nd input variable
To add an enable input and enable output to the instruction, select [With EN/ENO] from the
"Instructions" pane (LD, FBD or IL editor). To reuse an instruction select "Recently used" from the
context menu or press <Ctrl>+<Shift>+<v> in the programming window.
PLC types
Availability of EXPT (see page 1320)
Data type I/O Function
REAL 1st input input value
REAL 2nd input exponent of the input value
REAL output as 1st input result
No. IEC address Set If
R9007 %MX0.900.7 permanently
R9008 %MX0.900.8 for an instant
first and the second input variable do not
have the data type REAL
R900B %MX0.900.11 permanently output variable is zero
R9009 %MX0.900.9 for an instant processing result overflows the output
variable
Description
EXPT raises the first input variable to the power of the second input variable (OUT = IN1
IN2
) and
writes the result into the output variable. Input variables have to be within the range -1.70141 x 10
E
38
to 1.70141 x 10 E
38
.
Data types
Error flags
Example
In this example, the same POU header is used for all programming languages. For an example
using IL (instruction list), please refer to the online help.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
In this example the input variables (input_value_1 and input_value_2) have been declared.
Instead, you may enter constants directly at the input contacts of a function.
Body
Input_value_1 is raised to the power of input_value_2. The result is written into output_value.
LD
ST