Mitsubishi Electric AJ71C24-S6 User Manual page 312

Melsec-4 computer link module
Table of Contents

Advertisement

APPENDICES
MELSEC-14
(2) Procedure for converting data stored in a data register to printer output
data.
Since the PC CPU handles numerical data in binary, it is necessary to
convert datato be printed out from binary (BIN) to ASCII. Data is output
from the buffer memory to the printer sequentially from the lowest
address (head address) with the lower 8 bits to the higher 8 bits.
Therefore, use the sequence program to reorganize the order of the
data output to the printer. The following program, described in (I),
gives an example of this conversion.
Example: Converting '1234' stored in the data register to ASCll
1
2
0
3
4
- - - -
Lower 4 bits
OlSP instruction
Divide the 16bit data
(into4-bit groups
)
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 D X )
Lower 8 bits
Higher 8 bits
f
7 Lower 8 bits
Lower 8 bits
k
Higher8 bits
-f-
7 Lower 8 bits
4
I
I
+pinstructian
(Converts output
+
\data to word data
I
ASC conkrsion
Aad 30H to each
8
D i k
10 Converf
the data to ASCll
(write the data to
lthe buffer memory
1
OZH
03H
04H
05H
Print out
D l 0 = 1234
APP
-
28

Advertisement

Table of Contents
loading

Table of Contents