2-421
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Conversion Instructions
2
UniteReal
UniteReal
The UniteReal instruction combines a signed mantissa and exponent to make a real number.
* If you omit the input parameter, the default value is not applied. A building error will occur.
The UniteReal instruction combines signed mantissa Fraction and exponent Exponent to make real
number Out.
The following example is for when Fraction is DINT#−15 and Exponent is INT#−1.
Instruction Name FB/FUN Graphic expression ST expression
UniteReal Combine Real
Number Mantissa
and Exponent
FUN Out:=UniteReal(Fraction,
Exponent);
Variables
Name Meaning I/O Description Valid range Unit Default
Fraction Signed man-
tissa
Input
Signed mantissa
Depends on data type.
---
*
Exponent Exponent Exponent 0
Out Real number Output Real number 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
Fraction OK OK
Exponent OK
Out Must be REAL if the data type of Fraction is DINT and LREAL if the data type of Fraction is LINT.
Function
(@)UniteReal
EN ENO
Fraction Out
Exponent
abc:=UniteReal(DINT#15, INT#-1);
LD ST
abc
DINT#-15
INT# -1
UniteReal
EN ENO
Fraction
Exponent
Exponent
Signed mantissa
DINT#−15
Fraction
INT#−1
Exponent
REAL#−1.5
Out=abc