2 Instruction Descriptions
2-182
NJ-series Instructions Reference Manual (W502)
LN and LOG
These instructions find the logarithm of a real number.
*1 Negative numbers are excluded.
*2 If you omit an input parameter, the default value is not applied. A building error will occur.
*3 LN:
If In and Out are REAL data: −8.73365448e+1 to 8.87228390e+1, or
−∞/+∞
If In is REAL and Out is LREAL data: −8.7336544750000000e+1 to 8.8722839050000000e+1 or −∞/+∞
If In is LREAL and Out is REAL data: −7.08384950e+2 to 7.09782712e+2 or −∞/+∞
If In and Out are LREAL data: −7.0838495021978327e+1 to 7.0978271289338399e+2 or −∞/+∞
LOG:
If In and Out are REAL data: −3.79297795e+1 to 3.85318394e+1 or
−∞/+∞
If In is REAL and Out is LREAL data: −3.7929779453965430e+1 to 3.8531839419564961e+1 or −∞/+∞
If In is LREAL and Out is REAL data: −3.07652656e+2 to 3.08254716e+2 or −∞/+∞
If In and Out are LREAL data: −3.0765265556858878e+2 to 3.0825471555991674e+2 or −∞/+∞
LN: Finds the natural logarithm of a number.
LOG: Finds the base-10 logarithm of a number.
Instruction Name FB/FUN Graphic expression ST expression
LN Natural Logarithm FUN Out:=LN(In);
LOG Logarithm Base 10 FUN Out:=LOG(In);
Variables
Name Meaning I/O Description Valid range Unit Default
In Number to
process
Input Number to process Depends on data type.
*1
---
*2
Out Logarithm Output Logarithm
*3
--- ---
Boolean
Bit string 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
(@)LN
EN ENO
In Out
(@)LOG
EN ENO
In Out