EXP

Exponent of input variable to base e

EXP calculates the power of the input variable to the base e (Euler’s number = 2.7182818) and writes the result into the output variable. The input variable has to be greater than -87.33 and smaller than 88.72. This function is the reversion of the LN function.

Parameters

Input

Unnamed input (REAL, LREAL)

Input value between -87.33 and +88.72

Output

Unnamed output (REAL, LREAL)

Output as input: exponent of input variable to base e

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if input variable does not have the data type REAL, LREAL

  • if input variable is not > -87.33 and < 88.72

sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if input variable does not have the data type REAL, LREAL

  • if input variable is not > -87.33 and < 88.72

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: REAL:=0.0;
		output_value: REAL:=0.0;
	END_VAR
This example uses variables. You can also use a constant for the input variable.

LD body

The power of input_value is calculated to the base e and 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
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

output_value:=EXP(input_value);

IL body

LD

input_value

EXP

ST

output_value

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