FX Series Programmable Controlers Applied Instructions 5
5-99
5.9.4 HEX (FNC 83)
Operation:
This instruction reads n ASCII data b
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
tes.
Points to note:
Please note that this instruction ‘works in reverse’ to the ASCI instruction, i.e. ASCII data
stored in b
tes is converted into associated hexadecimal characters. The HEX instruction can
be used with the M8161 8bit/16bit fla
. In this case the source data (S)is read from either the
lower b
te (8bits) when M8161 is ON, or the whole word when M8161 is OFF i.e. usin
the
example above with the followin
data in devices D50 and D51 respectivel
(43
H
,41
H
)
(42
H
,31
H
) and assumin
M8161 is ON.
The ASCII data is converted to its
hexadecimal equivalent and stored
sequentiall
di
it b
di
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 ]
For further details re
ardin
the use of the HEX instruction and about the available ASCII data
ran
es, please see the followin
information point ‘ASCII Character Codes’ under the ASCI
instruction on the previous pa
e.
Important:
If an attempt is made to access an ASCII Code (HEX or Decimal) which falls outside of the
ran
es specified in the table on previous pa
e, the instruction is not executed. Error 8067 is
fla
ed in data re
ister D8004 and error 6706 is identified in D8067. Care should be taken
when usin
the M8161 fla
, and additional in the specification of the number of element ‘n‘
which are to be processed as these are the most likel
places where this error will be caused.