Raises 1st input variable by the power of the 2nd input variable
EXPT raises the first input variable to the power of the second input variable (OUT = IN1IN2) and writes the result into the output variable.
Input
Input value
Exponent of the input value
Output
Output as 1st input: result
if first and the second input variable do not have the data type REAL, LREAL
if first and the second input variable do not have the data type REAL, LREAL
if output variable is zero
if processing result overflows the output variable
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
input_value_1: REAL:=0.0;
input_value_2: REAL:=0.0;
output_value: REAL:=0.0;
END_VAR
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.
Input_value_1 is raised to the power of input_value_2. The result is written into output_value.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,EXPT!,Instance,9,1,14,4,,?D?D?C);
B(B_VARIN,,input_value_1,7,1,9,3,);
B(B_VARIN,,input_value_2,7,2,9,4,);
B(B_VAROUT,,output_value,14,1,16,3,);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
output_value:=input_value_1**input_value_2;
LD |
input_value_1 |
EXPT |
input_value_2 |
ST |
output_value |