2 Instruction Descriptions
2-224
NJ-series Instructions Reference Manual (W502)
BinToBCDs_**
These instructions convert signed integers to signed BCD bit strings.
* The valid range depends on the value of Format. Refer to Function, below, for details.
These instructions convert signed integer In to a signed BCD bit string.
The name of the instruction is determined by the data type of Out. For example, if Out is the WORD
data type, the instruction is BinToBCDs_WORD.
Instruction Name FB/FUN Graphic expression ST expression
BinToBCDs_** Signed Integer-to-
BCD Conversion
Group
FUN Out:=BinToBCDs(In, For-
mat);
"**" must be a bit string data
type.
Variables
Name Meaning I/O Description Valid range Unit Default
In Data to
convert
Input
Data to convert
*
---
0
Format Data format
number
Format of BCD bit string _BCD0 to _BCD3 _BCD0
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
Format Refer to Function for the enumerators of the enumerated type _eBCD_FORMAT.
Out Must be same size of data type as In
Function
(@)BinToBCDs_**
EN ENO
In Out
Format
"**" must be a bit string data type.