6F3B0250
7. Instructions
FUN 062
HTOA
Hex to ASCII conversion
T1S only
Expression
Input
Function
When the input is ON, the hexadecimal data of n registers starting with A is converted into ASCII characters and stored in B and after. The uppermost digit of source A is stored in lower byte of destination B, and followed in this order. The allowable range of n is 1 to 32.
Execution condition
Input |
| Operation | Output |
OFF | No execution |
| OFF |
ON | Execution |
| ON |
Operand
| Name |
|
| Device |
|
|
|
|
|
| Register |
|
|
|
| Constant | Index | ||
|
| X | Y | R | S | T. | C. | XW | YW | RW | SW | T | C | D | I | J | K |
|
|
A | Source |
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö | Ö |
|
n | Data size |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 - 32 |
|
B | Destination |
|
|
|
|
|
|
| Ö | Ö | Ö | Ö | Ö | Ö |
|
|
|
|
|
Example
When R010 is ON, 4 words data of D0100 to D0103 are converted into ASCII characters, and stored in 8 words registers starting with D0200.
D0100
D0101
D0102
D0103
F | 0 |
H0123
H4567
H89AB
HCDEF
|
| F | 8 7 | 0 | |
| D0220 | “1” (H31) |
| “0” (H30) |
|
Converted | D0221 | “3” (H33) |
| “2” (H32) |
|
| D0222 | “5” (H35) |
| “4” (H34) |
|
| D0223 | “7” (H37) |
| “6” (H36) |
|
| D0224 | “9” (H39) |
| “8” (H38) |
|
| D0225 | “B” (H42) |
| “A” (H41) |
|
| D0226 | “D” (H44) |
| “C” (H43) |
|
| D0227 | “F” (H46) |
| “E” (H45) |
|
Note
·If index register (I, J or K) is used for the operand A, only n = 1 is allowed. Otherwise, boundary error will occur.
Basic Hardware and Function 179
CTi Automation - Phone: 800.894.0412 - Fax: 208.368.0415 - Web: www.ctiautomation.net - Email: info@ctiautomation.net