EXPT

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.

Parameters

Input

Unnamed input (REAL, LREAL)

Input value

Unnamed input (REAL, LREAL)

Exponent of the input value

Output

Unnamed output (REAL, LREAL)

Output as 1st input: result

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)

if first and the second input variable do not have the data type REAL, LREAL

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)

if first and the second input variable do not have the data type REAL, LREAL

sys_bIsEqual (turns to TRUE and remains TRUE)

if output variable is zero

sys_bIsCarry (turns to TRUE for one scan)

if processing result overflows the output variable

Example

POU header

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.

LD body

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

ST body

output_value:=input_value_1**input_value_2;

IL body

LD

input_value_1

EXPT

input_value_2

ST

output_value

Modified on: 2022-08-23Feedback on this pagePanasonic hotline