2-187
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
EXPT (**)
EXPT (**)
The EXPT (**) instruction raises one real number to the power of another real number.
* If you omit an input parameter, the default value is not applied. A building error will occur.
The EXPT (**) instruction raises base number In to exponent Pwr to find In
Pwr.
The following example is for when In is REAL#10.0 and Pwr is REAL#3.0. The value of variable abc will
be REAL#1000.0.
The functions of the EXPT instruction and the ** instruction are exactly the same. Use the form that is
easier to use.
Instruction Name FB/FUN Graphic expression ST expression
EXPT (**) Exponentiation FUN Out:=EXPT(In, Pwr);
Out:=In ** Pwr;
Variables
Name Meaning I/O Description Valid range Unit Default
In Base
number
Input
Base number
(e.g., 5 for 5
2
)
Depends on data type.
--- *
Pwr Exponent Exponent
(e.g., 2 for 5
2
)
Out Calculation
result
Output Calculation result Depends on data type.
--- ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In OK OK
Pwr OK OK
Out OK OK
Function
(@)EXPT
EN ENO
In Out
Pwr
(@)**
EN ENO
In Out
Pwr
abc:=EXPT(REAL#10.0, REAL#3.0);
LD ST
abc
REAL#3.0
REAL#10.0
EXPT
EN ENO
In
Pwr