2-185
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
EXP
EXP
The EXP instruction performs calculations for the natural exponential function.
*1 If you omit an input parameter, the default value is not applied. A building error will occur.
*2 Negative numbers are excluded.
The EXP instruction returns the value of e
In
, where e is Euler's constant and In is an input variable.
The following example is for when In is REAL#1.0. The value of variable abc will be REAL#2.718282.
• Use the EXPT (**) instruction (page 2-187) to find the powers of numbers with bases other than e.
• Use the CheckReal instruction (page 2-209) to see if Out is positive infinity, negative infinity, or non-
numeric data.
Instruction Name FB/FUN Graphic expression ST expression
EXP Natural Exponen-
tial Operation
FUN Out:=EXP(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Exponent Input Exponent Depends on data type. ---
*1
Out Calculation
result
Output Calculation result Depends on data type.
*2
--- ---
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
Out OK OK
Function
Additional Information
(@)EXP
EN ENO
In Out
abc:=EXP(REAL#1.0);
LD ST
abc
REAL#1.0
EXP
EN ENO
In