Block that calculates the value of Value raised to the exponent Power, storing the result in Result.
Ladder Representation

Block Structure
Variable Type |
Name |
Data Type |
Description |
VAR_INPUT |
EN |
BOOL |
Block enabling |
Value |
REAL |
Base of the operation |
|
Power |
REAL |
Exponent of the operation |
|
VAR_OUTPUT |
Done |
BOOL |
End of operation |
Result |
REAL |
Variable that stores the result of the operation |
Operation
When this block has a TRUE value in EN, it sends to the Result output the value of Value raised to the exponent Power. If no errors, the Done variable is set. If there is any error in the operation, Done is not set, staying in FALSE status, while Result remains with its value unchanged.
When EN has FALSE value, Result remains unchanged and Done remains in FALSE.
Block Flowchart

Example in Ladder

The above example calculates the value of VALUE raised to the POWER variable, storing the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final result in RESULT. The block ends with success and Done output is activated.

The above example calculates the value of VALUE raised to the POWER variable, storing the final result in RESULT. Since the result is higher than the maximum supported by REAL type, the block generates an error and Done output is disabled.
Example in ST
The example below displays the instructions for applying the example above in the ST language.
VAR VALUE : REAL := 16; POWER : REAL := -40; RESULT : REAL; END_VAR
RESULT := FB_POW( EN:=DI1, Value:=VALUE, Power:=POWER, Done=>DO1);
|
|---|