The text of a manual · part 13 of 16
A760 Two-Color Thermal/Impact Hybrid Printer User Guide: Programming Supplement, pages 119 to 128
Pages 119 to 128 of 154
The original document is the PDF (2.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the TPG A760
Page 119
Revision F January 2010
A760 User Guide: Programming Supplement
119
Chapter 4: Programming commands
Loading the exception table The exception table begins at word 20 in NVRAM. Each entry takes five words. There is room for eight exceptions with a sumcheck written in the last word. An application can load local exceptions into the printer using the write
NVRAM command: 0x1B 0x73 n1 n2 k which writes the two byte word n1:n2 to word k in NVRAM.
Exception table entry format Each exception table entry consists of five words. The first two words contain the first eight characters of the transit number by packing the low order nibble of the numeric transit number characters. For Canadian checks, eliminate the dash and store the eight numerics. The next three words are used as six individual bytes to tell the firmware how to interpret the MICR characters that fall to the right of the rightmost transit symbol. Each of the six bytes is positional and consists of two parts: character type and number. The three high order bits of each byte mark the character type. The characters can be marked in three ways: check serial # character, account # character, or “skip this character or symbol.”
The five low order bits of each byte contain the number of characters of that type to extract. Most exceptions will not need to use all six bytes; in that case clear the unused bytes to zero. Bits within byte
7
6
5
4
3
2
1
0
Check serial # character string
0
0
1 n n n n n
Account # character string
0
1
0 n n n n n
Character string to ignore
1
0
0 n n n n n
Example 1
Example 2 t123456780t12349876543210o t22137–632t001 6042202o927540
1234 is the check serial # 9876543210 is the account #
To load the second table entry, which starts at word 25, the transit number 123456780 would be stored in the first two words of its table entry using this string of commands: 0x1B 0x73 0x12 0x34 25 0x1B 0x73 0x56 0x78 26
After the right transit symbol are immediately the four characters of the check serial #, followed immediately by the ten characters of the account number. These would be bitwise encoded as: and
0 0 1 0 0 1 0 0 (check #, four characters) 0 1 0 0 1 0 1 0 (account #, 10 characters)
then stored in the other three words of the table entry using: 0x1B 0x73 0x24 0x4A 27 0x1B 0x73 0x00 0x00 28 0x1B 0x73 0x00 0x00 29
2754 is the check serial # 6042202 is the account #
To load the third table entry, which starts at word 30, the transit number 2137–632 would be stored in the first two words of its table entry using this string of commands: 0x1B 0x73 0x22 0x13 30 0x1B 0x73 0x76 0x32 31
After the right transit symbol are four characters to skip, a seven digit account number, two characters to skip, and finally a four digit check serial #. The final character to skip need not be encoded. These would be bitwise encoded as: 100 00100 010 00111 100 00010 001 00100
(skip four characters) (account #, seven characters) (skip two characters) (check #, four characters)
then stored in the other three words of the table entry using: 0x1B 0x73 0x84 0x47 32 0x1B 0x73 0x82 0x24 33 0x1B 0x73 0x00 0x00 34.
Page 120
120
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Maintaining the exception table Present contents of the exception table can be examined using the read NVRAM command: 0x1B 0x6A k which reads and returns word k in NVRAM. When the exception table is full, a new entry can replace an older, less frequently used entry, by merely rewriting the words for that table entry.
Check flip commands Check flip command ASCII Hexadecimal Decimal
ESC w F 1B 77 46 27 119 70
Causes a check on the slip table to be fed into the printer, flipped and left with the trailing edge of the check in the slip feed rollers. Prior to the flip, the check is measured to see that it is of an appropriate size (see A760 ColorPOS® User Guide Chapter 5: Paper and Supplies, Forms Specification) to be flipped. If not, the check is fed back to the user.
Exception
This command is available only in A758 emulation and A760 native mode.
Enhanced check flip status reporting command ASCII Hexadecimal Decimal
ESC w G 1B 77 46 – 47 27 119 70 – 71
Performs the same operation as Hex 1B 77 46, and returns a successful or error code.
See chart on next page.
Page 121
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Code
Description
Code
Description
0 (00h)
Successful check flip.
9 (09h)
1 (01h)
Check/slip not detected by (at least) outside slip sensor.
Slip motor times out after flip sensor is covered.
2 (02h)
Flip sensor is covered when should not be.
Check misses flip gate. 10 (0Ah)
Slip stuck in flip mechanism. 3 (03h)
Check missed being diverted by flip gate or jammed.
Outside slip sensor covered. Inside slip sensor uncovered.
11 (0Bh)
Flip motor times out during check being fed into flip mechanism to cover flip sensor.
12 (0Ch)
Slip motor times out while continuing to feed check farther into flip mechanism to uncover inside flip sensor.
Slip feed rollers open or slipping on check. 4 (04h)
Slip motor times out while running check backward to uncover the inside slip sensor. Slip feed roller slipping or check jammed.
5 (05h)
Slip motor times out while running check forward to find trailing edge and measure check length. Check is too long or jammed.
6 (06h)
Check length less than specified minimum.
13 (0Dh) Flip motor times out while continuing to feed check farther into flip mechanism to uncover inside slip sensor. 14 (0Eh)
Slip motor times out while receiving check out of flip mechanism to cover inside slip sensor.
15 (0Fh)
Flip motor times out while pushing check out of flip mechanism to cover inside slip sensor.
31 (1Fh)
Flip sensor remains covered after check should be out of flip mechanism.
47 (2Fh)
Slip motor times out while running check out of slip station while waiting for outside slip
Check is to short 7 (07h)
Check length more than specified maximum. Check is too long
8 (08h)
Slip motor times out while running check backwards towards flip mechanism. Does not require covering/uncovering sensors.
Slip motor times out while check is being fed into the flip mechanism (to cover flip sensor)
sensor to be covered.
121
Page 122
122
A760 User Guide: Programming Supplement
Revision F January 2010
Chapter 4: Programming commands
User data storage Write to user data storage ASCII Hexadecimal Decimal
ESC ‘ m a0 a1 a2 d1 ... dm 1B 27 m a0 a1 a2 d1 ... dm 27 39 m a0 a1 a2 d1 ... dm
Value of m:
0 – 255
Writes m bytes of data to the user data storage flash page at the address specified. The printer waits for m bytes of data following the 3-byte address, addr.
If any of the memory locations addressed by this command are not currently erased, the command is not executed.
Read from user data storage ASCII Hexadecimal Decimal
ESC 4 m a0 a1 a2 1B 34 m a0 a1 a2 27 52 m a0 a1 a2
Value of m:
0 – 255
Reads m bytes of data from the user data storage flash page at the address specified. Returns m bytes to the application, followed by a carriage return (0Dh).
Read from non-volatile memory ASCII Hexadecimal Decimal
ESC j k 1B 6A k 27 106 k
Range of k:
20 – 63 (decimal)
Reads a two-byte word from location k in the history EEROM. The printer returns the word at the next available opportunity.
Write to non-volatile memory (NVRAM) ASCII Hexadecimal Decimal
ESC s n1 n2 k 1B 73 n1 n2 k 27 115 n1 n2 k
Value of n1:
1st Byte
Value of n2:
2nd Byte
Range of k:
20 – 63 (decimal locations)
Writes the two-byte word, n1 n2, to location k in history EEROM.
The high order byte of the address (a0) ranges from 0 to n2–1, with n2 specified in the flash allocation command. If the flash allocation command has been used, the a0 = 0 always.
Page 123
Revision F January 2010
A760 User Guide: Programming Supplement
123
Chapter 4: Programming commands
Select memory type (SRAM/flash) where to save logos or user-defined fonts ASCII Hexadecimal Decimal
GS “ n 1D 22 n 29 34 n
Value of n:
48 – 51 n = 51 (ASCII n = 3) Hex 33 n = 48 (ASCII n = 0) Hex 30
Loads active logo to RAM only. This is used to print a special logo but not have it take up flash memory. A logo defined following this command is not preserved over a power cycle. The printer disables interrupts while writing to flash. Any command that cause data to be written to flash should be followed by a 50 Msec delay to allow significant time for the write operation. n = 49 (ASCII n = 1) Hex 31
Loads active logo to flash memory. This is the default condition for logo flash storage. A logo defined following this command is stored in flash memory. n = 50 (ASCII n = 2) Hex 32
Loads user-defined characters to RAM only. This is the default condition for user-defined character storage. Any user-defined characters defined following this command are not preserved over a power cycle.
Loads user-defined characters to flash memory. An application must use this command to store user-defined characters in flash memory. Any user-defined characters defined following this command are stored in flash memory. A user-defined character cannot be redefined in flash memory. The flash memory page must be erased by an application before redefining user-defined characters. For more information, see the erase user flash sector (1D 40 n) command. Specifies whether to load the logos or user-defined characters to flash memory or to RAM (volatile memory). The selection remains in effect until it is changed via this command or until the power cycles. Related information
This command is recognized in A760 native mode. In A756 and emulations, parameter bytes go into the print buffer.
Flash memory user sectors allocation ASCII Hexadecimal Decimal
GS “ U n1 n 1D 22 55 n1 n2 29 34 85 n1 n2
Default Value of n1:
1 (see below)
Default Value of n2:
1 (see below)
n1 is the number of 64k sectors used for logos and user-defined characters. n2 is the number of 64k sectors used for user data storage. This command sets the allocation of flash sectors between user data storage and logos/user-defined characters. This allocation is saved in the EEPROM of the printer and is therefore saved across power cycles. The printer will respond to the flash allocation command being sent with ACK (06H). n1 + n2 <= 5 (dec) (1M) n1 + n2 <= 21 (dec) 15 (hex) (2M)
The A760 has been configured at the factory with 1M or 2M of flash memory.
Note: Flash memory is made up of user and program code. Therefore, the available flash memory space will vary with the amount of program code utilized. If n1 + n2 is greater than the maximum number of sectors available, the command is ignored. Reissuing this command with different parameters will erase all sectors. Exception
This command is available only in A758 emulation and A760 native modes.
Page 124
124
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Erase user flash sector ASCII Hexadecimal Decimal
GS @ n 1D 40 n 29 64 n
Value of n:
49 – 50 n = 49 (ASCII n = 1) Hex 31
This command erases all 64K flash memory sectors allocated to user-defined character and logos storage. Those sectors should be erased in two situations: when the logo definition area is full and an application is attempting to define new logos, and when an application wants to replace one user-defined character set with another. In both cases, all logos and character set definitions are erased and must be redefined. n = 50 (ASCII n = 2) Hex 32
This command erases all sectors available for user data storage. Erases a page of flash memory and sends a carriage return when the operation is complete.
Related information
See command “Flash memory user sectors allocation” (1D 22 55 n1 n2). Important: While erasing flash memory, the printer disables all interrupts, including communications. To provide feedback to the application, the printer responds to the application when the erase is complete. After sending the erase user flash sector (1D 40 n) command, an application should wait for the response from the printer before sending data. Otherwise, data will be lost. If an application is unable to receive data, it should wait a minimum of ten seconds after sending the erase user flash sector (1D 40 n) command before sending data.
Page 125
Revision F January 2010
A760 User Guide: Programming Supplement
125
Chapter 4: Programming commands
User storage status (ColorPOS®) ASCII Hexadecimal Decimal
GS 0x97 m n 1D 97 m n 29 151 m n
Value of m:
m specifies the type of stored object to be reported:
m=0 return the kilobytes (1024) of free user RAM, n = 0 gets largest free block size n = 1 gets the total size free m=3 return the CRC of a logo indexed by n
Downloaded character sets are identified by integer extending the existing code page selection as enumerated in the select international character set (= select character code table) command. The firmware standard list is incrementally extended each time a new single or double byte set is downloaded.
m=5 return the CRC of a macro that has been stored, n = 0
Single byte downloaded fonts are selected by m = 3 and 0x40 <= n < 0x80.
For m = 0 the value of n selects a return of either the largest free block or total free size, since contiguous allocation cannot be assumed as this area is completely under user control through address parameters. n=0 if only one instance of an object type is allowed (macro, user data, user defined characters).
n is the item index when more than one object of type m is possible n <= FE, see the comments about logo and character set indexes n = FF :
return a list describing all the existing items of type m
Note: When a specific item request is made, a returned CRC value of 0 0 indicates that no item is stored at that index. There is a practically negligible possibility that a valid object will have a 0 0 CRC; if this is of concern, applications should check the object downloaded byte sequence to verify that this is not the case (as well as store the CRC as an “ID” for the object if needed later for return value comparisons).
Since there are only three double-byte character sets supported, the value 0x80 / 0xA0 / 0xC0 selects the first, second, third downloaded double byte font respectively. In return, each downloaded double byte character band is reported individually as 0xC0, 0xC1, 0xC2 ….for as many bands as have been defined. This command returns the state of occupancy of available flash storage and user RAM. The printer response for each item is a 4 byte header, 0x1D 0x97 nL nH (number of bytes that follow in the response) and for each item a 4 byte structure: 1st m (type) byte 2nd n index byte followed by a 2 byte CRC in Lo Hi order of the data string in that storage space. The return for m = 0–2 is the header and one 4-byte item giving remaining storage space in the CRC position in Lo Hi order: 1D 97 4 0 m 0 fL fH, where f is the kBytes of storage remaining. Note that RAM storage space is not content typed, while available flash is statically divided into logo, character set, and user data types. Change of the divisions is possible via flash erasure and flash allocation commands. If the communication protocol is RS-232C – Xon/ Xoff, then “X symbol substitution response” should be configured with the setting communications parameters command (US STX , 1F 02).
Page 126
126
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Flash download These commands are used to load firmware into the printer. The commands are listed in numerical order according to their hexadecimal codes. Each command is described and the hexadecimal, decimal, and ASCII codes are listed. There are three ways to enter the download mode. 1. Powering the printer up with DIP Switch 1 up. 2. While the printer is running normally, send the command, “Switch to flash download mode” (1B 5B 7D) to leave normal operation and enter the download mode. 3. If the flash if found corrupted during level 0 diagnostics the download mode is automatically entered after the printer has reset. The printer never goes directly from the download mode to normal printer operation. To return to normal printer operation either the operator must turn the power off and then on to reboot or the application must send a command to cancel download mode and reboot. DIP switch 1 must in DOWN position during reboot to return to normal printer operation.
When each flash download command is received, the printer returns either ACK or NAK to the host computer when each command is received: • ACK (hexadecimal 06) Sent when the printer has received a host transmission and has completed the request successfully. • NAK (hexadecimal 15) Sent when a request is unsuccessful. Communicates to the printer information downloaded from applications. Data is downloaded to flash memory to query the state of the firmware, calculate the firmware CRC and other functions.
Switch to flash download mode ASCII Hexadecimal Decimal
ESC [ } 1B 5B 7D 27 91 125
Puts the printer in flash download mode in preparation to receive commands controlling the downloading of objects into flash memory. When this command is received, the printer leaves normal operation and can no longer print transactions until the reboot the printer command (1D FF) is received or the printer is rebooted. This command does not affect the current communication parameters. Once the printer is in flash download mode, this command is no longer available.
Related information
See entering flash download mode elsewhere in this book to put the printer in flash download mode using the configuration menu.
Page 127
Revision F January 2010
A760 User Guide: Programming Supplement
127
Chapter 4: Programming commands
Return boot sector firmware part number ASCII Hexadecimal Decimal
GS NULL 1D 00 29 0
Returns ACK (Hex 06) + 12 bytes ASCII string describing the flash memory boot sector firmware part number. Ex : 189–1234567A
Exceptions
Available only in download mode.
Return segment number status of flash memory ASCII Hexadecimal Decimal
GS SOH 1D 01 29 1
Returns the size of the flash used. There may be 16 (1 Meg) or 32 (2 Meg) sectors in flash memory. This command assures that the firmware to be downloaded is the appropriate size for flash memory. The value returned is the maximum sector number that can be accepted by the select sector to download (1D 02 nn) command.
Exceptions
Available only in download mode.
Select flash memory sector to download ASCII Hexadecimal Decimal
GS STX nn 1D 02 nn 29 2 nn
Value of n:
The flash sector to which the next download operation applies
Range of n:
0
Exceptions
Available only in download mode.
Selects the flash sector (n) for which the next download operation applies. The values of the possible sector are restricted, depending upon the flash part type. The printer transmits an ACK if the sector number is acceptable or an NAK if the sector number is not acceptable. Sector numbers start at 0.
Get firmware CRC ASCII Hexadecimal Decimal
GS ACK 1D 06 29 6
Causes the printer to calculate the CRC for the currently selected sector and transmits the result. This is performed normally after downloading a sector to verify that the downloaded firmware is correct. The printer also calculates the CRC for each sector during power up and halts the program if any sector is erroneous.
The printer transmits ACK if the calculated CRC is correct for the selected sector; NAK if the CRC is incorrect or if no sector is selected.
Page 128
128
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Return microprocessor CRC ASCII Hexadecimal Decimal
GS BEL 1D 07 29 7
Returns the CRC calculated over the boot sector code space.
Formulas
ACK <low byte> <high byte>
Erase all flash contents except boot sector ASCII Hexadecimal Decimal
GS SO 1D 0E 29 14
Causes the entire flash memory to be erased.
Exceptions
The printer returns ACK if the command is successful; NAK if it is unsuccessful.
Available only in download mode.
Return main program flash CRC ASCII Hexadecimal Decimal
GS SI 1D 0F 29 15
Returns the CRC calculated over the flash firmware code space.
The format of the response is ACK <low byte> <high byte>.
Erase selected flash sector ASCII Hexadecimal Decimal
GS DLE n 1D 10 n 29 16 n
Value and range of n:
0–7 = 512k bytes flash 0–15 = 1M bytes flash 0–31 = 2M bytes flash
Erases the previously selected sector. The printer transmits ACK when the sector has been erased. If the previous sector is not successfully erased, or if no sector was selected, the printer transmits NAK.
Exceptions
Available only in download mode.