7 OPERATION CONTROL PROGRAMS
7.6.14 BCD
BIN conversion : BIN
Format
[Usable data]
Setting
16-bit
data
Bit device
integer
type
(S)
—
[Setting data]
Setting data
[Functions]
[Errors]
[Program examples]
BIN(S)
Word device
64-bit
32-bit
floating
integer
point
type (L)
type (F)
—
(S)
BCD data which will be converted into BIN data
(1) The BCD data specified with (S) is converted into BIN data.
(2) If (S) is a 16-bit integer type, the data range is 0 to 9999.
(3) If (S) is a 32-bit integer type, the data range is 0 to 99999999.
(1) An operation error will occur if:
• A value other than 0 to 9 is in any digit of (S); or
• (S) is an indirectly specified device and its device No. is outside the range.
(1) Program which converts the BCD data of D0 into BIN data and substitutes the
result to #0
#0 = BIN(D0)
BIN 9999
b15
#0
0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
Usable Data
Constant
16-bit
32-bit
Coasting
integer
integer type
timer
type (K/H)
(K/H, L)
Description
b0
D0
Thousands Hundreds Tens
7 - 38
F/FS
Number of basic steps
64-bit
Calculation
conditional
floating
expression
expression
point
type (K)
—
Data type of result
Data type of (S)
(Integer type)
BCD 9999
b15
b0
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
Units
G
2
Bit
Comparison
conditional
expression
—
—
: Usable