2-221
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
BCD Conversion Instructions
2
BCDsToBin
BCDsToBin
The BCDsToBin instruction converts signed BCD bit strings to signed integers.
*1 The valid range depends on the value of Format. Refer to Function, below, for details.
*2 If you omit the input parameter, the default value is not applied. A building error will occur.
The BCDsToBin instruction converts signed BCD bit string In to a signed integer.
Instruction Name FB/FUN Graphic expression ST expression
BCDsToBin Signed BCD-to-
Signed Integer
Conversion
FUN Out:=BCDsToBin(In, Format);
Variables
Name Meaning I/O Description Valid range Unit Default
In Data to
convert
Input
Data to convert
*1
---
*2
Format Data format
number
Format of BCD bit string _BCD0 to _BCD3 _BCD0
Out Conver-
sion result
Output Conversion result
*1
--- ---
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 a signed integer data type that is the same size as In.
Function
(@)BCDsToBin
EN ENO
In Out
Format