SmartAXIS Touch User's Manual 12-23
2 Ladder Program
12
Control Function
BTOH
BCD to Hex
When input is on, the BCD data designated by S1 is
converted into 16- or 32-bit binary data and stored to the
destination designated by device D1.
Valid values for the source device are 0 through 9999
(BCD) for the word data type, and 0 through 9999 9999
(BCD) for the double-word data type.
S1 → D1
YES
HTOA
Hex to ASCII
When input is on, the 16-bit binary data designated by
S1 is read from the lowest digit as many as the quantity
of digits designated by S2, converted into ASCII data,
and stored to the destination starting with the device
designated by D1.
The quantity of digits to convert can be 1 through 4.
S1 → D1, D1+1, D1+2, D1+3
YES
ATOH
ASCII to Hex
When input is on, the ASCII data designated by S1 as
many as the quantity of digits designated by S2 is
converted into 16-bit binary data, and stored to the
destination designated by device D1.
Valid values for source data to convert are 30h to 39h
and 41h to 46h.
The quantity of digits to convert can be 1 through 4.
S1, S1+1, S1+2, S1+3 → D1
YES
BTOA
BCD to ASCII
When input is on, the 16- or 32-bit binary data
designated by S1 is converted into BCD, and converted
into ASCII data. The data is read from the lowest digit as
many as the quantity of digits designated by S2. The
result is stored to the destination starting with the device
designated by D1.
The quantity of digits to convert can be 1 through 5 for
the word data type, and 1 through 10 for the double-
word data type.
YES
Word data type:
S1
→
D1, D1+1, D1+2, D1+3, D1+4
Double-word data type:
S1·S1+1
→
D1, D1+1, D1+2, ... , D1+9
ATOB
ASCII to BCD
When input is on, the ASCII data designated by S1 as
many as the quantity of digits designated by S2 is
converted into BCD, and converted into 16- or 32-bit
binary data. The result is stored to the destination
designated by device D1.
Valid values for source data to convert are 30h through
39h.
The quantity of digits to convert can be 1 through 5 for
the word data type, and 1 through 10 for the double-
word data type.
YES
Word data type:
S1, S1+1, S1+2, S1+3, S1+4
→
D1
Double-word data type:
S1, S1+1, S1+2, ... , S1+9
→
D1·D1+1
ENCO
Encode
When input is on, a bit which is on is sought. The search
begins at S1 until the first point which is set (on) is
located. The quantity of points from S1 to the first set
point (offset) is stored to the destination designated by
device D1.
If no point is on in the searched area, 65535 is stored to
D1.
YES
DECO
Decode
When input is on, the values contained in devices
designated by S1 and D1 are added to determine the
destination, and the bit so determined is turned on.
YES
BCNT
Bit Count
When input is on, bits which are on are sought in an
array of consecutive bits starting at the point designated
by source device S1. Source device S2 designates the
quantity of bits searched. The quantity of bits which are
on is stored to the destination designated by device D1.
YES
Symbol Name and Diagram Function
Interrupt
Program
Execution
S2
*****
S1
*****
HTOA(*) D1
*****
S2
*****
S1
*****
ATOH(*) D1
*****
S2
*****
S1
*****
BTOA(*) D1
*****
S2
*****
S1
*****
ATOB(*) D1
*****
S2
*****
S1
*****
BCNT D1
*****