The text of a manual · part 8 of 16
A760 Two-Color Thermal/Impact Hybrid Printer User Guide: Programming Supplement, pages 69 to 78
Pages 69 to 78 of 154
The original document is the PDF (2.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the TPG A760
Page 69
Revision F January 2010
A760 User Guide: Programming Supplement
69
Chapter 4: Programming commands
Download logo image (ColorPOS®) ASCII
GS 0x84 m n1 n2 d1…..dx , x = (n1 * n2*8 ) * m
Hexadecimal
1D 84 m n1 n2 d1…..dx , x = (n1 * n2*8 ) * m
Decimal Value of m:
29 132 m n1 n2 d1…..dx , x = (n1 * n2*8 ) * m 1 = monochrome 2 = two-color
Max n1 =
576/8 for 80 mm paper or 640/8 for 82.5 mm paper
The latest value from the set current logo command will be the logo index to be used to store the downloaded graphic. m identifies whether the image is monochrome (which requires one parameter bit row description) or two-color, which requires a pairing of bit descriptions for each row. n1 * n2 define a rectangular image n1 bytes wide and n2 bytes long. n1*8 specifies the number of dot columns, and n2*8 the number of dot rows. That is, each row is defined by an integral number of bytes and the number of rows is also an integral number of bytes. Note that n2 can be any length, subject to memory space availability.
For each color dot row starting at the top left, a two part parameter byte string is used to define first, all dots that are not white, and the second half defines all dots where the color = black. Thus all dots that are on (=1) in the first half but not on in the second half select the paper-color. A sequence of these raster row strings is used to specify the complete logo. In the monochrome case, only one bit is needed per row. This is the same structure as used for the definitions of print raster monochrome graphics and print raster color graphics. This command is used for storing a logo of n1 by n2 size indexed by the current logo value. After downloading a logo to the printer, wait 100 ms to allow the printer time to write the logo to flash.
Apply shading to logo (ColorPOS®) ASCII Hexadecimal Decimal
GS Ox8B n m o 1D 8B n m o 29 139 n m o
This command will apply shading effect m to logo n and store it at index o, also extending width to full horizontal size if logo n is not at full paper width.
An application might use a high value of m to shade out the logo if the original image has a significant number of “on” dots to allow for future foreground print readability.
n must be the index value of an existing logo
Note: The old logo size and current justification mode are used to create a new logo image at full paper width size by filling in white space at either or both sides if needed. This new logo will provide for minimal performance impacts when it is selected for use in watermark mode.
0 <= m <= 100, possibly resulting in a logo suitable for background watermark mode use o can be any value, and the logo will be placed according to the current setting of user storage into RAM or flash memory.
After sending the shading command, wait 5 seconds to allow the printer to apply the shading and write the results to flash.
Page 70
70
A760 User Guide: Programming Supplement
Revision F January 2010
Chapter 4: Programming commands
Merge watermark mode (ColorPOS®) ASCII Hexadecimal Decimal
GS Ox8C n m 1D 8C n m 29 140 n m
Default
0 (off )
This command will insert the logo m as a repeated background image, similar to printing a visible watermark, into the print stream. The space between repetitions of this usually shaded logo will be every n*8 dot rows. n >0 = number of dot rows x8 to skip before repeating the merge action m specifies the index value of the logo. If no logo has been defined with this index then the command is ignored.
Note: Horizontal placement of a watermark logo was fixed at the time the logo was Shaded or when it was downloaded as a full width logo for watermark use. This command will be ignored if the current logo is not at full paper width size (see the apply shading to logo command for preparing logos for watermark use). The merge process is performed after all other image formation and takes whatever print raster data is ready to be put on paper. It “adds” (computer logic OR) the mono or color bits to the print row. Generally, if the print dot was to be white or same color as the watermark dot, the print dot will be the color of the watermark; otherwise it will be black.
Monochrome shade mode (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x86 m 1D 86 m 29 134 m
This applies a selected shade density to all monochrome objects such as text and monochrome logos. The parameter m specifies the shading effect and has an initial value of 0 which signifies no effect. m specifies the percentage of shading, 0 <= m <= 100. m = 0 is the initial value and turns this mode off. Note: that only a few gradations will be perceptible, so large increments of m, such as 20, should be used. If a reverse print mode is on, the shade effect will be applied to the background only.
When the current color mode is set to black, increasing values of m relate to the relative amount of (white) paper that replaces black dots. Analogously, when the papercolor is the current color, m defines the relative amount of color dots being “erased” by white originals of the paper. Both text and monochrome graphics are affected by this command. Turning monochrome shade mode on, turns color shade mode off.
Page 71
Revision F January 2010
A760 User Guide: Programming Supplement
71
Chapter 4: Programming commands
Color shade mode (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x87 m 1D 87 m 29 135 m
This applies a mixing of color into any monochrome objects such as text and monochrome logos. Rather than fading away, this mode transitions a character or logo from the current color in which it would normally be printed to the other color. The parameter m specifies the shading effect and has an initial value of 0 which signifies no effect. m specifies the percentage of shading, 0 <= m <= 100. m specifies the percentage of shading, 0 <= m <= 100. m = 0 is the initial value and turns this mode off.
Note: Only a few gradations will be perceptible, so large increments of m, such as 20, should be used. If a reverse print mode is on, the shade effect will be applied to the background only. When the current color mode is set to black, increasing values of m relate to the relative amount of paper-color that replaces black dots. Analogously, when the papercolor is the current color, m defines the relative amount of black color dots replacing the paper-color ones. Both text and monochrome graphics are affected by this command. Turning color shade mode on, turns monochrome shade mode off.
Logo print with color plane swap (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x89 n m 1D 89 n m 29 137 n m
This command will print logo n. The command is ignored if a logo with index n has not been defined. If m = 0 the color(s) as defined in the logo are used; if m = 1 and if the logo is a color one, then the two color planes (black and paper-color) in the logo are swapped.
Page 72
72
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Form and merge real-time surround graphic (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x90 m x y o p q 1D 90 m x y o p q 29 144 m x y o p q
This command will print a real-time graphic style designated by m. m = 0 rectangle, m =1 oval, m =2 ellipse (if printed in a square area the ellipse becomes a circle), m = 3 is a 5 point star, m = 4 is a free hand underline, m = 5 is a free hand ellipse and other values of m reserved for future styles. This graphic is formed into a RAM based graphics buffer, and the buffer state is set to “graphic merge pending”. Whenever the buffer is in the pending merge state and print output is started, the state will be changed to frozen and a merge process started (logically OR-ed graphic data) into the print lines that follow. The application determines how close the graphic is to any printed character data by subsequent printing of blank lines or blank dot rows. The merge process stops when the buffer is exhausted or its state changed (by a save graphics buffer as logo or new form and merge real time surround graphics command). The form and merge real time surround graphics command can be given multiple consecutive times, allowing the application to set up a multi-polygon background before starting its printout with placed text or logo.
The geometric location points for this graphic are defined by a rectangular area start position of x bytes from the left edge and y bytes from the top of the new line and times o bytes wide times p bytes in length. For the case of m =3 (star), the value passed for o is also used as the implicit p value (passed value is ignored), i.e. a square area. The thickness of the graphic is defined by q dots. This will form a bit image in a RAM graphics buffer. Subsequent surround graphic commands can be added into (logical OR process) with expanded size if needed) the graphics buffer until an output action is issued. It is expected that area left white will then be (usually) filled in with text or other data that is to be printed. Printing starts as soon as the first line of data or other printout arrives. After this printing is started, any new surround graphics commands will set the graphics buffer to a merge pending state. Example: Create different size stars and an ellipse around a block of text. The graphics buffer is at a frozen state at printer initialization or reset, with blank data in it. Each time this command is given, the current color and shade mode values (if any) are used for the surround graphic, and may be changed before any subsequent surround graphics and/or printing output. This command may be used in page mode.
Save graphics buffer as logo (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x91 n 1D 91 n 29 145 n
This command will save all the raster data that is in the working graphics buffer (where surround graphics are formed) as a logo with index value n. This logo can then be used repeatedly for inserting different text. See the background logo print command.
There is one working graphics buffer in the printer; its size (and that of the saved logo) is of maximum print width size, and of sufficient length to store the largest of the surround graphic styles defined since the last buffer “freeze” event. This command is ignored if the graphics buffer is not in a “merge pending” state. The graphics buffer state will be set to “frozen” by this command. Related information
This command is ignored in page mode.
Page 73
Revision F January 2010
A760 User Guide: Programming Supplement
73
Chapter 4: Programming commands
Background logo print mode (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x92 n 1D 92 n 29 146 n
This command will place into the graphics buffer the logo designated by n. As soon as there is a print action command (such as text output) the graphics buffer will be merged (logical OR process) with print output.
This command sets the graphics buffer state to “merge pending”, functioning and performing the save as in the form and merge real time surround graphics command. Related information
This command is ignored in page mode.
Shade and store logo (ColorPOS®) ASCII Hexadecimal Decimal
GS Ox9A n m o 1D 9A n m o 29 154 n m o
Value of n:
n is ID (logo index value) of an existing logo in either flash or RAM memory
Value of m:
m is the % of shading to be applied to the logo, 0 <= m <=100.
Value of o:
o is the new ID (logo index value) to be used to store the shaded result, according to the current setting of user storage into flash or RAM.
This command applies shading to an existing logo of any size, storing the result in a new logo at index o. The new logo is thus better suited for use in a merging mode. The % of shading will have only a few perceptible gradations, so large increments (20 is suggested) should be used to achieve visibly distinct effects.
Logo print with knife cut ASCII Hexadecimal Decimal
GS 0x9B m n 1D 9B m n 29 155 m n
Value of m:
0= 1= 2= 3=
Value of n:
01 - FF (Hex) #dot rows = n x 24 n = 5 is the recommended setting
Standard size Double wide Double high Double high/wide
Because the printhead and cutting knife are physically separated, it is necessary to advance the printed area of a receipt past the knife to avoid the last of the printing from being cut off. This advance of paper however, causes a blank space at the start of the next receipt that could be used. To utilize this space and reduce paper usage, this command starts to print a logo for the next receipt before initiating the cut at the end of the current receipt. At a set location during the printing of the logo, the corresponding paper advance is stopped and a paper cut performed.
The formula “n x 24” is used to determine the number of dot rows to move the paper from the start of the logo to the position of the cut. If n x 24 is greater than the height of the logo, the logo height is used to determine the cut position. If n = 0 the cut is eliminated. In order for this command to function properly, all commands used by legacy applications to move the end of the current receipt past the knife should be removed. The command is available only in A795 native mode. Related information
See “Print downloaded bit image” command.
Page 74
74
A760 User Guide: Programming Supplement
Revision F January 2010
Chapter 4: Programming commands
Apply margin message mode (ColorPOS®) ASCII Hexadecimal Decimal
US 0x99 l m n o 1D 99 l m n o 29 153 l m n o
Value of l:
l is a binary switch:
0 = disables margin message merging 1 = enable left margin message merging 2 = enable right margin message merging l> 2 ignore command Value of m:
m is the ID (index) of the logo to be used in the merging. If a logo with index m does not exist or is wider than the print raster width then this command is ignored. Value of n:
n is the number of raster rows to be empty (skipped) before repeating the designated margin message merge
Value of o:
o is a right – left toggle switch:
o = 0 no toggling of the margin message merge o = 1 enable toggling, starting with a left margin message first o = 2 enable toggling, starting with a right margin message first o > 2 ignore entire command
This command performs a dynamic merge of a designated logo/message (or logo/message pair, which can be the same) into each raster line to be printed after the character data has been placed and in conjunction with any other active merge modes. The parameter l specifies whether merging should take place from the left side or the right side. A left side merge followed by a right side merge (or vice-versa) must be issued, with the latter side merge command setting the toggle switch = 1 or 2 will create the desired left – right printing effect. Each merge side retains its n value of raster rows to be skipped. If toggling is not selected when both sides are defined, then if the n skip row values are different, or the logo height sizes are different, the side logos will not line up as printing progresses. If toggling is selected then both left and right sides merge margin message must be defined; otherwise toggling is ignored. Each side logo can be > ½ of the raster print line. In that case the printing process is additive in the overlap region. This command with the first parameter l = 0 turns all margin message merging to off.
Set temporary max target speed ASCII Hexadecimal Decimal
GS 0xA0 nl nh 1D A0 nl nh 29
Values:
15H - B4H monochrome 15H - 64H color
Default:
0 - normal speed
This command sets a specific speed for an operation, allowing the user more control of the print environment.
The speed is maintained as long as it is less than the speed automatically set by power management. A parameter of zero (0) restores the normal max speed.
Page 75
Revision F January 2010
A760 User Guide: Programming Supplement
75
Chapter 4: Programming commands
Set LogoEZ® colorization ASCII
US ETX SYN f s p/t t
Hexadecimal Decimal
1F 03 16 f s p/t t 31 03 22 f s p/t t
Value of f: 0=
1= 2= 3= 4= turn off all LogoEZ® colorization features link print logo after knife cut link watermark printing link margin message printing link logo print before cut
Default:
(Off )
0
This command configures into EEPROM (permanent configuration switch setting) a set of features that allows placement of a color logo in the header, full-time margin message printing, watermarks in the middle of the receipt and printing of a trailer color logo. These commands are triggered by any knife cut command (partial or full: 19, 1A, 1B 69, 1B 6D, 1D 56 m n). The printer when poweredup will (if set) activate the header, watermark, and margin message features and will be ready to print the body of a receipt. For selected features to print however, logos with defined index values of F0, F1, F2, F3 respectively must be saved in the flash memory.
Example: Print logo (#F0) after a knife-cut with “s” dot row spacing before the logo and “a” dot row spacing after the logo (1F 03 16 01 s p). After executing a knife-cut command, if s > 0, execute the following: • stop background merging (1D 9B 1 command)
• skip s (feed paper) dot rows (15 s command) – adds spacing in addition to any set by the application around a knife cut command
• set centered justification (1B 61 1 command), saving the previous justification
• if the logo at F0h is currently defined, print logo by sending print downloaded bit image, normal size (1D 2F 0 command) without changing the value of current logo function selector and defines which parameters are used :
• reset justification to previous value (1B 61 [previous value])
s = dot row space before object distance p = dot row past an object r = repetition space distance in mm t = margin message toggle mode
• skip (feed paper) “p” dot rows after logo (15 p command)
The command is available only in A760 native mode. Once logos have been loaded and enabled they can be used in any emulation mode. Skip distances remain constant. A760 native mode must be used to turn the feature off. Value descriptions: f= f = 0 turn off all LogoEZ® colorization functions (default). No other parameters are required. f = 1 link print logo after knife cut – equivalent to printing a transaction header graphic.
Since the normal space on the receipt paper after a knife cut is 18 mm (144 rows), no extra space is usually needed above the logo. The default value is s = 0 and turns off the f = 1 logo after knife-cut link. continued…
Page 76
76
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands f = 2 link watermark printing
Example: Activate watermark printing using logo #F1 (1F 03 16 02 s r) with “s” being the skip distance in dot rows before activation and “r” is the distance in mm between watermark repetitions. After executing a knife-cut command and the f = 1 steps, if s > 0, execute the following: • skip “s” (feed paper) dot rows (15 s command)
• set watermark printing to “on” using logo F1 (execute merge watermark mode -1D 8C r F1 command). Logo must be defined for F1 and comply with watermark mode requirements in order for this happen.
• f = 3 link margin message printing
Example: Activate margin message printing using logo #F2 (1F 03 16 03 s r t) with “s” being the skip distance, “r” the distance between repetitions and “t” the toggle mode. Toggle mode values for t: 0 = both left and right side 1 = toggle sides, starting with left side 2 = right side margin message only 3 = left margin message only After executing a knife cut command and the f=1 steps, if s > 0, execute the following: • skip “s” dot rows (=15 s command). When both watermark and margin message merging are defined, the respective “s” values are treated independently. The same value should be used to start watermark and margin message at the same place.
•
Use the toggle mode values listed above to apply margin message for the left and/or right side. For a margin message on both sides, enter the 1D 99 1 F2 p 0 command followed by the 1D 99 t’ F2 r t’ (apply margin message) command with the logo at index F2 defined.
• suspend background merging mode (=1D 9B 1 command), so any logos, barcodes, and captured images will print in the clear stop background merging mode (1D 9B 1 command). Clears background for logos, barcodes, and captured images.
The watermarks feature is now activated (following an optional F0 logo) to start after each knife cut. Note that when printing graphic objects, merging is turned off by each knife cut. The default value is s = 0 and turns off the f = 2 watermark link. No correlation exists (when both are set) between watermark and logo skip distances. If the f = 4 logo link is undefined, you should set a null trailer logo with s = 1 and p = 144 (1F 03 16 04 1 90, no logo at index F3). This will turn off watermarks at the position of a knife cut and leave a clear space at the top of the next receipt.
The margin message printing feature is activated after the header logo after a restart at each knife-cut. Note that when printing graphic objects, merging is turned off by each knife cut. No correlation exists (when both are set) between watermark and logo skip distances. If the f = 4 logo link is undefined, you should set a null trailer logo with s = 1 and p = 144 (1F 03 16 04 1 90, no logo at index F3). This will turn off margin message at the position of a knife cut and leave a clear space at the top of the next receipt.
Page 77
Revision F January 2010
A760 User Guide: Programming Supplement
77
Chapter 4: Programming commands f = 4 link logo print before cut
Prints a logo after the skip distance of “s” before a logo and “p” past a logo and performs a knife cut (1F 03 16 04 s p). Immediately before executing a knife-cut command, if s > 0, execute the following: • skip (feed paper) “s” dot rows (15 s command)
• stop background merging (1D 9B 1 command). Save previous background merging value, so logo prints in the clear
Related information
This command is utilized in the CognitiveTPG LogoEZ® utility. The utility can be used to pre-configure new printers with a default colorization setup without requiring any application changes. The default setup was designed to provide a general level of colorization features that would not affect the printer operation. You can expand beyond the default features of the utility by modifying the application at the host. However, do not attempt to modify the settings within the utility. LogoEZ® utility default settings:
• set centered justification (1B 61 1 command), saving the previous justification f = 1: s = 1H a = 30H
• if a logo at index F3h is currently defined, print the logo by sending print downloaded bit image, normal size (1D 2F 0 command), without changing the value of current logo.
f = 2: s = 32H r = 19H
• reset justification to previous value (1B 61 [previous value])
• skip (feed paper) “p” dot rows (15 p command) a minimum value of 90h, to ensure knife cut occurs after the logo
• restore background merge suspension (1D 9B [previous value])
f = 3: s = 1H r = 7H t = 1H f = 4: s = 30H a = A0H
Page 78
78
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Set LogoEZ® attribute mapping ASCII Hexadecimal Decimal
US ETX ETB a m s 1F 03 17 a m s 31 03 23 a m s
Values:
a= a , m, s = 0, 0, 0 attribute map selector turn off attribute mapping (all 3 bytes required)
a=1 selects first attribute mapping definition (of two available)
a=2 selects second attribute mapping definition a = 1 or 2, if m = 0 mapping 1 or 2, respectively, is turned off
A word (2 bytes) is used to identify the attribute mapping, with “m” bits 0 – 6 identifying which original attributes should be mapped:
The following “s” bits and “m” bit 7 set the attributes that substitute for the mapped set:
Original attribute mapped table
Attributes substituted table m bit on attribute mapped m bit on attributes substituted
0
Bold
7
Bold substituted
1
Italic s bit on attributes substituted
2
Reverse
0
Italic
3
Underline
1
Reverse
4
Double high
2
Underline
5
Double wide
3
Double high
6
Compressed print
4
Double wide
5
Compressed print
6
Alternate color
7
Color reverse continued…