Panasonic FP7 Series Command Reference Manual page 706

Cpu unit
Hide thumbs Also See for FP7 Series:
Table of Contents

Advertisement

14.11 ATOB (Conversion: ASCII → BIN)
Example 13) Converting two hexadecimal ASCII data (4 digits) to two 16-bit binary
data (hexadecimal)
The conversion starts from the low byte of DT0. It is converted in forward direction (the high
word side of [S2] is considered as high-order numerical data).
[i]...US
[S1]..."%4x"
[S2]...DT0
[N]...H
0002 00 00
[D]...DT100
② Conversion starting position = +0 byte
③ Amount of data to be converted = 2
[S2]
(characters)
DT0
H 3332
DT1
H 3130
DT2
H 4241
DT3
H 3938
DT4
DT0 to DT1: "0123" → DT100: H 0123
DT2 to DT3: "89AB" → DT101: H 89AB
Example 14) Converting two decimal ASCII data (8 digits) to two 32-bit BCD data
The conversion starts from the low byte of DT0. It is converted in forward direction (the high
word side of [S2] is considered as high-order numerical data). For empty digits of the storage
area, zeros (0) are inserted.
[i]...UL
[S1]..."%8b"
[S2]...DT0
[N]...H
0002 00 00
[D]...DT100
② Conversion starting position = +0 byte
③ Amount of data to be converted = 2
[S2]
(characters)
DT0
H 3332
DT1
H 3130
DT2
H 3030
DT3
H 3030
DT4
H 3837
DT5
H 3635
DT6
H 3433
DT7
H 3231
DT0 to DT3 : "00000123" → DT100 to DT101 : H 0000 0123
DT4 to DT7 : "12345678" → DT102 to DT103 : H 1234 5678
14-56
Converts hexadecimal ASCII data (4-digit) to 16-bit data
① ASCII data (forward direction)
② Conversion starting position (0) → [S2]+0 byte
③ Amount of conversion data (2) → two 4-digit data
3 2
1 0
B A
9 8
Converts decimal ASCII data (8-digit) to 32-bit BCD data
① ASCII data (forward direction)
② Conversion starting position (0) → [S2]+0 byte
③ Amount of conversion data (2) → two 8-digit data
3 2
1 0
0 0
0 0
8 7
6 5
4 3
2 1
[D]
DT100
H 0123
DT101
H 89AB
DT102
[D]
DT100
H 0123
H 0000 0123
H 0000
DT101
DT102
H 5678
H 1234 5678
DT103
H 1234
DT104
* When the number of characters is smaller than
the number of converted bits, the portions that are
lacking are padded with "0".
WUME-FP7CPUPGR-12

Advertisement

Table of Contents
loading

Table of Contents