2 Instruction Descriptions
2-212
NJ-series Instructions Reference Manual (W502)
**_BCD_TO_***
These instructions convert BCD bit strings into unsigned integers.
* The valid ranges depend on the data types of In and Out. Refer to Function, below, for details.
These instructions convert data to convert In (which must be a BCD bit string) into an unsigned integer.
The name of the instruction is determined by the data types of In and conversion result Out. For exam-
ple, if In is WORD data and Out is UINT data, the name of the instruction is WORD_BCD_TO_UINT.
The following example for the WORD_BCD_TO_UINT instruction is for when In is WORD16#3452.
Instruction Name FB/FUN Graphic expression ST expression
**_BCD_TO_*** BCD-to-Unsigned
Integer Conversion
Group
FUN Out:=**_BCD_TO_*** (In);
"**" must be a bit string data
type.
"***" must be an integer data
type.
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 OK OK
Out OKOKOKOKOKOKOKOK
Function
EN ENO
In
(@)**_BCD_TO_***
"**" must be a bit string data type.
"***" must be an integer data type.
Out
abc:=WORD_BCD_TO_UINT(WORD#16#3452);
LD
ST
abc
WORD#16#3452
WORD_BCD_TO_UINT
EN ENO
In
3452
In
Out=abc
UNIT data WORD BCD data
WORD#16#3452