Skip to main content

6.1.3.4.7 EXPT

Function

Exponentiation ( ** ), calculates the result using the value of input IN1 as the base and the value of input IN2 as the power. The result is placed in the output OUT

LD Graphics

alt text

Parameter description

Interface variableDeclarationData typeDescription
IN1Var_InputANY_NUMBase
IN2Var_InputANY_NUMIndex
OUTVar_OutputANY_NUMOUT:=IN1**IN2

Example

The EXPT instruction uses variable a as the base and variable b as the exponent to obtain variable c, as shown in the figure below: three INT type variables are defined, and the EXPT instruction is executed by compiling, downloading, and realizing the result of variable c

alt text

warning
  • In EXPT, the type of IN1 is ANY_REAL, and the type of IN2 is ANY_NUM. The output should be of the same type as IN1