Hex (Fnc 83) - Mitsubishi FX1S Series Programming Manual

Melsec-f
Hide thumbs Also See for FX1S Series:
Table of Contents

Advertisement

FX Series Programmable Controlers
5.9.4

HEX (FNC 83)

Mnemonic
HEX
FNC 83
(Converts
ASCII to
HEX)
16 BIT OPERATION
Points to note:
Please note that this instruction 'works in reverse' to the ASCI instruction, i.e. ASCII data
stored in bytes is converted into associated hexadecimal characters. The HEX instruction can
be used with the M8161 8bit/16bit flag. In this case the source data (S)is read from either the
lower byte (8bits) when M8161 is ON, or the whole word when M8161 is OFF i.e. using the
example above with the following data in devices D50 and D51 respectively (43
(42
,31
) and assuming M8161 is ON.
H
H
T h e A S C I I d a t a i s c o n v e r t e d t o i t s
h e x a d e c i m a l e q u i v a l e n t a n d s t o r e d
sequentially digit by digit from the destination
head address.
If M8161 had been OFF, then the contents of
D20 would read CAB1
For further details regarding the use of the HEX instruction and about the available ASCII data
ranges, please see the following information point 'ASCII Character Codes' under the ASCI
instruction on the previous page.
Important:
If an attempt is made to access an ASCII Code (HEX or Decimal) which falls outside of the
ranges specified in the table on previous page, the instruction is not executed. Error 8067 is
flagged in data register D8004 and error 6706 is identified in D8067. Care should be taken
when using the M8161 flag, and additional in the specification of the number of element 'n'
which are to be processed as these are the most likely places where this error will be caused.
Function
Converts a data
K, H, KnX, KnY,
value from ASCII
KnM, KnS
in to a
T, C, D
hexadecimal
equivalent
32 BIT OPERATION
.
H
Operands
S
D
KnY, KnM, KnS
T, C, D, V, Z
PULSE-P
Operation:
This instruction reads n ASCII data bytes 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 bytes.
ASCII Code
Source (S)
HEX DEC
b8-15
D51
b0-7
b8-15
D50
b0-7
Applied Instructions 5
FX
FX
FX
1S
1N
Program steps
n
K, H
HEX,
HEXP:
Note:
7 steps
n = 1 to 256
)
Destination
Symbol
43
67
'C'
41
65
'A'
D20
42
66
'B'
31
49
'1'
5-122
FX
2N
2NC
,41
)
H
H
Data
(D)
-
b12-15
-
b8-11
A
b4-7
1
b0-3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Fx1n seriesFx2nc seriesFx2n series

Table of Contents