30
line specified by the model of printer. The last datum CR is used to make
printer print one dot -line. The entire graph with m pieces of curves can be
printed out with dot -line one by one, in which each single dot-line data is
composed of data: n1, n2…nk.
For example, if wanting to print following curving graph lines decided by
5 equations:
Y1=50+40*EXP
(
-0.01*X
)
*SIN
(
X/10
)
Y2=50-40*EXP
(
-0.01*X
)
*SIN
(
X/10
)
Y3=50
Y4=50+40*EXP
(
-0.01*X
)
Y5=50-40*EXP
(
-0.01*X
)
You can use following program for showing the above curves:
10 FOR X=0 TO 150
'Print 150 dot lines
20 Y=INT
(
40*EXP
(
-0.01*X
))
30 YY=INT
(
Y*SIN
(
X/10
))
40 PRINT #1, CHR$(27);CHR$(39);CHR$(5); 'ESC 'command
,
m=5
50 PRINT #1, CHR$(50+YY);CHR$(50-YY);CHR$(50);
60 PRINT #1, CHR$(50+Y);CHR$(50-Y);CHR$(13);
70 NEXT X
The printout of running above program in TP UP-PN printer is as below:
Paper feeding direction
31
3.7 Initialization Command
ESC @
Initialize printer
Format:
ASCII
:
ESC @
Decimal
:
27
64
Hexadecimal
:
1B
40
Explanation:
The command initializes printer with following actions:
•
clear printer buffer
;
•
restore default values
;
•
select font 1
;
•
erase user-defined characters.
3.8 Data Control Commands
CR
Carriage Return
Format:
ASCII
:
CR
Decimal
:
13
Hexadecimal
:
0D
Explanation:
All data in the buffer will be printed and the paper will be fed one line
forward when sending a CR command to the printer.
CAN
Cancel one line
Format:
ASCII
:
CAN
Decimal
:
24
Hexadecimal
:
18
Explanation:
The command cancels all characters preceding this code in the line buffer
and urges buffer pointer move back to the last Carriage Return code. It does
not cancel any control code sequence in the line.
NUL
Null - Ending mark
Format:
ASCII
:
NUL
Decimal
:
0
Hexadecimal
:
00
Содержание UP-PN24S
Страница 25: ...Character code table 2...