Converts Hex To Ascii - Delta DVP-PLC Applications Manual

Table of Contents

Advertisement

API
Mnemonic
82
ASCI
P
Type
Bit Devices
X
Y
OP
S
D
n
Operands:
S: Start device for source data
Explanations:
1.
Range of n: 1 ~ 256
2.
See the specifications of each model for their range of use.
3.
Flag: M1161 (8/16 bit mode switch)
4.
16-bit conversion mode: When M1161 = Off, the instruction converts every bit of the hex data in S into ASCII
codes and send them to the 8 high bits and 8 low bits of D. n = the converted number of bits.
5.
8-bit conversion mode: When M1161 = On, the instruction converts every bit of the hex data in S into ASCII
codes and send them to the 8 low bits of D. n = the number of converted bits. (All 8 high bits of D = 0)
Program Example 1:
1.
M1161 = Off: The 16-bit conversion mode
2.
When X0 = On, convert the 4 hex values in D10 into ASCII codes and send the result to registers starting from
D20.
M1001
M1161
X0
ASCI
3.
Assume
(D10) = 0123 H
(D11) = 4567 H
(D12) = 89AB H
(D13) = CDEF H
4.
When n = 4, the bit structure will be as:
D10=0123 H
0
0
0
0
0
0
0
0
1
High byte
D20
0
0
1
1
0
0
0
31H
1
High byte
D21
0
0
1
1
0
0
1
33H
3
7 - 9 4
Operands
M
S
K
H KnX KnY KnM KnS T
*
*
*
*
*
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
D: Start device for storing the converted result
D10
D20
K4
'0' = 30H
'4' = 34H
'1' = 31H
'5' = 35H
'2' = 32H
'6' = 36H
'3' = 33H
'7' = 37H
1
0
0
1
0
0
0
1
2
3
Low byte
1
0
0
1
1
0
0
0
30H
0
Low byte
1
0
0
1
1
0
0
1
32H
2
7 Application Instructions API 50-99
Function

Converts Hex to ASCII

Word Devices
C
*
*
*
*
*
*
*
*
*
*
PULSE
'8' = 38H
'9' = 39H
'A' = 41H
'B' = 42H
1
0
0
Controllers
ES/EX/SS SA/SX/SC EH/SV
Program Steps
D
E
F
ASCI, ASCIP: 7 steps
*
*
16-bit
n: Number of bits to be converted
D V P - P L C A P P L I C AT I O N M A N U A L
32-bit

Advertisement

Table of Contents
loading

Table of Contents