
Revision C 16/01/96
Chapter 2 "PCL" - 89
Macros
The purpose of a macro
A macro is a sequence of commands that you wish to execute. You can specify the command sequence and
download it to the printer after which you can execute it with a single command. For example, you might wish to
draw a raster image at the top of each page you print. Rather than sending the same sequence of commands every
time you print a new page, it is more efficient to define a macro to draw the image and store the macro in the
printer’s memory. Having done this, you can draw the picture on each page simply by running the macro, that is,
with a single command.
Like downloaded fonts, macros take up printer memory. To alleviate this, some macros are available on cartridges
that can be plugged into the printer’s cartridge slots. A cartridge-based macro must have a unique ID number or
else you will not be able to access it. If a downloaded macro has the same ID number as a cartridge macro, all
references to the ID number will be interpreted as references to the downloaded macro. To access the cartridge
macro you would first have to delete the downloaded macro.
Another method of storing Macros is uniquely available on the HL-10h/1260 printer. This is the use of PCMCIA
format memory cards type I or type III in the card slot of the printer. Macros can be saved to this card as required
and then executed from the card. A delete facility is also included to allow the removal of macros when no longer
required. The rules for identifying and calling Macros from this card are exactly the same as for cartridge stored
Macros detailed above.
One macro can call another, however, only two levels of nesting are permitted.
A printer reset will delete macros from the printer’s memory unless they have been explicitly designated as
permanent.
The PCL picture frame commands, the printer reset command and HP-GL/2 graphic language commands cannot
be invoked from within a macro.
Defining a macro
To define a macro you must first assign an ID number to it, then send to the printer a Start Macro Definition
command, the macro definition itself (consisting of a sequence of PCL commands) and finally an End Macro
Definition command.
Macro ID
Esc&f#Y
(27)(38)(102)#(89)
<1Bh><26h><66h>#<59h>
•
This command assigns an identity number to a macro that is to be downloaded, or references an existing macro
in the printer’s memory.
•
# is the ID number of a macro. The ID number must be in the range 0-32767.
•
If you specify the ID number of an existing macro and then download a new macro definition to the printer, the
new macro will overwrite the existing macro.
Start macro definition
Esc&f0X
(27)(38)(102)(48)(89)
<1Bh><26h><66h><30h><59h>
•
This command signifies that the following commands constitute a macro definition.
Содержание HL- SERIES
Страница 13: ...Revision A 16 01 96 Chapter 1 Introduction ...
Страница 16: ...Revision C 16 01 96 Chapter 2 PCL 1 Chapter 2 PCL ...
Страница 123: ...Revision C 16 01 96 Chapter 2 PCL 3 W width raster area 78 Y y offset raster 79 ...
Страница 124: ...Revision C 16 01 96 Chapter 3 PJL 1 Chapter 3 PJL Printer Job Language ...
Страница 180: ...Revision C 16 01 96 Chapter 4 Diablo 630 1 Chapter 4 Diablo 630 ...
Страница 200: ...Revision C 16 01 96 Chapter 5 EPSON FX 850 1 Chapter 5 EPSON FX 850 ...
Страница 237: ...Revision C 16 01 96 Chapter 6 IBM Proprinter XL 1 Chapter 6 IBM Proprinter XL ...
Страница 259: ...Revision C 16 01 96 Chapter 7 Bar Codes Control 1 Chapter 7 Bar Code Control ...
Страница 267: ...Revision C 16 01 96 Chapter 8 HP GL2 1 CHAPTER 8 HP GL 2 Graphics Language ...
Страница 280: ...Revision C 16 01 96 Chapter 8 HP GL2 14 220 END Sample 21 ...
Страница 328: ...Revision C 16 01 96 Chapter 9 HP GL 1 CHAPTER 9 HP GL Graphics Language ...
Страница 332: ...Revision C 16 01 96 Chapter 9 HP GL 5 1 3 2 Printing Area a b d c a b c d mm A4 4 5 5 5 Letter 6 5 5 5 Legal 6 5 5 5 ...
Страница 342: ...Revision C 16 01 96 Chapter 9 HP GL 15 Sample 68 ...
Страница 387: ...Revision C 16 01 96 APPENDIX A COMPALISON LIST 24 RESOLUTION 300 600 300 600 300 600 ...