Macro Creation

Designate a unique identification (ID) number prior to the definition of a macro using the Macro ID command. This number is assigned to the macro. If a macro is already associated with this ID number, the previously existing macro is deleted from user memory during the definition of the new macro. Subsequent macro operations are accomplished using the macro ID number.

A macro is created in the printer in several steps. First, the start macro command is sent to the printer to indicate the start of a macro definition. Next, the printer commands, control codes, and data that constitute the macro are sent to the printer, in the intended order of their execution. Finally, the End Macro command is sent to the printer to indicate the end of the macro definition

Table 12-1

Assign ID

Macro ID command (E &f14Y) assigns a

 

C

Number

unique identification number (14) to the macro.

 

 

Start Macro

Macro Control command, EC&f0X, indicates the

Definition

following commands and data are to be stored

 

as a macro.

 

 

Macro data

Escape sequences, control codes, HP-GL/2

 

commands and text required to perform the

z

desired operation.

z

 

z

 

Macro data

 

 

 

Stop

Macro Control command, EC&f1X, identifies the

MacroDefinition

end of the macro data (definition).

 

 

To invoke a macro, send the Macro ID command with the ID number of the macro, then send the Macro Control command with a value field of 2, 3, or 4 (EC&f2X, EC&f3X, or EC&f4X). This performs the macro in the specified mode: Execute (value field=2), Call (value field=3), or Overlay (value field=4). Refer to the following section “Macro Invocation” for a description of these modes.

EN

Macro Creation 12-3

Page 259
Image 259
HP 5961-0509 manual Macro Creation, MacroDefinition End of the macro data definition