2-251
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Data Type Conversion Instructions
2
**_TO_*** (Real Number-to-Real Number Conversion Group)
**_TO_*** (Real Number-to-Real
Number Conversion Group)
These instructions convert real numbers to real numbers with different data types.
* The valid ranges depend on the data types of In and Out. Refer to Function, below, for details.
These instructions convert a real number, In, to a real number with a different data type.
The name of the instruction is determined by the data types of In and conversion result Out. For exam-
ple, if In is REAL data and Out is LREAL data, the name of the instruction is REAL_TO_LREAL.
The following example for the REAL_TO_LREAL instruction is for when In is REAL#3.141592e+0.
Instruction Name FB/FUN Graphic expression ST expression
**_TO_*** Real Number-to-
Real Number Con-
version Group
FUN Out:=**_TO_*** (In);
"**" and "***" must be dif-
ferent real number data
types.
Variables
Name Meaning I/O Description Valid range Unit Default
In Data to
convert
Input Data to convert *
--- 0
Out Conver-
sion result
Output Conversion result *
--- ---
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
"**" and "***" must be different real
number data types.
(@)**_TO_***
EN ENO
In Out
abc:=REAL_TO_LREAL(REAL#3.141592e+0);
LD
ST
abc
REAL#3.141592e+0
REAL_TO_LREAL
EN ENO
In