Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-99
5.9.4 HEX (FNC 83)
Operation:
This instruction reads n ASCII data b
y
tes from
head source address (S) and converts them in to
the equivalent Hexadecimal character. This is then
stored at the destination (D) for n number of b
y
tes.
Points to note:
Please note that this instruction ‘works in reverse’ to the ASCI instruction, i.e. ASCII data
stored in b
y
tes is converted into associated hexadecimal characters. The HEX instruction can
be used with the M8161 8bit/16bit fla
g
. In this case the source data (S)is read from either the
lower b
y
te (8bits) when M8161 is ON, or the whole word when M8161 is OFF i.e. usin
g
the
example above with the followin
g
data in devices D50 and D51 respectivel
y
(43
H
,41
H
)
(42
H
,31
H
) and assumin
g
M8161 is ON.
The ASCII data is converted to its
hexadecimal equivalent and stored
sequentiall
y
di
g
it b
y
di
g
it f r om the destination
head address.
If M8161 had been OFF, then the contents of
D20 would read CAB1
H
.
Mnemonic Function
Operands
Program steps
SDn
HEX
FNC 83
(Converts
ASCII to
HEX)
Converts a data
value from ASCII
in to a
hexadecimal
equivalent
K, H, KnX, KnY,
KnM, KnS
T, C, D
KnY, KnM, KnS
T, C, D, V, Z
K, H
Note:
n = 1 to 256
HEX,
HEXP:
7 steps
M10
K 4
[ S ] [ D ]
D20HEX D50
[ n ]
Source (S)
D51
b8-15
b0-7
D20
Destination
(D)
b12-15
b8-11
b4-7
b0-3
Data
-
-
A
1
HEX
DEC
ASCII Code
43
41
42
31
67
65
66
49
Symbol
'C'
'A'
'B'
'1'
D50
b8-15
b0-7
For further details re
g
ardin
g
the use of the HEX instruction and about the available ASCII data
ran
g
es, please see the followin
g
information point ‘ASCII Character Codes’ under the ASCI
instruction on the previous pa
g
e.
Important:
If an attempt is made to access an ASCII Code (HEX or Decimal) which falls outside of the
ran
g
es specified in the table on previous pa
g
e, the instruction is not executed. Error 8067 is
fla
gg
ed in data re
g
ister D8004 and error 6706 is identified in D8067. Care should be taken
when usin
g
the M8161 fla
g
, and additional in the specification of the number of element ‘n‘
which are to be processed as these are the most likel
y
places where this error will be caused.