7 - 38
7 OPERATION CONTROL PROGRAMS
F/FS G
7.6.14 BCD
BIN conversion : BIN
Format BIN(S) Number of basic steps 2
[Usable data]
Usable Data
Word device Constant
Setting
data
Bit device
16-bit
integer
type
32-bit
integer
type (L)
64-bit
floating
point
type (F)
Coasting
timer
16-bit
integer
type (K/H)
32-bit
integer type
(K/H, L)
64-bit
floating
point
type (K)
Calculation
expression
Bit
conditional
expression
Comparison
conditional
expression
(S) —
—
—
— —
: Usable
[Setting data]
Setting data Description Data type of result
(S) BCD data which will be converted into BIN data
Data type of (S)
(Integer type)
[Functions]
(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.
[Errors]
(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.
[Program examples]
(1) Program which converts the BCD data of D0 into BIN data and substitutes the
result to #0
#0 = BIN(D0)
#0
0 0 1 0 0 1 1 1 0 0 0 0 1 1 1 1
b0b15
BIN 9999
D0
1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1
b0b15
BCD 9999
Thousands Hundreds Tens Units