Description
You can use the "Exponentiate" instruction to raise the value at the input IN1 by a power specified with the value at input IN2. The result of the instruction is stored at output OUT and can be queried there (OUT = IN1IN2).
The value at input IN1 must be a valid floating-point number. Integers are also allowed for setting the input IN2.
Enable output ENO has the signal state "0" if one of the following conditions applies:
-
Enable input EN has the signal state "0".
-
Errors occur during the instruction processing, for example, if there is an overflow.
Parameters
The following table shows the parameters of the instruction "Exponentiate":
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|
|---|---|---|---|---|---|
|
S7-1200 |
S7-1500 |
||||
|
EN |
Input |
BOOL |
I, Q, M, D, L or constant |
I, Q, M, D, L, T, C or constant |
Enable input |
|
ENO |
Output |
BOOL |
I, Q, M, D, L |
I, Q, M, D, L |
Enable output |
|
IN1 |
Input |
Floating-point numbers |
I, Q, M, D, L, P or constant |
I, Q, M, D, L, P or constant |
Base value |
|
IN2 |
Input |
Integers, floating-point numbers |
I, Q, M, D, L, P or constant |
I, Q, M, D, L, P or constant |
Value with which the base value is exponentiated |
|
OUT |
Output |
Floating-point numbers |
I, Q, M, D, L, P |
I, Q, M, D, L, P |
Result |
You can select the data type of the instruction from the "???" drop-down list of the instruction box.
You can find additional information on valid data types under "See also".
Example
The following example shows how the instruction works:
If the operands "TagIn_1" and "TagIn_2" have signal state "1", the "Exponentiate" instruction is executed. The value of operand "Tag_Value1" is raised by the power of the value of the operand "Tag_Value2". The result is stored at output "Tag_Result". If the instruction is executed without errors, the enable output ENO has the signal state "1" and the "TagOut" output is set.