Converts Ascii To Hex - Delta DVP-PLC Applications Manual

Table of Contents

Advertisement

API
Mnemonic
83
HEX
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 is in 16-bit conversion mode. ASCII codes of the 8
high bits and 8 low bits of the hex data in S are converted into hex value and sent to D (every 4 bits as a group). n
= the number of bits converted into ASCII codes.
5. 8-bit conversion mode: When M1161 = On, the instruction is in 8-bit conversion mode. Every bit of the hex data in
S are converted into ASCII codes and sent 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 ASCII codes stored in the registers starting from D20 into hex value and send the
result (every 4 bits as a group) to registers starting from D10. n = 4.
M1001
M1161
X0
HEX
3.
Assume
S
D20 low byte
D20 high byte
D21 low byte
D21 high byte
D22 low byte
D22 high byte
D23 low byte
D23 high byte
4.
When n = 4, the bit structure will be as:
7 - 9 8
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
D20
D10
K4
ASCII code
Converted to hex
H 43
H 44
H 45
H 46
H 38
H 39
H 41
H 42
7 Application Instructions API 50-99
Function

Converts ASCII to Hex

Word Devices
C
*
*
*
*
*
*
*
*
*
*
PULSE
S
"C"
D24 low byte
"D"
D24 high byte
"E"
D25 low byte
"F"
D25 high byte
"8"
D26 low byte
"9"
D26 high byte
"A"
D27 low byte
"B"
D27 high byte
Controllers
ES/EX/SS SA/SX/SC EH/SV
Program Steps
D
E
F
HEX, HEXP: 7 steps
*
*
16-bit
n: Number of bits to be converted
ASCII code
H 34
H 35
H 36
H 37
H 30
H 31
H 32
H 33
D V P - P L C A P P L I C AT I O N M A N U A L
32-bit
Converted to hex
"4"
"5"
"6"
"7"
"0"
"1"
"2"
"3"

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DVP-PLC and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents

Save PDF