The text of a manual · part 22 of 24
A758 USB Thermal Receipt and Impact Slip Printer: Owner's Guide, pages 211 to 220
Pages 211 to 220 of 235
The original document is the PDF (3.8 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 Axiohm A758
Page 211
Chapter 7: Programming Guide 203
Remove space/dash
X
Replace space/dash with 0 x
Examples of Variable Length Field Format Specifications
Account #, all characters in the field, keep spaces and dashes
A
Account #, all characters in the field, replace spaces and dashes xA
Account #, maximum 12 characters, keep spaces and dashes
12A
Account #, always 12 characters zero filled, remove spaces and dashes
012XA
(Parsing Parameter String Options - continued on the next page)
Other Parameters Error Number
E
One Digit Returned
0
Read OK
1
Read error: bad character, empty field invalid length, check digit invalid
Status
Field Separator
S
Two Digits Returned
01
No MICR data
09
Mexican check
08
Canadian check
05
Error in transit number
07
Error in account number
04
Error in check serial number
10
Business or commercial check
11
Amount field present
00
No error
'x
Field separator preceded by a single quote, so a field separator of the letter A would be sent as 'A (0x27 0x41). If a Carriage Return is specified as a separator (0x27 0x0D), a final Carriage Return must still terminate the parsing parameter string.
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
189-9200399 Rev.A
A758-D100 12/04
Page 212
204 Chapter 7: Programming Guide Country Code
Country Code
Check Type
Un
Km
L
One Digit Returned n returned if US check nothing returned if not US check
One Digit Returned m returned if Canadian check nothing returned if not Canadian check
One Digit Returned
1
Personal check
2
Business or commercial check
Ten parameters are more than enough to specify all variable length fields with a field separator each and other status information that may be helpful to an application. More than 10 parameters are not recommended because they use up space in non-volatile memory (NVRAM) available for the exception table. The parsing parameter string is stored packed in NVRAM starting at word 10, with the total byte length stored in the high order byte of word 10. While most parameters take two bytes of NVRAM, the following parameters take only one byte: B, D, E, S, L. None of the parsing examples in the following section take more than 14 bytes (seven words) of NVRAM. The exception table starts at word 20. If the parsing parameter string extends into word 20, then the first exception table entry is unavailable. Sample Parsing Formats The following strings show various sample formats that you can use assuming they meet your parsing format needs. Included with the sample format is a description of the data that is returned to the application. ESC w p 18 A <CR> ♦ Maximum 18 characters in the account number ♦
Final Carriage Return
ESC w p 18 X A <CR> ♦ Maximum 18 characters in the account number with spaces and dashes removed ♦
Final Carriage Return
ESC w p 18 x A <CR> ♦ Maximum 18 characters in the account number with spaces and dashes replaced with 0 ♦
Final Carriage Return
ESC w p 018 A <CR> ♦ Always 18 characters in the account number (high order zero-filled if necessary) ♦ A758-D100 12/04
Final Carriage Return
189-9200399 Rev.A
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
Page 213
Chapter 7: Programming Guide 205 ESC w p 018 X A <CR> ♦ Always 18 characters in the account number with spaces and dashes removed ♦
Final Carriage Return
ESC w p 018 x A <CR> ♦ Always 18 characters in the account number with spaces and dashes replaced with 0 ♦
Final Carriage Return
ESC w p T 18 X A 04C <CR> ♦ All characters in the transit number ♦
All characters in the account number (up to 18) with spaces and dashes removed
♦
Always four characters in the check number (zero-filled if check number is only three characters long)
♦
Final Carriage Return
ESC w p K9 X T 18 X A 04C <CR> ♦ U.S. check: all nine characters in the transit number (because there are no dashes) ♦
Canadian check: dash in transit number removed; “9” inserted at beginning, resulting in a fully numeric nine character transit number
♦
All characters in the account number (up to 18) with spaces and dashes removed
♦
Always four characters in the check number (zero-filled if check number is only three characters long)
♦
Final Carriage Return
ESC w p T '/ A '/ C '/ S <CR> ♦ All characters in the transit number ♦
Field separator: /
♦
All characters in the account number
♦
Field separator: /
♦
All characters in the check number
♦
Field separator: /
♦
Two-digit status
♦
Final Carriage Return
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
189-9200399 Rev.A
A758-D100 12/04
Page 214
206 Chapter 7: Programming Guide Notes All parameters are ASCII characters, i.e. greater than or equal to 0x20, with the exception of a non-ASCII character enclosed in single quotes as a field separator. This applies both to parameter specifications sent from application to printer, and to MICR data returned from printer to application. Parameters are positional; their order in the parameter string is the order in which the parsed MICR data will be returned. Unrecognized parameters will be ignored, and processing of the parsing parameters will stop. Any data remaining after the unrecognized parameter will be treated as normal input data. If parameters are not defined (for example, 1B 77 50 <CR> or 1B 77 70 <CR>) parsing is not selected. One status byte followed by all decoded MICR characters will be returned. This is the default parsing format if no other is selected: Status
Status Byte Value
Good read, data follows
0x00
Bad read, data follows
0x01
No check present, no data
0x02
Paper jam, no data
0x03
No MICR characters, no data
0x04
MICR Characters
ASCII
Hexadecimal
Numerics
0...9
0x30...0x39
Unrecognized Character
?
0x3F 0x20
Space Amount symbol
&
0x26
Dash symbol
'
0x27
“on us” symbol
(
0x28
Transit symbol
)
0x29
Once a parsing format is specified, the following values are returned: MICR Characters
ASCII
Hexadecimal
Numerics
0...9
0x30...0x39 0x20
Space Dash
-
0x2D
Field separator* Country code* *As specified in the parsing parameter string Check Serial Number Parsing the Check Serial Number
A758-D100 12/04
189-9200399 Rev.A
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
Page 215
Chapter 7: Programming Guide 207 Most banks print the check serial number in three easily recognizable spots. The printer firmware will look for the number in these spots, using the following ordered algorithm. The examples use letters to represent symbols on the check: t
Transit symbol o
“on us” symbol
$
Amount symbol
-
Dash c
Check serial number x
Any other number
A number bracketed by “on us” symbols in the auxiliary “on us” field is the check serial number. occcccco txxxxxxxxxt xxxxxxxxo Otherwise, a three or more digit number to the right of the rightmost “on us” symbol, and to the left of the leftmost amount symbol if an amount field is present, is the check serial number. txxxxxxxxxt xxxxxxxxo cccc txxxxxxxxxt xxxxxxxxo cccc $xxxxxx$ If both of these searches fail to produce the check serial number, extract the whole account number field from between the rightmost transit symbol and the rightmost “on us” symbol. A three, four, or five-digit number to the right of the rightmost transit symbol, separated by a space or a dash from the rest of the account number is the check serial number. txxxxxxxxxt cccc xxxxxxxxo txxxxxxxxxt cccc-xxxxxxxxo txxxxxxxxxt cccc xxxxxxxxo xx If all of these searches fail to produce the distinct check serial number, and the check serial number field has been specified in the parsing parameter string options, no check serial number will be returned. If it is imbedded within the account number field, it will be returned as part of that variable length field. Exceptions Some banks print the check serial number in a location that cannot be electronically distinguished without specific exception information, although it can be visually distinguished because it is repeated in the upper right corner of the check. For these cases, the printer can hold up to nine exceptions for specific banks in its non-volatile memory (NVRAM), which is accessed by the read and write NVRAM commands. The specific bank is picked out by its transit number, and the firmware will look in the exception table for a transit number match before looking in the normal check serial number locations. In this example, without an exception table entry, the firmware would always pick the rightmost four-digit number as the check serial number following rule two above. The bank with the three-digit check serial number and the four-digit extension after the “on us” symbol would need to be exceptionally recognized: txxxxxxxxxt ccc-xxxxxxxxxxoxxxx txxxxxxxxxt xxx-xxxxxxxxxxocccc A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
189-9200399 Rev.A
A758-D100 12/04
Page 216
208 Chapter 7: Programming Guide In this example, without an exception table entry, the firmware would not be able to pick out the check serial number because it is not separated from the rest of the account number: txxxxxxxxxt ccccxxxxxxxxxxo In this example, without an exception table entry, the firmware would not be able to pick out the check serial number correctly, because it is imbedded within the rest of the account number: txxxxxxxxxt xxx-ccc-xxxxxxxxxxo 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 sum check 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 t123456780t12349876543210o
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 A758-D100 12/04
189-9200399 Rev.A
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
Page 217
Chapter 7: Programming Guide 209 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 Example 2 t22137-632t001 6042202o927540 2754 is the check serial # 6042202 is the account # To load the third table entry, which starts at word 30, the transit number 2137632 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 010 100 001
00100 00111 00010 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. 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.
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
189-9200399 Rev.A
A758-D100 12/04
Page 218
210 Chapter 7: Programming Guide
Check Flip Command Check Flip Command ASCII: ESC w F Hexadecimal: 1B 77 46 Decimal: 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 Chapter 4: Media and Supplies, Forms Specification page on 59) to be flipped. If not, the check is fed back to the user. Exception: This command is available only in A758 Native Mode.
Enhanced Check Flip Status Reporting Command ASCII: ESC w G Hexadecimal: 1B 77 46 – 47 Decimal: 27 119 70 – 71 A758-D100 12/04
189-9200399 Rev.A
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
Page 219
Chapter 7: Programming Guide 211 Performs the same operation as Hex 1B 77 46, and returns a successful or error code. Code
Description
0 (00h)
Successful check flip.
1 (01h)
Check/Slip not detected by (at least) outside slip sensor.
2 (02h)
Flip sensor is covered when should not be. Slip stuck in flip mechanism.
3 (03h)
Outside slip sensor covered. Inside slip sensor uncovered. 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. 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.
9 (09h)
Slip motor times out after flip sensor is covered. Check misses flip gate. (continued on next page)
10 (0Ah)
Slip motor times out while check is being fed into the flip mechanism (to cover flip sensor) Check missed being diverted by flip gate or jammed.
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.
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 sensor to be covered.
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide
189-9200399 Rev.A
A758-D100 12/04
Page 220
212 Chapter 7: Programming Guide
User Data Storage Commands Write to User Data Storage ASCII: ESC ‘ m a0 a1 a2 d1 ... dm Hexadecimal: 1B 27 m a0 a1 a2 d1 ... dm Decimal: 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. 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. If any of the memory locations addressed by this command are not currently erased, the command is not executed.
A758-D100 12/04
189-9200399 Rev.A
A758 USB Thermal Receipt and Impact Slip Printer: Owner’s Guide