TCX Sky Printer API Guide
TCX Sky Printer API Guide
TCx Sky
TC62-0037-10
1
Note:
Before using this information and the product it supports, be sure to read Warranty Information and the information under
“Notices” on page 165.
September 2022
This edition applies to Version 1.3.01 of the licensed program TCx® Sky (program number 4690-SK1) and to all subsequent
releases and modifications until otherwise indicated in new editions.
If you send information to Toshiba Global Commerce Solutions (Toshiba), you grant Toshiba a nonexclusive right to use or
distribute whatever information you supply in any way it believes appropriate without incurring any obligation to you.
© Copyright Toshiba Global Commerce Solutions, Inc. 2013, 2022
Contents
Tables........................................................ 7 Writing a common application for different printer
types.......................................................................................... 30
Figures.......................................................9 Check imaging (TI8 only)...................................................... 31
4610 Microcode Update Utility............................................. 31
Selecting terminals to receive the update..................... 32
About this guide..................................... 11 Running the 4610 Microcode Update Utility .............. 32
Who should read this manual...............................................11 New error codes............................................................... 32
Where to find more information...........................................11 Options for maintaining printer firmware
TCx Sky Library................................................................11 (microcode) and other printer components........................ 33
Notice statements....................................................................12 4610 and 6145 - Automatic Microcode Update
Function............................................................................. 33
6145 - Automatic Printer Maintenance and
Summary of changes............................. 13 Customer Printer Control................................................34
September 2022........................................................................13 Automatic printer maintenance..................................... 34
November 2021........................................................................13 Customer printer control.................................................34
March 2021............................................................................... 13 4610 Printer reporting of electromagnetic noise.................36
May 2020.................................................................................. 14 2Cx, 2Nx, and 1Nx Mode Switch Utility............................. 36
December 2019.........................................................................14 4610/6145 Self-test utility....................................................... 36
March 2019............................................................................... 14
Contents 5
6 4610 Application Interface Specification
Tables
1. New 4610 Printer Driver Error return codes...................19
2. Terminal Application Status Printer Information.......... 26
3. Terminal application status printer information for
TI8 Printers...............................................................................28
4. Entries from sample text file ADXUSBPU.SMP............. 34
5. Read buffer...........................................................................38
6. Status byte 1......................................................................... 40
7. Status byte 2......................................................................... 40
8. Status byte 3......................................................................... 41
9. Status byte 5......................................................................... 42
10. Status byte 7....................................................................... 42
11. Status byte 8....................................................................... 43
12. Sense codes for 80900524 errors...................................... 43
13. MICR Data Buffer............................................................. 44
14. User Flash Buffer (Flash EPROM Memory).................. 44
15. Size of User Flash.............................................................. 45
16. Check Image Header........................................................ 45
17. Check image data..............................................................45
18. MICR and check image size data....................................45
19. Checksum data ('K')..........................................................45
20. Extended status data ('X')................................................ 45
21. Extended status description............................................ 46
22. Device identification description....................................51
23. GETLONG byte EE........................................................... 55
24. GETLONG byte LL........................................................... 55
25. GETLONG byte MM........................................................ 55
26. GETLONG byte SS............................................................56
27. PUTLONG byte EE........................................................... 57
28. PUTLONG functions........................................................ 57
29. GETLONG byte EE........................................................... 62
30. GETLONG byte LL........................................................... 63
31. GETLONG byte MM........................................................ 63
32. GETLONG byte SS............................................................63
33. Printer memory sector default sizes...............................65
34. MCT command definitions..............................................77
35. Code 128 character set ..................................................... 97
36. Print bar code examples................................................. 100
37. ECI Values and Character Sets......................................106
38. Characters to be encoded...............................................108
39. Details for example 2: method 3................................... 134
Important: These notices provide information or advice that might help you avoid
inconvenient or problem situations.
September 2022
This edition of TCx Sky 1.3.01 includes:
• Improve terminal load after STC
• Terminal application to execute thermal printer head self-test
• Create log file for iButton script
• New example python script to update terminal load definitions for new static IP address
• Configuration improvements to support LDAP certificates when connecting to external
servers
• Support of LDAP permission groups and sAMAccountName
• New ADXSERVE function to start terminal application
• Multiple USB configuration/firmware update files in a store
• User-defined properties to define key sequences
• Command for listing opened files on 4690OS
• Partition size of C: and D: drives enabled to up to 126 Gb
• Additional MBrowser flags
• Create controller Ram Disks T, U, V and W before execution of preload and IPL frame 3
• Add new MBean to handle IP, mask, and MAC address
• Increase write printer buffer size to 4 Kb
• F: drive as a CPAD drive output
• MBrowser extension decoupled from OS
November 2021
This edition of TCx Sky 1.3 includes:
• Controller async for CBasic apps
• Encrypted paging volume
• Zip format for combine/compress files
• Log to RAM support
• exFat file system
• Multiple message descriptor files
• SDK package
• USB audio devices support
• FC 7378
• TCx 810 6201
• RMA failure statistics for compatibility mode printers
• RxTx extension on controller
• Common Firmware Update utility improvement
• Purge both IOP queues on a purge operation
• Serial logical ports
• Netop on second display
• Improve F: drive low disk space logging
March 2021
This edition of TCx Sky 1.2.02 includes:
• Size parameter for CPREP and DPREP commands
May 2020
This edition of TCx Sky 1.2.01 includes:
• Terminal support of SSH
• Offline Terminal support
• Offline Terminal dump
• Daemons
December 2019
This edition of TCx Sky 1.2 includes:
• The addition of the Sky Product Build tool for generating Product Control files
• Support for Python 3 and terminal support of Python applications
• Container updates
• Support for TCx 300 4810-3x0 and 3x1
• Support for TCx 700 4900-xx6 and xx7
March 2019
This edition of TCx Sky Version 1 Release 1.2 includes support for iButton, KVM support, DB
support for postgres, Remote terminal hard drive format, Rxtx - Locking to serial port, extended
graphics screen support of pseudo keypad, and Windows preload system support. Includes fixes
and security updates.
The enhancements to the operating system allow you to access the features of the 4610 and 6145
printers for the following functions:
• Increased print speed
• One pass check reading/printing
• Post printing of receipts
User applications must use electronic journaling because the 4610 printers have no journal station.
A new POS printer family, 6145, was released in 2018. The 6145 printers have increased print
speed, as well as some new commands. 6145 printers are compatible with the 4610 printer
family. References to 4610 printers and the 4610 printer family in this document also cover the
6145 printers, unless otherwise specified. Likewise, 6145 specific functions or commands will be
noted.
Restrictions
When using storage retention on a terminal running the operating system, the terminal must
be reloaded if a different 4610 printer is attached. Reloading the terminal is necessary due to
the interaction between the application, driver, and flash memory in the printer. Unpredictable
results might occur if the terminal is not reloaded.
The 4610 family of printers have several differences from previous POS terminal printers. One
major difference is the lack of a journal station on the 4610 printers. The printer family also uses
a superset of the Epson printer command set. The lack of a journal station causes the application
to compensate by using electronic journaling.
Another feature of the 4610 printers is the increased speed of the receipt printing. This increased
speed enables the application to take full advantage of performance enhancements. The basic
application philosophy of scan, print, scan, print has changed. In order for the printer to operate
at its optimum capability, the printer has at least two print lines available for processing while
the current line is printing. Therefore, the application batches the print lines.
Batch printing can be used in the following ways:
• Printing groups of lines
• Printing an entire receipt at the end of a transaction, referred to as post printing
• Printing of clean receipts, which refers to post printing while grouping like items into single
lines and eliminating the printing of voided items
Other printer enhancements that increase print speeds are the ability of the 4610 printers to store
logos or other graphics and sets of predefined messages. These stored logos or messages can
then be selected by a number without having to re-send the data to the printer.
4610 Printer Models TI1, TI2, TI3, TI4, TI5, TI8, TI9, TM6, TM7, 2Cx, 2Nx and
1Nx features
Features of the 4610 Printer Models TI1, TI2, TI3, TI4, TI5, TI8, TI9, TM6, TM7, 2Cx, 2Nx and 1Nx
are:
• Cash Receipt Station - Thermal printing
• Document Station - Impact printing (except Models TM6, TM7, and 1Nx)
• User-defined character sets
• Bar Code printing capability (Cash Receipt/Thermal only)
• MICR character reading (Models TI2, TI4, and TI9 only)
• Paper Cutter
The additional features of the 4610 Printer Model TI8 and TI9 include:
• Check Scanner
• OCR MICR
Note:
1. The Thermal print station prints up to 26 lines per second for Models TI1 and TI2
and up to 52 lines per second for Models TI3 and TI4. To maintain this rate, the
printer prints one line while processing the next line. The system is at least one line
of ahead of the printer; otherwise, the print speed is significantly less than the rated
specification. Models 2Cx, 2Nx, and 1Nx print up to 80 lines per second.
2. The printer tries to recover and reprint the line before sending an error message
to the system. If the error message gets to the system drivers, the error message
indicates that the printer tried to reset the print head but was unsuccessful.
After an error condition is corrected, the system either automatically releases the
print buffer, or waits for a Set Error Recovery Function to cancel the print buffer
Printer Reset
Upon a power-on reset (POR or PLD) or a Reset command that is sent from the terminal, a test
is run on the ROM to verify code integrity and on the RAM to verify that every location can be
written to and read from.
Note: When the printer cover is closed, all motors are reset. However, the printer is not
re-initialized and the RAM data is not changed. The data left in the RAM buffer is printed
approximately 2 seconds after the cover is closed unless the system cancels the print
buffer.
Character fonts
Thermal Printing Fonts: There are three font sizes for the resident character set:
Font A is 10 dots (wide) x 20 dots (high), with the last 2-dot row used for descenders or 1.25 mm
x 2.5 mm character height including descenders (1.25 mm x 2.25 excluding descenders).
Font B is 12 dots (wide) x 24 dots (high) with the last 2-dot row used for descenders or 1.5 mm x
3.0 mm character height including descenders (1.5 mm x 2.75 excluding descenders).
Font C is 8 dots (wide) x 20 dots (high) with the last 2 dot rows used for descenders or 1.0 mm x
2.5 mm character height including descenders, 1.0 mm x 2.25 excluding descenders.
Tall A is 10 dots (wide) x 24 dots (high) with the last 2 dot rows used for descenders or 1.25 mm
x 3.0 mm character height including descenders, 1.25mm x 2.75 excluding descenders.
Impact printing fonts: The resident character set has a font of 7 half-dots wide x 9 dots high.
There are no descenders.
Font A prints 150 half-dots per inch = resident character size is 1.2 mm x 2 mm.
Font B prints 120 half-dots per inch = resident character size is 1.5 mm x 2 mm. You can choose
the character size of the user-defined character sets within the following parameters:
• 4 ≤ half-dot width ≤ 16
• 4 ≤ dot height ≤ 16
Changing between font A and B changes the actual width on these characters. The characters
per inch printed depends on the character size, inter-character spacing, and the specific font. For
example:
• 17 CPI ⇒ Font A with 7-half-dot wide character + 2-half-dot space ⇒ 52 characters/line
• 15 CPI ⇒ Font A with 7-half-dot wide character + 3-half-dot space ⇒ 47 characters/line
• 12 CPI ⇒ Font B with 7-half-dot wide character + 3-half-dot space ⇒ 37 characters/line
Note: The Document Print line is 80.35 mm (3.16 inches) long. There are 474 half-dots per
line for font A, and 379 half-dots per line for font B.
Return codes
The following table identifies new or changed error codes returned by the 4610 printer driver.
Previously defined printer errors (X'8090nnnn') can also be seen with the 4610 printers if the
error is identical to the error encountered on earlier printers.
Refer to the 4680 BASIC: Language Reference for a list of BASIC error codes. Refer to the TCx Sky
Programming Guide for a list of C Interface error codes. Refer to the TCx Sky Messages Guide for a
list of system error codes.
This chapter explains the application print modes, as well as information on accessing the
printer. This chapter uses BASIC syntax for examples. However, these operations can also be
performed using C language.
Stream mode
In contrast to previous printers that were print line based, the 4610 printers are stream based.
Stream based means that print commands and data of varying lengths can be sent to the
printer for processing. In order to give the application the maximum freedom to use all of the
capabilities of this new printer family, the printer driver exercises less control over the printer
commands. Therefore, many more responsibilities are moved to the application. An error is
returned if a buffer larger than that which is currently supported is used. (See Table 1 for error
code information.)
Selecting stations
With the 4610 printers, the application must select the station using the Set Print Mode command
(see “Set print mode” on page 80). Although communication to the printer driver is available
using both the CR and the DI, for BASIC language compatibility reasons, this method is not used
by the driver to select the print station. The application must select the station in the printer data
stream.
The CR: and DI: printer stations continue to be available (if the printer supports the DI: station).
However, because the 4610 printer command set allows the application to select the print station
in the data stream, an application can access any available printer station by writing to the
session opened for the CR: station. On the other hand, it can enhance program readability to
perform document prints by writing to the session opened for the DI: station. Either method
works, but the application must select the appropriate station or the printer that goes to the
currently selected station regardless of the session to which the WRITE statement was issued.
Selecting station
The driver causes the appropriate station to be selected based on the session number used in the
WRITE statement. The driver also verifies that the data from the application does not contain a
command to switch stations and returns an error code signaling that invalid data was passed, if
such a command is found. (See Table 1 for error code information.)
Continuing commands
Because the 4610 printer receives command streams, commands longer than a single buffer can
be continued by using the Continuation of Previous Command. The Continuation of Previous
Command is used when downloading logos, graphics, or code pages. (See “Continuation of
previous command” on page 123.)
X'00'
Pre-4610 printer attached
X'30'
4610 TI1-TI7 printer or TI8/TI9 running TI3/TI4 emulation
mode attached
X'31'
TI8 or TI9 4610 in native mode attached (see Table 3 for
details of TI8/TI9 feature byte definitions)
Note: If the device type is X'00', then offset 54 through offset 57 are also X'00'.
54 1 Printer Device ID
X'00'
Model TI1 or TI2 (Impact DI/Thermal CR)
X'01'
Model TI3, TI4, TI8, 4610 2CR/2NR (compatibility mode) or
6145-2TC/2TN/1TN (compatibility mode)
X'02'
Model TI5 or TM6 DBCS, 4610-2NR DBCS and 6145-2TN
DBCS (compatibility mode)
X'03'
Model TM6 - Single Station Printer - 512K (Thermal), 4610
1NR (compatibility mode), 6145 1TN (compatibility mode)
X'04'
Model TI3 or TI4 (8MB)
X'05'
Model TM6 8-MB Single Station Printer (Thermal)
X'07'
Model TM7 - Single Station Printer - DCBS/2MB (Thermal),
4610 1NR DBCS (compatiblity mode), or 6145 1TN DBCS
(compatibility mode).
X'08'
Model 4610 2Cx, 2Nx, 1Nx Printer, or 6145 2TN, 2TR, 1TN
X'09'
Model 6145-2TC/2TN/1TN after the Enable True Reporting
command is sent
55 1 Printer Features
• Bit 0 (X'01') set to 0 No MICR is present
• Bit 0 (X'01') set to 1 MICR is present
• Bit 1 (X'02') set to 0 No check flipper is present
• Bit 1 (X'02') set to 1 Check flipper is present
• Bit 2 (X'04') set to 0 2-MB flash is not present
• Bit 2 (X'04') set to 1 2-MB flash is present
• Bit 4 (X'10') set to 0 DBCS mode is off
• Bit 4 (X'10') set to 1 DBCS mode is on (Bit 2 must also be on)
• Bit 5 (X'20') set to 0 2-MB flash is not used for user storage
• Bit 5 (X'20') set to 1 2-MB flash is used for user storage (bit 2
must be on also)
• Bit 6 (X'40') set to 0 No two-color support is present
• Bit 6 (X'40') set to 1 Two-color support is present
X'31'
TI8/TI9 4610 in native mode attached
54 1 Printer Device ID
X'01'
Model TI8/TI9
55 1 Printer Features
Bit 0 - 7
Reserved
57 1 EC level of code loaded in the printer (hexadecimal)
Performance considerations
Two advantages of the 4610 printer family are the speed and the low noise (of the thermal
station). In order to take full advantage of the increased speed of the thermal print station, the
application must be modified. The operating system and the microcode have several features
that can be used to reach the speed potential of the 4610 printers.
Status bytes
In previous printers, the printer status information was manipulated by the printer driver and
presented to the application using the GETLONG command. This method restricted the amount
of status information that is available to the application to 4 bytes. The 4610 printers return at
least 8 bytes of status information. The application is allowed access to this status information,
as well as additional driver status information, using the READ command. (See “READ # LINE
statement” on page 38 for the layout of the read data.) This method allows the application to
know the exact status of the printer.
For additional control, the application can request that it be notified of certain status state
changes. The Status Sent to System command (see “Status sent to system” on page 141) is used
in conjunction with the WAIT statement to allow the application to wait on the state change
for various conditions. For example, the application could request to be notified when the DI
sensors change state in order to wait for a document to be inserted. This method reduces the
need to check the status of the printer by using the GETLONG statement in a loop.
Handling errors
Invalid data
There are two error codes indicating that the data sent to the printer on a WRITE command is
invalid: X'80900524' and X'80901524'. Neither of these commands can be retried using a RESUME
command because the data is incorrect and cannot be processed.
The X'80900524' error code indicates that the data contained at least one of the following types of
incorrect data:
• A command was not included in the documented command set.
• A command that is not completed before the end of the print buffer, unless the command is a
down load command that allows continuations.
• If honor station mode is enabled, an attempt was made to select a print station other than that
of the current session number.
The X'80901524' error code is used to indicate that the write data buffer is too large (see Table 1
for error code information).
Line count
To provide error recovery during buffered printing (either when lines are buffered in the printer
or actually held), the printer hardware and the printer driver keep a line count of the commands
that are being sent to the printer. The line count is incremented when any command in “Print
character commands” on page 108 is encountered, as well as some other special commands as
marked in the command descriptions. The line count is reset when a TCLOSE is processed.
Status byte 6 contains the line count of the last print line that has successfully completed. The
application has access to the current line count using the READ command (see “READ # LINE
statement” on page 38 for the layout of the data returned to the printer). However, the printer
hardware and the printer driver are responsible for coordinating the line count usage.
The customer must use the 0F66 VendorID, 4535 ProductID, and 05xx EClevel for all firmware
and additional component entries for the 6145-2TC and 6145-1TN printers. CompId identifies
Printer firmware
If a valid firmware entry (0 CompId) exists in ADXUSBPU.DAT, then TCx Sky will control the
printer firmware updates using the file(8.3) and EClevel specified in the entry:
• Automatic Printer Maintenance (even if property is set) will be disabled.
• Automatic Microcode Update Function (even if logical name is set) will be disabled for 6145
printers.
• If the EC level in the printer is less than the EClevel contained in the ADXUSBPU.DAT entry,
TCx Sky will attempt an update using the file(8.3) file.
Printer settings
Defines default code page, default fonts, low paper indications, paper saving options,
watermark options, and many more.
Fonts
Provides user defined fonts, including proportional fonts and Double Byte (DBCS) fonts
for both the thermal (Customer Receipt or CR) and impact (Document Insert or DI)
stations.
Resident Messages
Provides up to 255 different predefined print messages that can be loaded and printed by
a single command. These messages can be used for standard text and/or graphics.
Resident Graphics
Provides up to 255 different predefined graphics that can be loaded and printed by a
single command. These graphics can be used to store the company logo printed at the top
of a receipt or a watermark that is printed on a receipt.
When enabled, the 4610 firmware will return an indication that there was excessive
electromagnetic noise on a particular MICR read command. The driver, upon receiving a MICR
read response including this signal, will include the one byte noise amount in the 4610 read
response block such that the application can determine if the noise exceeds some threshold
(determined by the application) and respond appropriately.
ADXTAL4L [–N | -C ]
Where –N indicates ADX4610N should load and –C indicates ADX4610C should load. See the
above “4610 and 6145 - Automatic Microcode Update Function” on page 33 for more details on
the ADXTAL4L utility.
This chapter contains the BASIC commands that are used to access or write to the 4610 printer.
Refer to the 4680 BASIC: Language Reference for detailed information on BASIC statements.
OPEN statement
Use the OPEN statement to gain access to the printer driver.
OPEN { "CR:" | "DI:" } AS number
CR
Customer receipt station
DI
Document insert station
number
A 2-byte integer variable or constant with a value of 1 to 99.
Note: The SJ: station is not supported on the 4610 printers. Any attempt to open the SJ:
station causes an error to be returned to the application. The return code is X'8090000A',
device not attached.
Note: Some models of the 4610 printers do not have a document insert station. Any
attempt to open the DI: station on such a printer causes an error to be returned to the
application. The return code is X'8090000A', device not attached.
WAIT statement
Use the WAIT statement to wait for data to become available from the printer driver.
WAIT number ; timeout.var
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement.
timeout.var
A 4-byte integer variable or constant that specifies the number of milliseconds to wait for
data to become available from the printer driver.
Note: Your application can wait on data from other device drivers while waiting for data
from the printer driver. Refer to the WAIT statement in the 4680 Basic: Language Reference
manual for details about waiting on data from multiple device drivers. (See “Status sent
to system” on page 141 for information regarding what events on which you can wait in
the 4610 driver.)
EVENT% function
Use the EVENT% function to determine if data has been received from the printer driver.
i2 = EVENT %
i2
A 2-byte integer that is set to one of three values:
0000
No data has been received. The timeout value specified in the WAIT statement
(timeout.var) has elapsed.
other value
Data has been received from the driver that was assigned the 2-byte integer value
on the OPEN statement.
Note: A WAIT on multiple device drivers was issued.
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement
var$
A single string variable to contain the information from the printer.
The data obtained from a READ # LINE is formatted as follows:
Note:
1. Offset 10 added a new ‘X’ indicator for eXtended status bytes (8 additional bytes in
the variable data field plus new device information data for a total of 32 bytes) and a
new ‘K’ indicator for checKsum for individual stored messages or logos (2 bytes).
2. Offset 26 added a new field to determine the maximum write length available
3. Offset 27 changed from a single bit to a byte value
4. Offset 28 is a new flag byte to report non-error status indicators
5. When printer models 2Cx, 2Nx, and 1Nx are in native mode, the application should
use the information from the extended status (‘X’) data to determine the capabilities
of the printer instead of basing this on the information in bytes 53 – 57 of the
application status obtained from the ADXSERVE call. The application should still
0 Reserved
1 0 Not DI landscape capable
1 1 DI landscape capable
2 0 Not DI station multi form capable
2 1 DI station multi form capable
3 0 No MICR reader present
3 1 MICR reader present
4 0 No check flipper present
4 1 Check flipper present
5 0 No check scanner present
5 1 Check scanner present
6 Reserved
7 Reserved
Reserved
Note:
The maximum size of check image data that can be read in one request is 16K bytes.
Most TIFF formatted images are within this size limit. However, should an image be
larger than 16K bytes, the application can retrieve the data by using multiple requests. An
outline of required steps to do this follows:
1. Send a request to the printer to scan the check.
2. TCLOSE
3. Send a request to the printer to retrieve image header data, which includes the size of
the image data.
4. Issue a read to the driver to move the header data to the application.
5. From the header data, determine the number of bytes of image data.
6. Send a request to the printer for the first 16K bytes of data.
7. TCLOSE
8. Issue a read to the driver to move this data to the application.
9. Until all of the data is retrieved, send additional requests to the printer for the each
additional section of image (offset is included in the command).
10. TCLOSE
11. Issue a request to the driver to move the data.
ReadImage subprogram
A ReadImage subprogram has been added to the 4690 OS V3R3 big memory model BASIC
terminal runtimes to enable efficient check image retrieval from a 4610 TI8 printer directly into
the application's string variable. If the string variable is too short, it is freed and a new one
allocated from the application heap. ReadImage behaves like other BASIC I/O functions, in that,
errors are handled by the runtimes and passed to the current ON ERROR handler.
ReadImage must be defined within the application as follows:
• SUB ReadImage(SESSNUM, A$, LENGTH) EXTERNAL
• INTEGER*2 SESSNUM
• STRING A$
• INTEGER*4 LENGTH
SESSNUM
Session number of the CR: or DI: station
A$
Name of string variable
LENGTH
Number of bytes to read with a maximum of 16K.
This subprogram is not available for the medium memory model due to memory constraints.
WRITE # statement
Use the WRITE # statement to write the data to the printer driver.
WRITE # number var$
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement.
var$
A single string variable to contain the information to be sent to the printer (see Chapter 6,
4610 printer commands on page 65).
Note: The maximum size of a WRITE buffer is reported at offset 26 and 29 of the READ
buffer table (Table 5).
RESUME statement
Use the RESUME statement to recover from an error associated with an OPEN, READ,
GETLONG, PUTLONG, or CLOSE statement. Use the ON ASYNC ERROR CALL statement
for errors associated with a WRITE # statement.
RESUME { | RETRY label }
RETRY
Enables the statement that caused the error to execute again.
label
A BASIC label local to the program module that identifies a statement to receive control
in the event of an error.
GETLONG statement
Use the GETLONG function to get status information from the printer driver.
i4 = GETLONG ( number )
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement
The integer represents information in the form EELLMMSS. EE, LL, MM, and SS each represent
one of the four bytes.
PUTLONG statement
Use the PUTLONG statement to make changes to printer modes.
PUTLONG number , i4
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement.
i4
A 4-byte integer that represents the requested mode changes for the printer.
The integer represents information in the form EEFFPPPP. EE, FF, PP, and PP each represent one
of the four bytes.
EE
Determines the printer driver mode. If the high order bit (X'80') is on, the printer driver is
set for enhanced mode and 4610 printer commands are accepted. The high order bit must
be on to use 4610 printer commands.
FF
The function to perform.
PPPP
The parameter associated with the function to perform.
If the system does not have enough resources to satisfy a request to increase the buffer, a return
code of X'80900000' is returned to the application. The resource size currently in effect is not
changed.
'M' (X'4D') 0 (X'0000') 1 (X'0001') 0 (X'0000') Set the mode of the printer driver.
or 'W' The default mode is stream mode (0),
(X'57') where the application communicates
more directly with the printer hardware
by sending it a stream of data using
the driver. The other mode is honor
station mode (1), where the driver
performs a small amount of verification
and manipulation of the print data.
Specifically, when the application
issues a WRITE to the CR: station, the
driver embeds the command, X'1B 63
30 02' (see “Set print station” on page
85), at the beginning of the print data
to cause the printer to select the CR:
station. The driver also checks the data
in the buffer to ensure that the buffer
does not contain a command to select
the DI: station. An error is returned
to the application if such a command
is found. (See Table 1.) The driver
processes WRITE commands to the DI:
station in a similar manner.
'D' (X'44') 0 (X'0000') 1 (X'0001') 0 (X'0000') Set the DI: station print orientation.
• 0 = portrait mode
• 1 = landscape mode
This is only valid if honor station mode
is in effect. If stream mode is in effect,
use the Set Print Station command (see
“Set print station” on page 85) to
select the orientation.
See Example “Using the PUTLONG command” on page 146 for an example of using the
PUTLONG command.
TCLOSE statement
Use the TCLOSE statement to suspend the application program until all outstanding print lines
have been printed at all printer stations. Do not issue a TCLOSE statement from an ON ASYNC
ERROR CALL statement subprogram.
TCLOSE # number
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement.
CLOSE statement
Use the CLOSE statement to end communication with the printer driver.
CLOSE number
number
The same 2-byte integer variable or constant assigned to the printer driver in the OPEN
statement.
This chapter provides information on using C commands to access the 4610 printer. Each
command also shows the equivalent BASIC statement. For detailed information on writing
applications with C, refer to the TCx Sky Programming Guide.
adx_topen()
Use adx_topen_device() to gain access to the printer driver.
BASIC
OPEN
C Interface:
int adx_topen_device(char_far *name);
Where:
name
Is one of the following:
"CR"
Device name to access the printer customer receipt station.
"DI"
Device name to access the printer document insert station.
Note:
1. The SJ station is not supported on the 4610 printers. Any attempt to open the SJ
station causes an error to be returned to the application.
2. Some models of 4610 printers do not have a document insert station. Any attempt
to open the DI station on such a printer causes an error to be returned to the
application.
The returned value is one of the following:
• If the operation is successful, the return value is the 2-byte session number for the application
to use to access the printer driver.
• If the operation fails, a negative value (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
adx_twait()
Use adx_twait_device() to wait for data to become available from the printer driver.
BASIC
WAIT
C Interface:
int adx_twait_device(unsigned long wtime, unsigned int wcount, int _far *sessions)
Where:
wcount
Number of pipes and devices to wait for.
Note: Your application can wait on data from other device drivers while waiting
for data from the printer driver. Refer to the TCx Sky Programming Guide for more
information on the adx_twait_device() and for details about waiting on data from
multiple device drivers.
sessions
An array containing the session number returned from adx_topen_device() for the printer
driver.
The returned value is one of the following:
• If the operation is successful, one of the following two values is returned:
• A return value of 0 indicates the specified time expired before data was available from a
device or pipe in the session number array.
• A positive return value is the position in the session number array of the device or pipe
that has data available. If the return value is the position of the printer driver in the
session number array, data is available from the printer driver.
• If the operation fails, a negative value (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
adx_tread_device()
Use adx_tread_device to read the data from the printer driver.
BASIC
READ
C Interface:
long adx_tread_device(int session, unsigned char _far *buffer, unsigned long length);
Where:
session
Session number returned from adx_topen_device() for the printer driver.
buffer
Pointer to the buffer to contain the data read from the printer driver. See Table 5 for the
layout of the read data buffer.
length
Size of the read buffer. The maximum is 290 bytes.
The returned value is one of the following:
• If the operation is successful, the number of bytes read from the printer driver is returned.
• If the operation fails, a (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
BASIC
WRITE
C Interface:
long adx_twrite_device(int session, unsigned char _far *buffer, unsigned long length);
Where:
session
Session number returned from adx_topen_device() for the printer driver.
buffer
Pointer to the buffer containing the command data to issue to the printer driver.
length
Size of the write buffer. The maximum size of a WRITE buffer is reported at offset 26 and
29 of the READ buffer table (Table 5).
The returned value is one of the following:
• If the operation is successful, the number of bytes written to the printer driver is returned.
• If the operation fails, a (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
adx_tputlong()
Use adx_tputlong() to change the options of the printer driver.
BASIC
PUTLONG
C Interface:
int adx_tputlong(int session,*(unsigned long *)&data)
Where:
session
Session number returned from adx_topen_device() for the printer driver.
data
Use the PRINTOPT_t structure to map the input.
typedef struct
{
unsigned char mode;
unsigned char function;
unsigned int parm;
} PRINTOPT_t;
PRINTOPT_t data;
function
Function to perform.
parm
Parameter associated with the function to perform. See Table 28 for the allowable
functions.
The returned value is one of the following:
• If the operation is successful, a 0 is returned.
• If the operation fails, a (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
Note: This function takes an unsigned long type variable as input. However, with the 4610
printers, the variable is declared as a struct. Therefore, in the call to adx_tputlong, the
address of the structure is taken, cast to an unsigned long pointer, and the data that this
pointer references is passed. This explains the *(unsigned long *)&data in the call above.
adx_tgetlong()
Use adx_tgetlong() to get status of the printer driver.
BASIC
GETLONG
C Interface:
int adx_tgetlong(int session, unsigned long _far *status);
Where:
session
Session number returned from adx_topen_device() for the printer driver.
status
long variable with the format EELLMMSS as defined in the following tables.
adx_tclose_device()
Use adx_tclose_device() to end communication with the printer driver.
BASIC
TCLOSE
C Interface:
int adx_tclose_device(int session);
Where:
session
Session number returned from adx_topen_device() for the printer driver.
The returned value is one of the following:
• If the operation is successful, a 0 is returned.
• If the operation fails, a (-1) is returned.
For a description of error values, refer to “Errors” on page 64.
Errors
A return value of (-1) from a printer driver function indicates that an error has occurred in its
execution. The error code is placed in the global variable, adx_errn, and the session number is
placed in the global variable, adx_errf.
Refer to Table 1 for a list of error codes returned by the printer driver.
This chapter describes the printer commands for the 4610 printers.
Note: The RS485 commands also apply to the 4610 USB printers.
Sector Function
1 Downloaded graphics commands
2 Predefined (stored) messages
3 Two user-defined character sets
4 Four user-defined character sets
5 User flash storage
Additionally, the TI8 printer allows greater flexibility with how the printer memory is to be
allocated. The user has the option to not allocate memory for one function, and to add that
memory to another function. The User Defined Impact and Thermal Characters are restricted to
64 KB. There are 16 64 KB sectors for a total of 1MB of FLASH memory available for allocation.
The MCT locations are assigned to each function. The MCT value represents the number of 64
KB sectors that are assigned to the respective function. To change the memory allocation of any
one function, all memory partitions must be empty or erased. If the memory is not erased, a
MCT write error status is returned. After the MCT values are written, the new values do not
become effective until after the printer is reset. The new memory allocations start with the lowest
MCT address and increment higher. Memory is allocated until all requests are met, or until all
available memory is used. Printers available following the TI8 printers have various amounts of
memory available for the user. Refer to the hardware specifications for details on the memory
capacities of later printers.
The TI8 printer memory sectors default to the following sizes:
RS485 syntax:
X'1D;2A;logo#;n1;n2;data'
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(2AH)+CHR$(LOGO#)
PSTR2$=CHR$(N1)+CHR$(N2)+DATA
PSTRING$=PSTR1$+PSTR2$
where:
logo#
Number of the logo or graphic that is being stored
1 ≤ logo# ≤ 40 (255 for TI8)
n1
One-eighth the number of dots in the horizontal direction (width = 8 x n1)
1 ≤ n1 ≤ 72 for a Thermal Logo
1 ≤ n1 ≤ 59 for an Impact Logo
n2
One-eighth the number of dots in the vertical direction (height = 8 x n2)
1 ≤ n2 ≤ 255 for a Thermal Logo
1 ≤ n2 ≤ 5 for an Impact Logo
data
Data to form the graphics image. The number of data bytes for the image is n1 x n2
x 8.
Remarks:
These messages can be positioned on the page using the commands for setting positions.
See “Set horizontal tab positions” on page 91 through “Set relative position” on page
92. Decimal values are shown, but all parameter values (logo number, n1, n2) must
be hexadecimal values when sent to the printer. The dot density of these messages is
specified when the message is printed. See “Print predefined graphics (logo) command”
on page 112. The total number of data bytes defined for all (up to 40) defined graphics
messages must be less than 64K minus 160 bytes. If definitions exceed this limit, an error
message is sent and the rest of the command is ignored. This command should only be
sent when the data buffer is empty.
Example:
n1 = 2 & n2 = 2
slice # → 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Data bytes
row # ↓ Bit # ↓
0 (MSB) 7 X . X . X . X . X . X . X . X . 1 2
1 6 X . X . X . X . X . X . X . X . 3 4
2 5 X . X . X . X . X . X . X . X . 5 6
3 4 X . X . X . X . X . X . X . X . 7 8
4 3 X . X . X . X . X . X . X . X . 9 10
5 2 X . X . X . X . X . X . X . X . 11 12
6 1 X . X . X . X . X . X . X . X . 13 14
7 (LSB) 0 X . X . X . X . X . X . X . X . 15 16
8 (MSB) 7 . X . X . X . X . X . X . X . X 17 18
9 6 . X . X . X . X . X . X . X . X 19 20
10 5 . X . X . X . X . X . X . X . X 21 22
11 4 . X . X . X . X . X . X . X . X 23 24
12 3 . X . X . X . X . X . X . X . X 25 26
13 2 . X . X . X . X . X . X . X . X 27 28
14 1 . X . X . X . X . X . X . X . X 29 30
15 (LSB) 0 . X . X . X . X . X . X . X . X 31 32
Data Byte 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Data Byte 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
Error conditions:
Flash EPROM Load Error - Verify that this sector was erased before downloading the
images.
Memory Sector is full - This sector can store up 64K minus 160 bytes worth of graphics
data. After that, the sector is full.
Notes:
For thermal graphics messages of a character height - 24 dots high, across the page
(n1 = 72, n2 = 3) would take over 2000 bytes of data. Because RS485 cannot send this
many bytes, the command can be divided into several I-Frames using the command
“Continuation of previous command” on page 123.
n2
One-eighth the number of dots in the vertical direction. (Height = 8 x n2)
1 <= n2 <= 255 for a Thermal Logo.
logo#
The logo number that is being stored.
1 <= logo# <= 255
Ctrl
Control byte describing the image
• Bit 7 - Reserved
• Bit 6 - Reserved
• Bit 5 - Reserved
• Bit 4 - Reserved
• Bit 3-0 = x’0’ 4610/6145 format
• = 0x01 for 16 bit greyscale image (6145 only)
• = 0x02 Reserved for future use
• = 0x03 BMP image format, (TI8/9 EC level 69 and greater, 1NR/2xR,6145)
BC1BC2
Number of data bytes being downloaded. Total = BC1 x 256 + BC2.
data
The data to form the graphics image.
For 4610/6145 format the number of data bytes for the image is n1 x n2 x 8.
For greyscale,
The number of bytes of data is contained in the BMP file or data section of the command
structure, not in BC1;BC2. BC1 and BC2 are ignored in this case.
Data format of 1 dot is 256 color bmp file. Supported formats are Windows bitmap and
OS/2 bitmap format.
• Bytes 1 and 2 of the data are “0x424D” or “BM”.
• Bytes 3 - 6 of the data are the total number of data bytes, in the file, in little endian.
Example of a greyscale logo, Stored at logo #5, 400 (0x32 * 0x08) dots wide x 400 (0x32 *
0x08) dots high:
Remarks:
Not supported on Tx1-7 printers.
Grey Scale not supported on Tx1-9, or 2xR/1NR printers.
RS485 syntax:
X'1D;3A;message#;data;1D;3A'
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(3AH)+CHR$(MESSAGE#)
PSTR2$=DATA+CHR$(1DH)+CHR$(3AH)
PSTRING$=PSTR1$+PSTR2$
where:
message#
Message number that is being stored.
1 ≤ message# ≤ 25 (255 for TI8)
data
All data and commands that are to be included in this message.
Remarks:
If this command is longer than one buffer, it can be divided into several buffers using
a continuation command. See “Continuation of previous command” on page 123. This
command should only be sent when the data buffer is empty.
Printing Predefined Graphics messages can be included in this command.
All the messages defined must not exceed 8K minus 100 bytes of data.
One level of nesting of this command is allowed. That is, a stored command string can
include one level of Print Predefined Message. The end of the messages to be stored is
signaled with the characters X'1D;3A;'.
Example:
See “Downloading and printing messages” on page 152.
Error conditions:
Flash EPROM Load Error - Verify that this sector was erased before down loading the
messages.
Memory Sector is full - This sector can store up to 8K minus 100 bytes worth of message
data. After that, the sector is full.
User-defined characters
Use this command to define a matrix pattern for the user-definable code pages stored in the
Flash EPROM of the printer.
RS485 syntax:
X'1B;26;s;n;m;data'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(26H)+CHR$(S)+CHR$(N)+ CHR$(M)+DATA
where:
s
Character set being defined.
1
User-defined thermal code page 1
2
User-defined thermal code page 2
3
User-defined thermal code page 3
4
User-defined thermal code page 4
5
User-defined impact code page 1
n
Beginning ASCII address of the characters being defined.
m
Ending ASCII address of the characters being defined.
data
Slice data for the defined characters.
Note: The number of bytes is determined by the code page that is being
defined and the character matrix of that code page.
Remarks:
Once the characters are downloaded into the printer, they remain valid until they are
redefined. This is true even if power to the printer is removed.
Before the characters are defined, the sector of the Flash EPROM that stores this data
must be erased (see “Erase flash EPROM sector” on page 74), and the character matrix
for the code page must be defined (see Table 34, MCT #'s 3-5, 23, 24).
Note:
1. Flash EPROM sector 4 contains all user-defined code pages for the thermal
printhead. Therefore, if you want to redefine one of the code pages, all of the
code pages must be erased and reprogrammed.
2. Flash EPROM sector 5 contains both of the user-defined code pages for the
impact printhead. Therefore, if you want to redefine one of the code pages,
both code pages must be erased and reprogrammed.
3. Characters to be defined are limited to values X'20' and greater. Values less
than X'20' are reserved as control characters.
There is no way to redefine a single character. The entire code page must be redefined.
This command should only be sent when the data buffer is empty. If the parameters are
out of range, the printer rejects the command.
Example:
10 wide x 20 high
slice # → 1 2 3 4 5 6 7 8 9 10 Data bytes
row # ↓
1 X X . . . . . . X X 1 2
2 X X . . . . . . X X 3 4
3 X X . . . . . . X X 5 6
Defined as:
X'1B;26;01;48;48;C0;C0;C0;C0;C0;C0;C0;C0;C0;C0;C0;C0;C0;
C0;C0;C0;FF;C0;FF;C0;FF;C0;C0;C0;C0;C0;C0;C0;C0;C0;C0; C0;C0;C0;C0;C0;C0;C0;C0;C0'
The above statement defines character 48H to be an “H”.
Note: Number of data bytes = 2 x dot height (20) = 40 bytes.
Example:
11 half-dots wide (or 5.5 full dots) x 9 high
Bit # ↓ P S P S P S P S P S P
7 (MSB) . . . . . X . . . . .
0 (LSB) . . . . X . X . . . .
1 . . . X . . . X . . .
2 . . X . . . . . X . .
3 . X . . . . . . . X .
4 X . X . X . X . X . X
Data Byte 2 4 6 8 10 12 14 16 18 20 22
Data Byte 1 3 5 7 9 11 13 15 17 19 21
Defined as:
X'1B;26;05;41;41 ;F0;00;08;00;14;00;02;00;11;00;00 ;08;11;00;02;00;14;00;08;00;F0;00'
Error conditions:
Flash EPROM Load Error - verify that this sector was erased before downloading the
images.
BASIC syntax:
PSTR1$=CHR$(1BH)+CHR$(27H)+CHR$(N1)
PSTR2$=CHR$(A1)+CHR$(A2)+CHR$(A3)+DATA
PSTRING$=PSTR1$+PSTR2$
where:
n1
Number of data bytes to store
a1
First byte of three-byte address of the first byte to be written
a2
Second byte of three-byte address of the first byte to be written
a3
Third byte of three-byte address of the first byte to be written
data
Data bytes to be stored
Remarks:
The TI1/TI2 and the TI3/TI4 printers have 104 KB available for storage writes. The
valid address range is X'000000' - X'019FFF'.
The TI5 printer in normal operation has 300 KB available for storage writes. The valid
address range is X'000000' - X'049FFF'.
The TI3/TI4 printer with extra memory features have the following valid address
ranges: 1
RS485 syntax:
X'04;1B;23;n'
BASIC syntax:
PSTRING$=CHR$(04H)+CHR$(1BH)+CHR$(23H)+CHR$(N)
where:
01
Sector 1 - Downloaded graphics
02
Sector 2 - Predefined messages
03
Sector 3 - User-defined impact character sets
04
Sector 4 - User-defined thermal character sets
05
Sector 5 - User flash storage
08
Sector 6 - Check images (TI8 only)
0A
User-defined code page mapping (for 4610 Models 2Cx, 2Nx, or 1Nx)
Remarks:
This command should only be set when the buffer is empty (status byte #2 bit 6).
A TCLOSE should precede this command.
This command can take up to 2 seconds to complete.
Control does not return to the application until this command completes. The driver, in
effect, inserts a TCLOSE after a WRITE containing this command is received.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(22H)+CHR$(N)
where:
01
Sector 1 - Downloaded graphics
02
Sector 2 - Predefined messages
03
Sector 3 - User-defined impact character set
04
Sector 4 - User-defined thermal character sets
05
Sector 5 - User flash storage
08
Sector 6 - Check images (TI8 only)
08
User-defined code page mapping (for 4610 Models 2Cx, 2Nx, or 1Nx)
Remarks:
The checksum is calculated by adding the values of the data, one byte at a time, into a
2-byte integer value. Any carry digits from the high order byte are lost. This command
is treated as a Microcode Tolerance Information - Loading command by the microcode. After
issuing this command, the application issues a READ to the printer driver to obtain the
checksum. The data type will be 'C' to indicate Microcode Tolerance data. (See “READ #
LINE statement” on page 38 for details of the READ command.)
RS485 syntax:
X'1B;7C;n1;n2'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(7CH)+CHR$(N1)+CHR$(N2)
n1
X’01’
for Downloaded graphics
X’02’
for Stored messages
n2
The number of download logo or downloaded message that is being queried
X’00’ <= n2 <= X’FF’
Purpose:
To verify data integrity of the logos or messages stored in the printer. The printer will
respond with a 2 byte checksum following the status bytes. If the Logo or Message is not
defined the “checksum” will respond as “0x0000”. Valid on 2Cx, 2Nx, and 1Nx printers.
RS485 syntax:
X'04;1B;4D;n;h;l'
BASIC syntax:
PSTRING$=CHR$(04H)+CHR$(1BH)+CHR$(4DH)+CHR$(N)+ CHR$(H)+CHR$(L)
where:
n
Microcode tolerance (MCT) that is being adjusted
Note: MCT values that can be updated by an application are restricted to
decimal offsets 2, 3, 4, 5, 23, 24, 123, and 124; the user-definable code page
values.
h
High order byte of MCT data
l
Low order byte of MCT data
Remarks:
Table 34 lists the MCT values sorted by the parameter (n). The table includes the default,
the minimum, and the maximum values of these MCTs.
If you try to set an MCT value out of the defined range, it will be set to the closest value
(the minimum or maximum value).
This command is a Driver Communications command.
RS485 syntax:
X'04;1B;53;n'
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(53H)+CHR$(N)
PSTRING$=PSTR1$+PSTR2$
where:
n
Microcode tolerance (MCT) that is being requested.
Remarks:
See Table 34 for the values of parameter n allowed for applications access.
This command is a Driver Communications command.
Setup commands
The setup commands are used to change the character font, inter-character spacing, and print
station.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(21H)+CHR$(N)
where:
n
Bit # ↓ Function Bit=0 Bit=1 Thermal Impact
Default:
n = 00
Remarks:
Bit User defined User defined Resident Resident
1 0 Thermal Impact Thermal Impact
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(57H)+CHR$(N)
where:
n
• 00 - Cancel Double-Wide Mode
• non-zero - Set Double-Wide Mode
Default:
n = 00
where:
n
• 00 - Cancel Double-High Mode
• non-zero - Set Double-High Mode
Default:
n = 00
Remarks:
For better print quality with double-high characters, set the printer to unidirectional print
mode.
Set/Cancel Underline
RS485 syntax:
X'1B;2D;n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(2DH)+CHR$(N)
where:
n
• 00 - Cancel Underline Mode
• non-zero - Set Underline Mode
Default:
n = 00
Remarks:
This command is valid only in the Cash Receipt Station.
Set/Cancel Overline
RS485 syntax:
X'1B;5F;n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(5FH)+CHR$(N)
where:
n
• 00 - Cancel Overline Mode
• non-zero - Set Overline Mode
Remarks:
This command is valid only in the Cash Receipt Station.
Set/Cancel Strikethrough
Use this command to set or cancel strikethrough mode.
RS485 syntax:
X'1B;73';n
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(73H)+CHR$(n)
where:
X'00'
Cancel strikethrough mode
X'01'
Set strikethrough mode
Remarks:
Valid only in the customer receipt station on 4610 Models 2Cx, 2Nx, and 1Nx.
Set/Cancel Invert
RS485 syntax:
X'1B;48;n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(48H)+CHR$(N)
where:
n
• 00 - Cancel Invert Mode
• non-zero - Set Invert Mode
Default:
n = 00
Remarks:
This command is valid only in the Cash Receipt Station.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(47H)+CHR$(N)
where:
n
• 00 - Cancel Emphasized Mode
• non-zero - Set Emphasized Mode
Default:
n = 00
Remarks:
In the document portrait station, this command must be sent at the beginning of a line.
This command is enabled for the entire line.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(2FH)+CHR$(N)
where:
n
Maximum print speed for TI3/4/5/6/7/8/9 printers:
• X'00' - 52 lines per second
• X'01' - 35 lines per second
• X'02' - 26 lines per second
• X'03' - 15 lines per second
n
Maximum print speed for 2Cx/2Nx/1Nx printers:
• X'00' - 70 lines per second
• X'01' - 52 lines per second
• X'02' - 35 lines per second
• X'03' - 26 lines per second
n
Maximum print speed for 6145 printers:
• X'00' - 125 lines per second
• X'01' - 80 lines per second
Default:
n = X'00'
Remarks:
In the cash receipt station the printing will slow down to the maximum selected speed.
This will increase the quality of the printing and lower the current draw from the power
supply when printing high density images, such as dark logos.
• This is the maximum speed being selected, so the dot utilization algorithms can still slow the
speed further when necessary.
• If MCT 11 hex (17 dec), bit 11 has been set to a value of zero (maximum speed of 35 lps
Tx3/4/5/6/7), then this command will not have an effect on the maximum print speed (the
MCT value takes precedence).
• This command does not affect the document station.
• Not supported on the TI-1/2.
• This command was previously called “Set/Cancel High Quality Print Mode” and only
supported parameter byte values of X’00’ and X’01’. Code level 40 in the Tx3/4/5/6/7 and code
level 69 in the TI8/9, added parameter byte values of X’02’ and X’03’.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(63H)+CHR$(30H)+CHR$(N)
where:
n
Specifies the print station.
Bit # ↓ Station
LSB 0 Reserved
1 Cash Receipt Station
2 Document Station - Portrait mode
3 Document Station - Landscape mode
4 Reserved
5 Reserved
6 Reserved
7 Reserved
Default:
n = 02
Remarks:
See Appendix A, Document handling on page 161 for document handling information.
Only one station can be set at a time. If more than one station is selected, the command is
ignored.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(25H)+CHR$(N)
where:
n
• 00 - Select Resident Character Sets
• 01 - Select User-Defined Character Sets
Default:
n = 00
Remarks:
See Character Fonts and User-Defined Character.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(74H)+CHR$(N)
where:
n
• 00- Code Page 437 - United States English
• 01 - Code Page 850 - Multilingual
• 02 - Code Page 863 - Canadian-French
• 03 - Code Page 860 - Portuguese
• 04 - Code Page 865 - Danish, Norwegian
• 05 - Printer's Generic Code Page
• Code Pages 06–10, for 4610 Models 2Cx, 2Nx, and 1Nx only:
• 06 - Printer's User-Defined Code Page Mapping
• 07 - Code Page 869 - Greek
• 08 - Code Page 857 - Turkish
• 09 - Code Page 864 - Arabic
• 0A - Code Page 867 - Hebrew (Israel)
• 0B - Code Page 852 - Hungarian, Polish, Czech, Romanian, Slovak, Slovenian,
Croatian
• 0C - Code Page 848 - Ukranian
• 0D - Code Page 866 - Cyrillic (Russian)
• 0E - Code Page 872 - Bulgarian, Serbian
• 0F - Code Page 775 - Lithuanian, Latvian, Estonian
Default:
n = 01
Remarks:
Changing the code pages is valid only for resident character sets. If the user-defined
character sets are enabled, this command is ignored. Selecting User-Defined Code Page
Mapping (X'06') is ignored if the code page has not been defined; instead, the previous
code page remains selected.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(20H)+CHR$(N)
where:
n
The number of dot-spaces in the thermal print station or half-dot spaces in the
impact print station.
Default:
n = 03
Maximum:
n = 08
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(56H)+CHR$(N)
n
• 00 - Cancel Rotated Characters
• 01 - Set Rotated Character
Default:
n = 00
Remarks:
Rotation is 90 degrees clockwise. This command is supported only in the Thermal Print
Station.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(7BH)+CHR$(N)
where:
n
• X'00' - Disable upside-down printing
• X'01' - Enable upside-down printing
Default:
n = X'00'
Remarks:
When the printer is wall-mounted, the front of the printer is pointed up. Therefore, the
print data appears upside-down when printed normally. This command allows the data
to be right-side up as it is printed from the printer. The data must be sent last line first.
This command is valid only at the beginning of a print line and it is not supported on
TI1/TI2 printers.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(63H)+CHR$(31H)+CHR$(N)
n
Specifies the print station.
Bit # ↓ Station
LSB 0 Reserved
1 Cash Receipt Station
2 Document Station - Portrait mode
3 Document Station - Landscape mode
4 Reserved
5 Reserved
6 Reserved
7 Reserved
Default:
n = 02 Cash Receipt Station
Remarks:
This command is used for setting the line spacing, margins, and tabs. More than one
station can be selected at the same time, if they are going to receive the same setting.
Note: This command is not needed if honor station mode is in effect and causes
an error (80900524H) if attempted in that mode.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(31H)
Remarks:
In the Thermal (Receipt) station, this command sets line feeding to 25 steps per line.
In the Impact (Document - Portrait) station, this command sets line feeding to 6 steps per
line. In the Impact (Document - Landscape) station, this command sets line feeding to 16
steps per line. This command should be sent after the command to select the station.
Note:
1. In honor station mode, write this command to the session for which you want to set
the line spacing.
2. In honor station mode, this command must be the only command in the WRITE
string.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(32H)
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(33H)+CHR$(N)
where:
n
Specifies the number of steps per line feed.
In the Thermal (Receipt) Station, 1 inch = 204 steps (1 mm = 8 steps).
In the Impact (Document, Portrait) Station, 1 inch = 48 steps (1 mm = 1.9 steps).
In the Document Station in Landscape mode, 1 inch = 127 steps (1 mm = 5 steps).
Note:
1. In honor station mode, write this command to the session for which you want to set
the line spacing.
2. In honor station mode, this command must be the only command in the WRITE
string.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(43H)+CHR$(N)
where:
n
Specifies the number of steps to feed using minimal units moved when a FF (Form
feed, X'0C') is sent in the Receipt station.
Default:
n = 160 (X'A0')
Maximum:
255 steps (X'FF')
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(44H)+CHR$(N1)+CHR$(N2)+ CHR$(00H)+CHR$(00H)
where:
n1
High order byte dot offset for the horizontal tab.
n2
Low order byte dot offset for the horizontal tab.
Default:
There is a tab every 100 dots.
Remarks:
This command should be sent after the Select Print Station for station settings command.
(See “Select print station for station settings” on page 88.)
A maximum of 5 tab positions are stored. Up to 5 different n1 n2 pairs can be included
in this command. If more than 5 pairs are encountered in the data, an error code of
X'80900524' (invalid data) is returned. The values must be entered as hexadecimal values.
The tab is calculated from the left margin position. The tab values must be sent in
ascending order. Any previous settings for the selected station are deleted each time this
command is run. For example, to set 3 tab positions (at the 100, 150 and 300 dot positions)
use:
X'1B;44;00;64;00;96;01;2C;00;00'
where:
n1
High order byte of the dot offset from the beginning of the print line.
n2
Low order byte of the dot offset from the beginning of the print line.
Default:
n1 = 0, n2 = 0
Remarks:
In the Thermal Station, 1 mm = 8 dots. In the Impact Station, 1 inch = 150 half-dots (75
dots). n1 and n2 are hexadecimal values; to get the decimal equivalent use (n1 x 256) + n2.
If the number exceeds the printable area, it is ignored. The maximum value in the
Thermal CR station is 576. The maximum value in the Impact DI station is 474. In the
CR station, this number is rounded back to a factor of 8. This command should be sent
after the Set Print Station for setting station settings command. (See “Select print station
for station settings” on page 88.)
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(5CH)+CHR$(N1)+CHR$(N2)
where:
n1
High order byte of the dot offset from the left margin.
n2
Low order byte of the dot offset from the left margin.
Default:
n1 = 0, n2 = 0
Remarks:
In the Thermal Station, 1 mm = 8 dots. In the Impact Station, 1 inch = 75 dots (150
half-dots).
n1 and n2 are hexadecimal values; to get the decimal equivalent use (n2 x 256) + n1. To
move the position to the left, use a negative number. For example, to move N dots to the
right ⇒ 65536-N = n2*256 + n1. If this number plus the left margin exceeds the printable
area, it is ignored.
Align positions
RS485 syntax:
X'1B;61;.n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(61H)+CHR$(N)
where:
n
Position
• X'00 '- Align Left
• X'01' - Align Center
• X'02' - Align Right
• X'04' - Align Column Right
Default:
n = X'00'
Remarks:
Valid only at the beginning of a line. Tabs are only valid when printing is aligned to the
left. If tabs are used when the alignment is not left, results can be unpredictable. (See
“Horizontal tab” on page 123.) Align is relative to the left margin
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(55H)+CHR$(N)
where:
m
Position
• 00 - Cancels unidirectional printing
• 01 - Sets unidirectional printing
Default:
n = 00
Remarks:
This command is valid only in Impact Stations when there must be two passes of
the printhead to print one print line (for example, double-high print or emphasized
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(63H)+CHR$(34H)+CHR$(N)
where:
n
Selects the function.
Default:
n = 00
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(66H)+CHR$(X)+CHR$(Y)
where:
x
Time the printer should wait after receiving the command to print to the selected
document station until the document is inserted. If the document is not detected
by the time the wait time has ended, a document error is sent to the system. The
system continues to wait for a document to be inserted. The wait time = x * 0.5
seconds. The default for this value is 0; wait forever
y
Delay from the time the document is detected until the document is grabbed by
the printer - start of document printing. Side insertion closes the document throat.
Front insertion pulls the document into the printer and feeds it to the Top of Form.
The delay equals y * 0.1 seconds. The default for this value is 2; wait .2 seconds.
In the Impact only printers, this is also the delay from the time the document has
cleared the top document sensor until printing can start on another print station.
Default:
x = 02 , y = 03
Remarks:
If x = 0, the printer never sends back error status. If y = 0:
• Front insertion - The printer does not grab the paper. The operator must press the DI
feed button to have the document feed to the Top of Form position.
• Side insertion - The printer does not close the document throat. The operator must
close the throat by pressing and releasing the DI and CR feed buttons at the same
time.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(2BH)+CHR$(N)
where:
n
ASCII representation of the character printed in the first character position on the
print line when recovering from a home error. This instance only occurs in the
impact print stations when error recovery is attempted by the printer hardware.
Default:
n = X'2A' (this is an '*' in most code pages)
Remarks:
This value is stored in the EEPROM in the printer so that it is not lost when the printer is
reset. This means that the default value after a reset is the value last sent. (see Table 34).
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(6BH)+CHR$(N)+DATA+CHR$(00H)
n
Bar Code
• 00 - UPC-A
• 01 - UPC-E
• 02 - JAN13 (EAN)
• 03 - JAN8 (EAN)
• 04 - CODE 39
• 05 - ITF
• 06 - CODABAR
• 07 - CODE 128 (c)
• 08 - CODE 93
• 09 - CODE 128 (a, b)
• 0A - GS1 DataBar Omni-Directional
• 0B - GS1 DataBar Omni-Directional Stacked
• 0C - GS1 DataBar Expanded
• 0D - GS1 DataBar Expanded Stacked
• 0E - GS1 DataBar Truncated
• 0F - GS1 DataBar Stacked
• 10 - GS1 DataBar Limited
data
ASCII representation of the characters to be printed.
Remarks:
This command is valid only at the beginning of a line. Printing does not start until a X'00'
is received or the end of a message to the printer (data packet) is received. Data after any
invalid character for a particular bar code is thrown away. The printer continues to wait
for a X'00'. Excess characters are discarded. If a X'00' or an invalid character is received
before the required number of data bytes, zeroes are inserted following the data until the
required number of bytes is reached (valid for UPC-A, UPC-E, JAN8, and JAN13).
A check digit is generated if one is not supplied for UPC-A and JAN13. UPC-E generates
its own check characters. The printer expands the data, generates a check digit, and then
parses the data before generating the bar code. Six or seven digits are excepted. If seven
digits are received and the first digit is a zero, then the last 6 bytes are used to generate
the bar code. If the first digit is not a zero, then the first six bytes are used to generate
the bar code and the seventh byte is ignored. A leading zero is added to the data for ITF
bar codes if the data received has an odd number of bytes. If a bar code width is greater
than the width of the paper, the right-hand side of the bar code is truncated. Check digits
are calculated and appended for Code 128 and Code 93. This command increments status
byte 6.
For GS1 formats 0A and 0B the following apply:
• Begins with Application Identifier 01
• Data is numeric, sent as hex values 0X30 to 0x39
• Length is 13 or 14 digits. When 13 digits are sent, the firmware will calculate the check
digit. When 14 digits are sent the firmware will verify the check digit is correct. If the
check digit is not correct, a barcode error (0x80901123) will be sent and the barcode
will not print
• If the barcode cannot be printed because it is too wide or the data is invalid, a barcode
error will be returned
For GS1 formats 0C and 0D the following apply:
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(77H)+CHR$(N)
where:
n
Horizontal magnification of the line width in the Bar Code. 2 ≤ n ≤ 4. A command
with invalid data results with the value remaining unchanged.
Default:
n = X'03'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(68H)+CHR$(N)
where:
n
Dot height of the bar code. 1 ≤ n ≤ 255. A command with invalid data results with
the value remaining unchanged.
Default:
n = 162 (X'A2')
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(48H)+CHR$(N)
where:
n
Print position
• 00 - Not printed
• 01 - Above the bar code
• 02 - Below the bar code
• 03 - Both above and below the bar code
Default:
n = X'00'
Remarks:
Human-readable characters are the normal text characters associated with the bar code. A
command with invalid data results with the value remaining unchanged.
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(66H)+CHR$(N)
where:
n
The font for the HRI:
• 00 - Font A
• 01 - Font B
Default:
n=0
Remarks:
Only the resident characters are used:
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(50H)
PSTR2$=DATA+CHR$(00H)
PSTRING$=PSTR1$+PSTR2$
where:
data
Contains the ASCII representation of the characters to be printed.
Remarks:
If this command is longer than the buffer, it can be divided into several buffers using a
Continuation command. See “Continuation of previous command” on page 123.
Limitations:
• This command is valid only at the beginning of a line.
• Printing does not start until receipt of X'00'.
• This command increments status byte 6.
• The maximum number of characters to be encoded is 1000.
Error conditions:
If an image cannot be printed, status byte 7, bit 2 is set. This condition can happen when
the image is too large to print. To fix this error condition, decrease the ECC level.
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(52H)
PSTR2$=CHR$(N1)+CHR$(N2)
PSTRING$=PSTR1$+PSTR2$
n1
Is the high order byte ECC level.
n2
Is the low order byte ECC level.
Default:
n1=00, n2=15
Range:
0 ≤n1n2 ≤400 decimal (X'170')
Remarks:
For 0 ≤n1n2 ≤8, the ECC level is assumed as that particular security level. The security
level determines the number of error correction code words that are added to the symbol.
Security Level Error Correction Codewords 0 0 1 2 2 6 3 14 4 30 5 62 6 126 7 254 8 510
For 9 ≤n1n2 ≤400, the ECC level is assumed to be a percentage of the code words in the
bar code.
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(53H)
PSTR2$=CHR$(R)+CHR$(C)
PSTRING$=PSTR1$+PSTR2$
where:
r
Is the height dimension for the ratio; 1≤r≤9
c
Is the width dimension for the ratio; 1≤c≤9
Default:
r=1, c=2
Remarks:
This is not an exact ratio. The image is as close to the ratio as possible. However, the
maximum width of an image is 12 columns and the maximum height is 90 rows.
where:
n
0 = Disable truncation
1 = Enable truncation
Default:
n=0
Remarks:
A truncated PDF generates a symbol with the right row indicator and stop pattern
replaced by a single width bar. There is a slight degradation in decoding performance if
truncation is enabled. This allows more data to fit in the image width.
Syntax:
X'1D;4f;n1;n2;n3;data;00'
Basic syntax:
PSTR1$=CHR$(1DH)+CHR$(4FH)+CHR$(N1)+CHR$(N2)+CHR$(N3)
PSTR2$=DATA+CHR$(00H)
PSTRING$=PSTR1$+PSTR2$
Where:
n1
Encoding Mode Parameter
00 Byte
Encodes all bytes sent to the printer, including:
• Lowercase single byte alphanumeric
• Uppercase single byte alphanumeric
• Double-byte characters
• Control codes (characters that cannot be displayed)
01 Alphanumeric Mode
Alphanumeric mode encodes data from a set of 45 characters. They are:
• 10 numeric digits (0 - 9) (byte values 30 HEX to 39 HEX)
• 26 alphabetic characters (A - Z) (byte values 41 HEX to 5A HEX)
• 9 symbols SP, $, %, *, +, -, ., /, : (byte values 20 HEX, 24 HEX, 25 HEX, 2A
HEX, 2B HEX, 2D HEX, 2E HEX, 2F HEX, 3A HEX respectively)
02 Numeric Mode
This mode encodes data from the decimal digit set (0 - 9) (byte values
30 HEX to 39 HEX). The command will be rejected if data is outside the
supported range for this mode.
03 Kanji Mode
This mode encodes Kanji characters.
Note: The amount of data needs to be an even number. The
supported range of Kanji characters are from 8140 HEX to 9FFC HEX
and from E040 HEX to EBBF HEX. Characters outside these ranges
will be rejected.
05 Mixing Mode
This mode allows the printer to encode data using different modes; currently
works with numeric, alphanumeric, byte, and Kanji characters. In this mode,
printer will decide which type of characters and encode them accordingly.
n2
Error Correction Level
01 L - 7% recovery
02 M - 15% recovery
03 Q - 25% recovery
04 H - 30% recovery
If a parameter is outside of the range, it is assumed the setting is 0. The higher the
error correction levels, the more redundancy there is in the symbol. Therefore:
• The symbol will be larger for the same amount of data.
• The symbol may still be readable even when damaged.
n3
ECI value – valid only if the application chooses the ECI mode
Note: To reserve the encoded characters, the firmware will check for the
data in Numeric and Alphanumeric mode. If the data has just one character
that belongs to byte mode, the whole data will be encoded in the byte
mode.
Data:
The byte representation of the characters to be encoded. This field has a maximum of 1000
bytes. Sending more than 1000 bytes will cause a command reject. Note that there is also a
maximum number of bytes that can be encoded per mode. See below.
Remarks:
• Valid only at the beginning of a line.
• Printing will not start until an X'00' is received.
• This command will increment status byte 6.
• The maximum number of characters to be encoded is shown in Table 38.
• Not supported on Tx1-9 printers.
• If this command is longer than one buffer, it can be divided into several buffers using
a Continuation command. See “Continuation of previous command” on page 123.
Example: With level H error correction, the printer can encode 945 numeric characters or 566
alphanumeric characters; 393 bytes, or 242 Kanji characters.
Note:
• This function is only supported in the customer receipt station.
• The data length is capped at 1000 bytes. Sending more will result in a command reject.
This becomes the maximum for characters to be encoded for error correction levels
that support more than 1000 characters. Kanji Mode uses 2 bytes per character.
• The scanning accuracy depends on the scanner and decoding software. Scanning
becomes more difficult as the amount of data increases. It is recommended to keep
the amount of data lower than 75% of the maximum number of characters allowed for
each mode.
Error Conditions:
• If invalid Encoding Mode Parameter is chosen, printer will default to Byte Mode.
• Status byte 7, bit 2 will be set on error:
• This may happen when the image is too big to print. Try decreasing the Error
Correction level.
• Command Reject is sent:
• If the data format is not correct for the selected encoding mode.
• If the maximum number of characters that can be encoded for the selected mode is
exceeded.
RS485 syntax:
X'0A'
BASIC syntax:
PSTRING$=CHR$(0AH)
BASIC syntax:
PSTRING$=CHR$(0DH)
RS485 syntax:
X'0C'
BASIC syntax:
PSTRING$=CHR$(0CH)
Note: This command is not allowed in Page Mode.
RS485 syntax:
X'1B;64;n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(64H)+CHR$(N)
where:
n
Specifies the number of line feeds.
RS485 syntax:
X'1B;4A;n'
where:
n
Specifies the line feed steps.
In the Thermal (Receipt) Station, 1 inch = 204 steps (1 mm = 8 steps).
In the Impact (Document, Portrait) Station, 1 inch = 48 steps (1 mm = 1.9 steps).
In the Document Station in Landscape mode, 1 inch = 127 steps (1 mm = 5 steps).
RS485 syntax:
X'1B;2A;d;w;h;data'
BASIC syntax:
PSTR1$=CHR$(1BH)+CHR$(2AH)+CHR$(D)+CHR$(W)
PSTR2$=CHR$(H)+DATA
PSTRING$=PSTR1$+PSTR2$
where:
d
Dot density
x0
Normal Print - 200 DPI in the Thermal (receipt) Station; 150 DPI in the
Impact (document) Station.
Note: In the Impact Station, this takes three passes of the printhead
for every 8 dots high.
x1
Double Wide - 100 DPI in the Thermal (receipt) Station; 75 DPI in the Impact
(document) Station.
Note: In the Impact Station, this takes one pass of the printhead for
an 8 dots high logo.
x2
Double Wide and High - 100 DPI in the Thermal (receipt) Station; 75 DPI
in the Impact (document) Station. Every dot row in the vertical direction is
printed twice.
w
One-eighth the number of dots in the horizontal direction (width = 8 x w)
• 1 ≤ w ≤ 72 for a Thermal Logo
• 1 ≤ w ≤ 59 for an Impact Logo
• In the Thermal Station, 1 = 8 dots = 1 mm
• In the Impact Station, 6 = 48 dots = 1 inch
h
One-eighth the number of dots in the vertical direction (height = 8 x h)
• 1 ≤ h ≤ 255 for a Thermal Logo
• 1 ≤ h ≤ 5 for a Impact Logo
data
The data to form the graphics image when d = 0x. The number of data bytes for the
image is (h * w) x 8. See “Download graphics (logo) commands” on page 66 for an
example of the data.
When d=6x, greyscale BMP, data format is a 256 color BMP file. Supported formats
are Windows bitmap and OS/2 bitmap.
• Bytes 1 and 2 of the data are X'424D' or "BM"
• Bytes 3 - 6 of the data are the total number of data bytes in the file, in little
endian
Example of a greyscale logo command, 160 (0x14 * 0x08) dots wide by 160 (0x14 *
0x08) dots high:
X'1B2A601414424D786A0000 . . .'
In this case the byte count of the data is 0x00006A78 or 27,256 bytes.
Remarks:
The margin is ignored if this causes the logo to overrun the line length. These messages
can be positioned on the page using the commands for setting positions. See sections “Set
horizontal tab positions” on page 91 through “Set relative position” on page 92.
This command is not supported in document landscape mode. The images for the
Thermal Logo commands are defined by one dot-high rows (horizontal slices), and the
Impact is defined by eight dot-high rows (vertical slices).
The maximum number of bytes per logo is:
• 4000 bytes for TI1/2
• 8000 bytes for Tx3/4/5/6/7
• 64K byes for TI8/9, 2xR/1NR, 6145
The left margin is rounded back to a factor of 8 (that is, margin = 74); logo starts at 72. If a
home error occurs, the command is ignored and no retries occur.
This command is valid only at the beginning of the line. A line feed command must be
sent to advance the paper past the last line of the logo when printed in the document
station. This command increments the status byte 6. If this message is printed on a
regular basis, consider downloading it to save communication time. (See “Download
graphics (logo) commands” on page 66).
RS485 syntax:
X'1D;2F;m;logo#'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(2FH)+CHR$(M)+CHR$(LOGO#)
where:
m
The dot-density:
00
Normal Print - 200 DPI in the Thermal (receipt) station; 150 DPI in the
Impact (document) Station.
Note: In the Impact Station, this takes three passes of the printhead
for every 8 dots high.
01
Double Wide - 100 DPI in the Thermal (receipt) Station; 75 DPI in the Impact
(document) Station.
Note: In the Impact Station, this takes one pass of the printhead for
an 8-dots high logo.
02
Double Wide and High - 100 DPI in the Thermal (receipt) Station; 75 DPI
in the Impact (document) Station. Every dot row in the vertical direction is
printed twice.
logo #
The number associated with the logo that is stored.
1 ≤ logo# ≤ 40 (for TI1-7 printers, 255 for all other printers)
Remarks:
The margin is ignored if it causes the logo to overrun the line length. Printing this
message in the Impact Station at 150 DPI takes three passes of the printhead. These
messages can be positioned on the page using the commands for setting positions. See
sections “Set horizontal tab positions” on page 91 through “Set relative position” on page
92.
This command is valid only at the beginning of the line. A line feed command must be
sent to advance the paper past the last line of the logo when printed in the document
station. This command is not valid in Landscape mode. The command increments
status byte 6. Retries are not attempted on print errors. See “Download graphics (logo)
commands” on page 66.
Note: For each Print Predefined Graphics command in the write buffer, six
additional command bytes are inserted by the driver. Therefore, the maximum
size of the buffer containing these commands is the maximum printer buffer
size-(6×n) where n is the number of Print Predefined Graphics commands in the
current write buffer.
RS485 syntax:
X'1D;5E;message#'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(5EH)+CHR$(MSG#)
where:
message#
The number associated with the stored predefined message.
1 ≤ message# ≤ 25
Remarks:
This command is not valid in landscape mode. The command increments status byte
6. Retries are not attempted on print errors. The hardware provides no error recovery
during printing of predefined messages. If an error is encountered, the hardware stops
the processing of the predefined messages and ignores any commands remaining in the
predefined message currently being processed. See “Store predefined messages” on page
69.
Note: For each Print Predefined Message command in the write buffer, six
additional command bytes are inserted by the driver. Therefore, the maximum
size of the buffer containing these commands is the maximum printer buffer
size-(6×n), where n is the number of Print Predefined Message commands in the
current write buffer.
If both a Print Predefined Message command and a Print Predefined Graphics
command are included in the buffer, both items require an additional 6 bytes of
commands each for a total of 12 bytes to be inserted.
Page mode
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(4CH)
Remarks:
Enables page mode printing. Supported on thermal station only. Starting position is set
by set printable area (x’1B;57..’) and print direction (x’1B;54...’) commands. Inter-character
spacing (x’1B;20;n’), and line spacing (x’1B;31’) (x’1B;32’) (x’1B;33;n’) commands are set
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(4FH)
Remarks:
This command is effective only in page mode. Data buffered in page mode is cleared.
This command sets the print position to the beginning of the line.
BASIC syntax:
PSTR1$=CHR$(1B)+CHR$(58H)+CHR$(X)+CHR$(Y)
PSRT2$=CHR$(DX)+CHR$(DY)
PSTRING$=PSTR1$+PSTR2$
where:
x,y
2-byte horizontal and vertical starting position (in dots)
dx,dy
2-byte horizontal and vertical printing area (in dots)
Remarks:
When sent in standard mode, this command will set the printable area for page
mode, but has no effect on standard mode printing.
If the starting position (x,y) is outside the maximum page size, the entire command
is ignored. If the printing area is defined outside the maximum page size, the
printing area is limited to the page size. Maximum page size is 576 dots in the
horizontal direction, and 1250 dots in the vertical direction for TI8/TI9 models and
800 dots in the vertical direction for TI3/TI4 models. Minimum page size is 10 x 10.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(54H)+CHR$(N)
where: n
Value Direction/Position
'00' Left to right/top left
'01' Bottom to top/bottom left
'02' Right to left/bottom right
'03' Top to bottom/upper right
When sent in standard mode, this command will set the print direction for page mode,
but has no effect on standard mode printing.
Starting position is within the printable area defined by 'Select Printable Area' command
(x'1B;58...').
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(24H)+CHR$(H)+CHR$(L)
where:
h
high order byte of the vertical printing position (in dots)
l
low order byte of the vertical printing position (in dots)
Remarks:
Applies to page mode only.
Moves the printing position to the specified dot position perpendicular to the
printing direction specified by the 'Select Printing Direction' command.
If print direction is bottom to top, or top to bottom, this command will adjust the
printing position in the horizontal direction.
If the value of hl is outside the specified printable area, the command is ignored.
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(5CH)+CHR$(H)+CHR$(L)
where:
h
high order byte of the vertical printing position (in dots)
l
low order byte of the vertical printing position (in dots)
Remarks:
Applies to page mode only.
Moves the printing position the specified number of dots from the current print
position, in the direction perpendicular to the printing direction specified by the
'Select Printing Direction/Position' command (x'1B;54...').
If hl is a negative value, current print position will move in the opposite direction.
If print direction is bottom to top, or top to bottom, this command will adjust the
printing position in the horizontal direction.
If the value of hl is outside the specified printable area defined by 'Select Printable
Area' the command is ignored.
Set left margin position (standard mode) Set absolute print position
(page mode)
RS485 syntax:
X'1B;24;n1;n2'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(24H)+CHR$(N1)+CHR$(N2)
where:
n1
high order byte of the dot offset from the beginning of the print line.
n2
low order byte of the dot offset from the beginning of the print line.
Default:
n1 = 0, n2 = 0
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(5CH)+CHR$(N1)+CHR$(N2)
where:
n1
high order byte of the dot offset relative to the left margin in standard mode,
relative to the current print position in page mode.
n2
low order byte of the dot offset relative to the left margin in standard mode,
relative to the current print position in page mode.
Default:
n1 = 0, n2 = 0
Remarks:
In the Thermal Station 1 mm = 8 dots.
In the Impact Station 1 inch = 75 dots (150 half-dots). n1, and n2 are hex values; to
get the decimal equivalent = (n2 x 256) + n1.
To move the position to the left use a negative number.
Example:
To move N dots to the right => 65536-N = n2*256 + n1.
If this number plus the left margin exceeds the printable area it is ignored.
BASIC syntax:
PSTR1$=CHR$(1DH)+CHR$(5DH)
PSTR2$=CHR$(X1)+CHR$(X2)+CHR$(Y1)+CHR$(Y2)
PSTRING$=PSTR1$+PSTR2$
where:
X1,X2
2-byte horizontal position (with respect to the paper, regardless of printing
direction)
Y1,Y2
2-byte vertical position (with respect to the paper, regardless of printing direction)
Remarks:
Allows complete control of printing position with a single command. If either
parameter is outside the printable area defined by the 'Select Printable Area'
command, the command is ignored.
BASIC syntax:
PSTRING$=CHR$(0CH)
Use this command to print the data in the print buffer and feed paper by an amount previously
stored in the receipt station or in the document station until the document exits the feed rollers.
If a cutter is available, the paper is cut.
Note: This command is not allowed in Page Mode.
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(0CH)
In Standard Mode: This command is ignored.
In Page Mode: Prints the page loaded in the printer. The page remains loaded in the printer buffer
and the printer remains in Page Mode. This should be used if the same page is going to be
printed over and over again, or if there is a basic template that gets filled in with each print out.
BASIC syntax:
PSTRING$=CHR$(04H)+CHR$(18H)
Deletes all the print data in the current printable area on page stored in the printer buffer.
Miscellaneous commands
RS485 syntax:
X'1D;21;n'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(21H)+CHR$(n)
where:
Note: h equals height as indicated in the low order bits of the bytes
described above. w equals width as indicated in the high order bits of the
byte described below.
Remarks:
This command is valid only in the Thermal Print Station. Bits 3 and 8 of n are ignored.
The Set Print Mode command can also select the character height (double high and wide).
The command last received is the effective command. The characters are formed by
expanding the character matrix proportionally in the printer.
There is no smoothing algorithm in the printer. The characters are formed by expanding
the character matrix proportionally in the printer.
Underline and Overline are not supported when the height is scaled 8X. The bar for
Overline and Underline is not magnified in thickness.
This command is not supported on TI1/TI2 printers.
RS485 syntax:
X'1D;3B;n'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(3BH)+CHR$(n)
where:
Remarks:
This command tells the printer what type of paper is in use so that the printer can drive
the printhead with the algorithm that is best suited for that paper. This setting is saved in
nonvolatile memory.
Note: To use the Select Color Printing command, the printer must be set to use
color paper.
RS485 syntax:
X'1B;72;n'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(72H)+CHR$(n)
where:
n
• X'00' - Cancels color printing
• X'01' - Enables full-character color printing
• X'02' - Enables half-character color printing
The default is n = X'00'.
Remarks:
Enabling and disabling of full-character color is available within a print line. Half-
character color is supported at the beginning of a print line. This command is valid only
if Select Thermal Paper has been sent, which signifies that color paper is loaded in the
printer. When color paper is enabled, the printer is limited to printing at 15 lines per
second when printing 8 lines per inch.
Enable/disable beeper
Use this command to enable or disable the printer beeper. The beeper is only available on 4610
Models TM6, TM7, and 1Nx.
RS485 syntax:
X'1B;07;n;n2'
n
• X'00' - Disables the beeper
• X'FF' - Enables the beeper
• X'01-fe' - Timed enable
The default is n = X'00'.
n2
Volume/tone
The bits for the LSB are:
Bit 0-3
Note
Bit 4-5
Octave
Bit 6-7
Reserved
Bit 8
Volume
• Bit = 0- Loud
• Bit = 1- Soft
Default:
n = X'00'
Remarks:
Any value of n, other than X'00' or X'01', is treated as the value of time that the beeper
is to be enabled. The time is calculated as n x 0.1 seconds. The only way to stop a beep
command early is to send the Disable Beeper command, which allows timed beeps to
be chained together. They can also be downloaded as messages. A value of n2 = 2F is
recommended for the most audible tone.
Horizontal tab
Use this command to move the print position to the next tab stop.
RS485 syntax:
X'09'
BASIC syntax:
PSTRING$=CHR$(09H)
Remarks:
See “Set horizontal tab positions” on page 91. Tabs are only valid when printing is
aligned to the left. If tabs are used when the alignment is not left, the results can be
unpredictable. (See “Align positions” on page 93.)
RS485 syntax:
X'1B;2E'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(2EH)
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(3CH)+CHR(N)
where:
n
Printhead position
00
Document Home Position
01
Open Document Throat Position
02
Reserved
03
Left Home Position
04
Re-find Document Home Position
This setting can be used to recover from a home error.
05
Register Document
• Close throat, if open.
• Advance paper forward to the first position.
06
Re-register the document
• For both landscape and portrait mode printing. If a document is in the
printer, it is brought back to the first position on the document.
07 -FF
Reserved
RS485 syntax:
X'1B;6D'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(6DH)
Remarks:
This command cuts the paper at the current position without advancing the paper. This
command differs from the X'0C' command, which does feed the paper before the cut.
Using this command allows for reduced paper usage by starting the print on the next
section of paper before cutting the paper.
If the DI station is selected, this command performs exactly like a Form Feed (FF -X'0C').
RS485 syntax:
X'04;1B;34;n1;a1;a2;a3'
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(34H)+CHR$(N1)
PSTR3$=CHR$(A1)+CHR$(A2)+CHR$(A3)
PSTRING$=PSTR1$+PSTR2$+PSTR3$
where:
n1
Number of bytes to be returned
a1
First byte of the three-byte address of the first byte to be returned
a2
Second byte of the three-byte address of the first byte to be returned
a3
Third byte of the three-byte address of the first byte to be returned
Enable watermark
Use this command to enable or disable watermark printing.
RS485 syntax:
X'1D;2B;logo,offset,alignment'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(2BH)+LOGO+OFFSET+ALIGNMENT
where:
logo
The number of the stored logo to be used as a watermark:
X'00'
Turn off watermark printing
X'01'–X'FF'
Stored logo number
offset
The offset in millimeters between each watermark (80 dot rows = 1 mm): X'01'–
X'FF'
alignment
The alignment of the watermark:
X'00'
Align left
X'01'
Align center
X'02'
Align right
X'03'
Roll right (left -> center -> right -> left…)
X'04'
Roll left (right -> center -> left -> right…)
X'05'
Zig-zag (left -> center -> right -> center -> left…)
Remarks:
Valid only in the customer receipt station on 4610 Models 2Cx, 2Nx, and 1Nx.
RS485 syntax:
X'1B;6A;data'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(6AH)+DATA
where:
data
256 bytes of data to fill the code page
Remarks:
Each character is referenced by its Unicode number. If the Unicode for a downloaded
character is not part of the resident characters that are stored in the printer, then a space
character is used instead. Characters in address locations X'20'–X'7F' are the same for all
code pages. The mapping is for characters in locations X'80' and above.
Valid only on 4610 Models 2Cx, 2Nx, and 1Nx.
Example:
If you are using code page 858, then the character mapping is 256 bytes of X'00C7',
X'00FC', X'00E9'… X'00B2', X'25A0'.
Two bytes for each mapping location:
U00000C7 Ç 80h
U00000FC ü 81h
U00000E9 é 82h
U00000E2 â 83h
...
U00000B9 ¹ FBh
U00000B3 ³ FCh
U00000B2 ² FDh
U00025A0 ? FEh
...where each two-byte entry is the Unicode character that is assigned to that
corresponding position in the table from X'80'–X'FF'.
Error Conditions:
RS485 syntax:
X'08'
BASIC syntax:
PSTRING$=CHR$(08H)
Remarks:
Use this command to move the print position to the beginning of the previous character.
It is intended for languages that require composite characters; you cannot use it to go
back multiple characters.
Valid only on 4610 Models 2Cx, 2Nx, and 1Nx.
MICR read
Use this command to read the account information from the MICR-encoded characters on
customer checks. The TI8 model printer improves the MICR read rate by reading the MICR
data using both magnetic and optical methods concurrently.
RS485 syntax:
X'04;1B;49'
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(49H)
PSTRING$=PSTR1$+PSTR2$
Remarks:
The check should be inserted in the front and against the right wall of the printer. The
check can be, but does not have to be, registered in the printer before this command
is given. The check is fed forward until the bottom sensor is uncovered, then fed back
for the MICR reading. After the reading is complete, the check is fed to the first print
position. This command increments the line count (Status byte 6).
The characters are sent as read from left to right, up to a maximum of 65 characters.
The MICR information is represented as ASCII characters. If no MICR data is read by
Error conditions:
Document Feed Error (Status byte 7). This bit is set if the check that is inserted is too long.
The maximum check length is 10 inches. The error is set also if the check does not clear
the document sensors when expected.
Flip check
Use this command to flip the check after a MICR read. This command allows the face of the
check to be printed.
RS485 syntax:
X'1B;35'
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(35H)
Remarks:
Set the print station to document landscape mode to print the face of the check. This
command can take up to 3 seconds to complete. The command increments the line count
(Status byte 6). If the print station is landscape when the command is received, the flip
process deletes pulling the check into the printer making the flip faster.
Error conditions:
Document Feed Error (Status byte 7). This bit is set if the check inserted is too long. The
maximum check length is 10 inches. The error is set also if the check does not clear the
document sensors when expected.
RS485 syntax:
X'1B;3E;n''
BASIC syntax:
PSTRING$=CHR$(1BH)+CHR$(3EH)+CHR$(N1)
where:
n1
Type of scan
X'00'
Optical scan only
X'01'
Scan and MICR/OCR read
X'03'
Full scan, MICR/OCR, and prepare for flip (start the check into the flipper)
X'04'
Partial scan, MICR/OCR, and prepare for flip (start the check into the flipper)
Remarks:
Pulls in the document that is present at scanner input.
The document image is retained in RAM until another scan command is received, or
the printer is reset.
A successful read returns a status with status byte 05 and bit 06 set, and a 2–byte
image width and 2-byte image height (in 1/100 inches) follows the status.
When using the '01' option, the MICR data is returned after the successful scan status,
and matches the format described in the MICR command section.
If the scan is not successful, the "Document Feed Error" bit is returned (Status byte 7,
bit 7).
On Tx3-7 printers this command will cause a command reject.
On 2xR/1NR printers this command is ignored.
RS485 syntax:
X'1B;30;n1h;n1l;xh:xl;yh;yl;dxh;dxl;dyh;dyl;s1;s2;n2'
BASIC syntax:
PSTR1=CHR$(1BH)+CHR$(30H)+CHR$(N1H)+CHR$(N1L)+
CHR$(XH)+CHR$(XL)
PSTR2=CHR$(YH)+CHR$(YL)+CHR$(DXH)+CHR$(DXL)+
CHR$(DYH)+CHR$(DYL)
PSTR3=CHR$(S1)+CHR$(S2)+CHR$(N2H)
PSTRING$=PSTR1$+PSTR2$+PSTR3$
where:
(For 2 byte fields h = high order byte l = low order byte)
n1 (h and l)
(2 bytes) Image location to print
s2
1 byte Percentage to scale image in y direction (a value of 100 or 0 results in no
scaling)
n2
Print options
Bit Value Function
0 1 rotate image counter-clockwise 90°
0 Do not rotate
Remarks:
The image location (n1) of 0 prints the most recently scanned image to the thermal
station. All other values of n1 correspond to the image that is stored in flash.
Printing stored images causes the printer to pause momentarily while the printer
formats the data to be printed. This pause time varies depending on the amount of
formatting that is required.
The top left corner of the scanned document is used as the point of reference.
All x, dx, y, and dy values are based on 1/100th of an inch.
The paper movement path is the y axis and the scan head dot row is the x axis.
When n1 = 0, the x command parameter is the horizontal offset from the left side of the
scanned document. The y parameter is the vertical offset from the top of the scanned
document.
When n1 is a stored image, the x command parameter is the horizontal offset from the
left side of the stored image. The y parameter is the vertical offset from the top of the
scanned document.
In all cases, dx and dy define the area's width to the right and the height down.
If dx and dy extend the printer area farther than the boundaries of the image, the
value is truncated to the image boundary. If the size of the print area is greater than
the thermal printhead is capable of printing (either due to image size or scaling), the
image is truncated to the width of the printhead.
Currently, the only scaling options are 100% (no scaling) and 200% (double).
Tag data is included with the image, but it is not printed.
RS485 syntax:
X'1B;41;n1;x0h;y0l;dx0h;dy0l;x1h;y1l;dx1h;dy1l;x2h;y2l;dx2h;dy2l;
x3h;y3l;dx3h;dy3l;tagdata'
where:
n1
Select storage method - 1 byte
tagdata
An ASCII string that is terminated by a null character with a maximum of 100
characters. This data is used to allow the application to "tag" the image with
information that can be used to track the image; for example, the tag data could
contain transaction information.
Remarks:
Images are stored sequentially. The location where the image is stored can be obtained by
performing a RETRIEVE NEXT TABLE LOCATION command before issuing the STORE
command. The image is compressed using the compression algorithm last selected by
the SELECT COMPRESSION FORMAT command and is then stored to memory. When
storing an image, the user has the option to store the entire image contained within the
defined area, or just selected blocks within the defined area. Saving just the blocks of
desired information allows a smaller amount of storage to be used but keeps together
the related data. When storing multiple blocks of data, each block gets a unique storage
location. A byte in the header message reflects that the stored image block is part of a
group. The upper nibble represents which block of the group it is, and the lower nibble
shows the total number of blocks in the group. If the byte returned equaled x'14' then the
image would be the first out of a total of 4. Each block includes the header information,
but only the first block includes the tag data.
(dy2)
(dx0)
(x0, y0)
(dy0)
(dy0)
The Select Storage Method (n1) byte defines how the image should be stored.
When n1= 0:
All data defined by x0,y0 dx0,dy0 is stored. The command parameters x1..x3, y1..3
dx1..dx3, and dy1..dy3 should not be included.
When n1 = 1:
A predefined template based on a personal check is used to store the image. The
area defined is the entire personal check, however only the name, address and
the MICR blocks are saved. The command parameters x0..x3, y0..3 dx0..dx3, and
dy0..dy3 should not be included. These parameters are defined in MCT locations
0xB0 through 0xBF and can be viewed or adjusted using the MCT READ and
MCT WRITE commands. If less than 4 blocks are required, a block can be disabled
by storing a value of x'ff ff' to a coordinate MCT location. This causes that block
location to be ignored.
When n1 = 2:
A predefined template based on a business check is used to store the image. The
area defined is the entire business check, however only the name, address and
the MICR blocks are saved. The command parameters x0..x3, y0..3 dx0..dx3, and
dy0..dy3 should not be included. These parameters are defined in MCT locations
0xC0 through 0xCF and can be viewed or adjusted using the MCT READ and
MCT WRITE commands. If less than 4 blocks are required, a block can be disabled
by storing a value of x'ff ff' to a coordinate MCT location. This causes that block
location to be ignored.
When n1 = 3:
This method allows the user to define sub-blocks of data to store. All command
parameters must be sent. If less than 4 blocks of data are to be saved, the value of
x'ff ff' should be sent for any unused parameters. The top left corner of the scanned
document is used as the point of reference. All xn, dxn, yn, and dyn values are
Error conditions:
4690 return code of X'80901120' if the image to be stored is larger than the remaining
unused memory for the image sector, or if an error occurs during the flash write
(hardware error)
Example 1: Method 0:
X'1B 41 00 00 19 00 32 01 13 02 26 30 33 2F 30 34 2F 30 32 20
30 30 31 2E 33 34 00'
An image of 2.75 in. x 5.5 in. that begins 0.25 in. from the left side and 0.5 in. from the top
of the document is stored with the tag data: 03/04/02 001.34
Example 2: Method 3:
X'1B 41 03 00 AF 01 DB 00 28 00 64 00 B4 00 64 00 64 00 96 00
96 00 64 00 19 01 13 FF FF FF FF FF FF FF FF 00'
Three separate areas are stored. No tag data is included. Refer to Table 39 for details.
RS485 syntax:
X'1B;39;ih;il;o1;o2;o3;o4;nh;nl'
BASIC syntax:
PSTR1$=CHR$(1BH)+CHR$(39H)+CHR$(I1H)+CHR$(I1L)
PSTR2$=CHR$(O1)+CHR$(O2)+CHR$(O3)+CHR$(O4)+
CHR$(NH)+CHR$(NL)
PSTRING$=PSTR1$+PSTR2$
where:
For 2 byte fields h = high order and byte l = low order byte)
i (h and l)
2 Bytes Image Location to retrieve
o1,o2,o3,o4
4 Bytes Offset into image to retrieve data from
n (h and l)
2 Bytes Number of bytes to retrieve
Remarks:
Call the ReadImage subprogram to move the retrieved image into the application's string
variable. See “ReadImage subprogram” on page 53 for additional details. Image Location
(ihil) of 0 returns the image in RAM of the last scanned image. Offset (o1o2o3o4) and
size (nhnl) of 0 retrieves the header information for the specified image. When (ihil) = 0,
the header consists of the 12 data bytes and a NULL character for the tag data. Only the
Compression, Size1,Size2 fields contain valid data. The header consists of 12 bytes plus
the tag data. The header has the following format:
Status - 1 byte
Bit 7 -Image Read
1 = Image has not been read
0 = Image was read and verified
Bit 6-0 Reserved
Compression - 1 byte
Bit 7-3 Reserved
Bit 2-0 Algorithm used to compress image. See Select Compression Format
command.
Size1 - 4 bytes
# of bytes in image (not including tag data)
Future - 1 byte
Reserved
Tag data
ASCII data supplied by the application terminated by a Null string
Offset (n2) = x'FF FF FF FF' with size (n3) = x'FF FF''s will set to zero the 'Image Read'
bit in the specified image's header. For stored images (n1>0), the image data format is
the format that was active when the image was stored. (Format given in header under
compression byte.) For immediate images (n1=0), the image data format is the currently
selected format. If any parameters are out of range, a command reject is returned
Scanner calibration
Use this command to initiate the scanner calibration routine. A white document must be inserted
into the document insert station. The printer scans the document two to three times and updates
the scanner calibration data. (This command is available for TI8 model printers only.)
RS485 syntax:
X'1D;63;30'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(63H)+CHR$(30H)
RS485 syntax:
X'1D;4E;01;00'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(4EH)+CHR$(01H)+CHR$(00H)
Remarks:
Returns the table position where the next image is to be stored.
This command is an MCT request. After issuing the command, the application should
issue a TCLOSE to wait for the command to complete, then issue a READ to obtain the
RS485 syntax:
X'1D;4E;01;01'
BASIC syntax:
PSTRING$=CHR$(1DH)+CHR$(4EH)+CHR$(01H)+CHR$(01H)
Remarks:
The printer searches the stored images sequentially and returns the location of the first
location that has not been set to read.
This command is an MCT request. After issuing the command, the application should
issue a TCLOSE to wait for the command to complete, then issue a READ to obtain the
results. See Table 5 for details of the READ buffer. The data type is marked as 'C' for MCT
value, and is in that format.
RS485 syntax:
X'1B;4D;1F;n1;n2'
where:
nl
'00' 200 DPI TIFF-CCIT compression (black and white)
'01' 200 DPI JPEG compression (greyscale)
'02' 200 DPI BMP (uncompressed greyscale)
'03' Reserved
'04' 200 DPI TIFF file - no compression
'10' 100 DPI TIFF-CCIT compression (black and white)
'11' 100 DPI JPEG compression (greyscale)
'12' 100 DPI BMP (uncompressed greyscale)
'14' 100 DPI TIFF file - no compression
Remarks:
The current format applies to the retrieval and storage of the currently scanned image.
Changing the format does not change the format of images already stored in flash.
This is a persistent setting across printer reset and power cycles.
RS485 syntax:
X'10;05;n'
BASIC syntax:
PSTRING$=CHR$(10H)+CHR$(05H)+CHR$(N)
where:
n
Specifies the command to be processed.
X'31'
Release Print buffer. This is sent after an error has occurred and the print
buffer is held.
RS485 syntax:
X'1B;37'
Remarks:
In the Thermal print stations, the printer must be printing one line while processing the
next line. If the printer is unable to completely process a line before the previous line is
finished, the print speed is reduced by half. The line count is reset when the buffer is
held.
The hold command is a buffered command. If a hold command is issued and then
a second hold command is issued before a release buffer command, the second hold
command remains in the printer buffer. When the release buffer command is issued and
the second hold command is encountered, printing is again held.
If the printer driver buffer becomes full while a hold buffer command is in effect, the
driver issues a release buffer to the printer. The printer driver buffer is 4096 bytes. The
application can change the size of this buffer using the PUTLONG command.
If the application issues a TCLOSE command while a hold buffer command is in effect,
the driver issues a release buffer command before the TCLOSE command is processed.
RS485 syntax:
10;05;31
BASIC syntax:
PSTRING$=CHR$(10H)+CHR$(05H)+CHR$(31H)
Remarks:
If an error occurs during the transaction that is being held, the printer sends back the line
number on which the error occurred with the error status. The system can then decide to
cancel printing or continue printing when the error is corrected. The command continues
the printing after the error is fixed.
See “Real time request” on page 138.
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(53H)+CHR$(N)
Remarks:
See “Microcode tolerance information - request” on page 77.
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(53H)+CHR$(N)+CHR$(H)+CHR$(L)
PSTRING$=PSTR1$+PSTR2$
Remarks:
See “Microcode tolerance information - loading” on page 76.
BASIC syntax:
PSTR1$=CHR$(04H)+CHR$(1BH)+CHR$(34H)
PSTR2$=CHR$(A1)+CHR$(A2)+CHR$(A3)
PSTRING$=PSTR1$+PSTR2$
Remarks:
See “Retrieve the user flash storage” on page 125.
MICR read
RS485 syntax:
X'04;1B;49'
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(49H)
PSTRING$=PSTR1$+PSTR2$
Remarks:
See “MICR read” on page 128.
BASIC syntax:
PSTR1$=CHR$(04H)
PSTR2$=CHR$(1BH)+CHR$(29H)+CHR$(N)
PSTRING$=PSTR1$+PSTR2$
where:
n
Select function.
Bit # ↓ Function Bit=0 Bit=1
Remarks:
This command communicates to the driver and to the printer the status changes for
which the application requires notification. This command is used in conjunction with the
WAIT command.
Bit 4 is used in place of Command Complete. When the buffer is empty, the system
assumes that everything stored in the printer has been completed. The system always
sends the other error statuses back as they occur. (See Appendix A, Document handling
on page 161).
BASIC syntax:
PSTRING$=CHR$(04H)+CHR$(1BH)+CHR$(23H)+CHR$(N)
Remarks:
See “Erase flash EPROM sector” on page 74 for details.
where:
n
X’4E’ to convert from compatibility to native mode
X’43’ to convert from native to compatibility mode
Purpose:
To switch the mode of a 4610 Model 2Cx, 2Nx, or 1Nx printer from compatibility mode
to native mode, or the reverse. The printer will be reset upon successful completion of the
command. The command is valid only on 2Cx, 2Nx, and 1Nx printers. Attempts to use
the command on other model 4610 printers, or to switch a 2Cx/2Nx/1Nx printer already
in compatibility mode to compatibility mode again or in native mode to native mode
again, will result in a return code of 0x80900524 with a sense code of 0xFFFFFFEF (-17).
This chapter contains CBASIC programming examples. The chapter contains examples for both
stream mode and honor mode.
!-------------------------------------
! Define variables and environment
!-------------------------------------
!
%ENVIRON T ! Environment is Terminal
STRING LF,CR,DI,FA,FB,FADH,FBDH,FADW,FBDW,FADHDW,FBDHDW
STRING MICR,FLIP,WORK
! LINEFEED
LF=CHR$(0DH)
! Select CR: station
CR=CHR$(1BH)+CHR$(63H)+CHR$(30H)+CHR$(02H)
! Select DI: station
DI=CHR$(1BH)+CHR$(63H)+CHR$(30H)+CHR$(04H)
! Select font A
FA=CHR$(1BH)+CHR$(21H)+CHR$(00H)
! Select font B
FB=CHR$(1BH)+CHR$(21H)+CHR$(01H)
! Select font A - double high
FADH=CHR$(1BH)+CHR$(21H)+CHR$(10H)
! Select font B - double high
FBDH=CHR$(1BH)+CHR$(21H)+CHR$(11H)
! Select font A - double wide
FADW=CHR$(1BH)+CHR$(21H)+CHR$(20H)
! Select font B - double wide
FBDW=CHR$(1BH)+CHR$(21H)+CHR$(21H)
! Select font A - double high/double wide
FADHDW=CHR$(1BH)+CHR$(21H)+CHR$(30H)
! Select font B - double high/double wide
FBDHDW=CHR$(1BH)+CHR$(21H)+CHR$(31H)
! Select CR: and font A, add text, and end with linefeed
WORK = CR+FA+"This is Font A"+LF
WRITE #PRT4610; WORK
! Select CR: and font A, add text, and end with linefeed
WORK = CR+FA+"This is Font A"+LF
! Select CR: and font A, 12 CPI, add text, and end with linefeed
WORK = CR+FA+CPI12+"This is Font A, 12 CPI"+LF
! Select CR: and font A, 15 CPI, add text, and end with linefeed
WORK = WORK+CR+FA+CPI15+"This is Font A, 15 CPI"+LF
! Select CR: and font A, 17 CPI, add text, and end with linefeed
WORK = WORK+CR+FA+CPI17+"This is Font A, 17 CPI"+LF
! Flip check
WRITE #PRT4610; FLIP
!
! Set Tabs at 100, 150, and 300 dots
!
!
! imbed tabs in printer command string
!
Printing a barcode
This is an example of printing a barcode.
!
! set up variables
!
UPCA = CHR$(00H)
UPCE = CHR$(01H)
JAN13 = CHR$(02H)
JAN8 = CHR$(03H)
!
! Print the supported barcodes
!
Printing a QR code
This is an example of how to print a QR code.
! Set up QR data
QRDATA = "https://commerce.toshiba.com/"
!
! Hold the buffer
!
! Send lines to printer (to be buffered)
! (These lines should not print until the buffer
! is released.)
!
!
! Release the buffer
!
!
! set up variables (assume string variables)
!
READMCT = CHR$(04H)+CHR$(1BH)+CHR$(53H)
WRITEMCT = CHR$(04H)+CHR$(1BH)+CHR$(4DH)
!
! Request MCT value 04H (User defined Impact code page 1)
!
!
! Read the data into the application buffer
!
!
! Load (write) an MCT value to address 03H
! (User defined thermal code page 2 character size)
! Set the value to 0912H indicating 9X18 characters.
!
!
! set up variables (assume string variables)
!
ERASESEC = CHR$(04H)+CHR$(1BH)+CHR$(23H) ! Erase EPROM sector
NVWRITE = CHR$(1BH)+CHR$(27H)
NVRETR = CHR$(04H)+CHR$(1BH)+CHR$(34H)
!
! Erase the user flash memory sector (05H)
!
!
! Write data into user flash RAM
! 10 bytes at address 000000H
!
SIZE$ = CHR$(0AH)
NVADDR$ = CHR$(00H)+CHR$(00H)+CHR$(00H)
NVDATA$ = "0123456789"
!
! Retrieve data from user flash RAM
! 10 bytes from address 000000H
!
!
! Read the data into the application buffer
!
!
! Set up a test pattern graphic image
!
LP1$ = CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+
\
CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+
\
CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+
\
CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)+CHR$(0AAH)
LP2$ = CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+ \
CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+ \
CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+ \
CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)+CHR$(55H)
!
! Erase the stored graphics sector (01H)
!
!
! Download the graphics (using the continuation command)
! as number 1. Size is 24*8 x 16*8
!
!
! Print predefined graphic number 1
!
! New character I
I$ = CHR$(7H)+ CHR$(0EH) + CHR$(7H) + CHR$(0EH) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(1H)+ CHR$(08H) + CHR$(1H) + CHR$(08H) + \
CHR$(7H)+ CHR$(0EH) + CHR$(7H) + CHR$(0EH)
! New character B
! New character M
M$ = CHR$(04H) + CHR$(02H) + \
CHR$(06h) + CHR$(06H) + \
CHR$(06h) + CHR$(06H) + \
CHR$(06h) + CHR$(06H) + \
CHR$(05H) + CHR$(0AH) + \
CHR$(05H) + CHR$(0AH) + \
CHR$(05H) + CHR$(0AH) + \
CHR$(05H) + CHR$(0AH) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H) + \
CHR$(04H) + CHR$(02H)
!
! Erase the thermal user code page sector (04H)
!
!
! Set the character size by writing an MCT value,
! in this case thermal page 1 characters are set
! to 10H by 10H (16x16)
! (This is required before the download)
!
!
! Download the user characters (using continuation command)
!
!
! Select the user code page
!
!
! Print new characters (positions 21H - 23H)
!
!
! Erase the predefined message sector (02H)
!
!
! Store the above as one message, number 1
!
!
! Store message 2
!
!
! Print message 1 followed by message 2
!
! start beep
WRITE #CRPTR%; BEEP$ + CHR$(0FFH) + CHR$(2FH)
! wait 1 second
WAIT;1000
WAIT;500
! beep 1/2 second (05 * .1 seconds)
WRITE #CRPTR%; BEEP$ + CHR$(05H) + CHR$(2FH)
! normal print
CALL PRINT.Multiple.Lines.on.Printer(10)
! scale printing
WRITE #CRPTR%; SCALE$ + CHR$(11H)
CALL PRINT.Multiple.Lines.on.Printer(5)
WRITE #CRPTR%; SCALE$ + CHR$(22H)
CALL PRINT.Multiple.Lines.on.Printer(5)
WRITE #CRPTR%; SCALE$ + CHR$(33H)
CALL PRINT.Multiple.Lines.on.Printer(5)
WRITE #CRPTR%; SCALE$ + CHR$(44H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(55H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(66H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(77H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(17H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(27H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(37H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(47H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(57H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(67H)
CALL PRINT.Multiple.Lines.on.Printer(1)
WRITE #CRPTR%; SCALE$ + CHR$(00H)
PCMD = 80570001H
PCMD = 80440001H
!
! Set 8 lines per inch on the CR: station
!
WRITE #PCR; CHR$(1BH)+CHR$(31H)
!
! Set 6 lines per inch on the DI: station
!
WRITE #PDI; CHR$(1BH)+CHR$(32H)
This chapter contains examples of using the C-API to access 4610 printers. Not all code needed
for a robust application is included; specifically, error handling is not included.
// printer sessions
int sessDI; // DI session
int sessCR; // CR session
// open CR and DI
rc = sessDI = adx_topen_device((char _far *) "DI");
// write to ANDISPLAY
sessnum1 = adx_topen_device((char _far *) "ANDISPLAY");
adx_tclears(sessnum1,1);
adx_twrite_device(sessnum1, (unsigned char _far *) "4610 Error", 10);
adx_ttimer_set(0,3000L);
retry = 0;
// select CR station
adx_twrite_device(sessCR, (unsigned char _far *) CR, 4);
// cut CR paper
adx_twrite_device(sessCR, (unsigned char _far *) cut, 1);
// define constants
#define GL_4610 0x88000000L // is this a 4610 printer?
#define GL_HONOR 0x00000001L // honor station mode
#define GL_LANDSCAPE 0x00000002L // landscape (if honor)
// define constants
#define PL_4610 0x80 // set 4610 mode
This appendix contains suggestions for document handling in both portrait and landscape
modes.
X'1B;66;xx;yy'
where:
xx
Is the length of time the printer waits after receiving the command to print to the
selected document station (X'1B;63;30;04' or X'1B;63;30;08') until the document is
inserted.
If the document has not been detected by the end of the wait time, a document error
is sent to the system. The system continues to wait for a document to be inserted.
yy
Delay from the time the document is detected until it is grabbed by the printer (start
of document printing).
• Side insertion - closes the document's throat.
• Front insertion - pulls the document into the printer and feeds it to the Top of
Form.
2. Select the document station — Normal print mode:
X'1B;63;30;04'
X'1B;63;30;04'
Finish printing and release the document from the printer's rollers.
Note: The document station remains selected; the printer waits for another document
until the station is changed.
X'1B;66;xx;yy'
where:
xx
Is the length of time the printer waits after receiving the command to print to the
selected document station (X'1B;63;30;04' or X'1B;63;30;08') until the document is
inserted.
If the document has not been detected by the end of the wait time, a document error
is sent to the system. The system continues to wait for a document to be inserted.
X'1B;63;30;08'
A
If the document was not loaded previously:
• The document LED on the printer blinks until a document is detected.
• Once detected, the document is grabbed by the printer and is fed to the right
margin on the document. Because the document is inserted on its side, this is at
the top of the printer.
• If a document is not detected within the wait time (specified in the X'1B;66;xx;yy'
command), the printer sends error status to the system, and continues to wait.
The system can either cancel the print buffer, deleting all data in the print buffer,
or wait for a document to be inserted.
The printer appears to be hung until an action is taken.
B
If the document was loaded previously, the printer feeds the paper to the right
margin on the document.
3. Send print lines to be printed in this station.
The number of characters that can be printed on a line is dependent on the width of the
document. The print area is 80 mm high, starting 2 mm from the top of the document, and
the whole width of the document except for 34 mm from the right edge and 1 mm from the
left edge.
4. Print and eject document.
Finish printing and eject the document.
Note: The document station remains selected and the printer waits for another
document until the station is changed.
X'1B;63;30;04'
Finish printing and release the document from the printers rollers.
Note: The document station remains selected and the printer waits for another
document until the station is changed.
The following paragraph does not apply to the United Kingdom or any other country where
such provisions are inconsistent with local law: TOSHIBA GLOBAL COMMERCE SOLUTIONS
PROVIDES THIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR
PURPOSE. Some states do not allow disclaimer of express or implied warranties in certain
transactions, therefore, this statement may not apply to you.
This information could include technical inaccuracies or typographical errors. Changes are
periodically made to the information herein; these changes will be incorporated in new editions
of the publication. Toshiba Global Commerce Solutions may make improvements and/or
changes in the product(s) and/or program(s) described in this publication at any time without
notice.
Toshiba Global Commerce Solutions may use or distribute any of the information you supply in
any way it believes appropriate without incurring any obligation to you.
Any references in this information to non-Toshiba Global Commerce Solutions Web sites are
provided for convenience only and do not in any manner serve as an endorsement of those
Web sites. The materials at those Web sites are not part of the materials for this Toshiba Global
Commerce Solutions product and use of those Web sites is at your own risk.
Information concerning non-Toshiba Global Commerce Solutions products was obtained from
the suppliers of those products, their published announcements or other publicly available
sources. Toshiba Global Commerce Solutions has not tested those products and cannot confirm
the accuracy of performance, compatibility or any other claims related to non-Toshiba Global
Commerce Solutions products. Questions on the capabilities of non-Toshiba Global Commerce
Solutions products should be addressed to the suppliers of those products.
This information is for planning purposes only. The information herein is subject to change
before the products described become available.
Numerics
4610 printer commands
print QR code command 105
N
notices
Toshiba 165
T
trademarks 166