The text of a manual · part 4 of 5
Monarch 6017 HandiPrint Printer Programmer's Manual, pages 28 to 36
Pages 28 to 36 of 44
The original document is the PDF (3.7 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 Monarch HandiPrint 6017
Page 28
Loading New Characters This step allows you to load the new characters at a particular position in the set. Command Summary Command
Description
<ESC>-' D ' -<font><code> -<matrix>
Loads a character at a particular position. <font>
The font to save the character in. Value
ASCII Fonts
Extended ASCII and ANSI Fonts
0
Large Normal Standard Bold
Large Normal Standard Bold Standard Normal
1
Standard Normal
Large Rotated Reduced Bold Reduced Normal
2
Reduced Bold Reduced Normal
<code>
The hex character code for the new character: 21 hex – 7F hex (ASCII) or 80 hex – FF hex (Extended ASCII and ANSI).
#matrix#
The hex data from the matrix describing the new character (see “Defining New Characters”).
The Next Step You have now modified the character set. The next step is to save the font.
Saving Modified Fonts To save the modified font into flash memory, use ESC -' D ' -FF hex. When the fonts have been saved, the printer sends a ‘!’ character to the ha ndheld. Then, it sends an ‘X’ character every 500 milliseconds. Next, remove the battery and wait several seconds before replacing it.
4-4 Modifying Resident Fonts
Page 29
USING THE MAGNETIC CARD READER
5
Optional. Your printer may have a magnetic card reader, which reads up to three tracks of magnetically encoded data from cards conforming to the ANSI/ISO 7810 and 7811 standards. After reading the data, the printer returns the information to the handheld. Before preparing the reader for a swipe, the handheld wakes the printer up by sending a few characters to it. The printer responds with XON to indicate the reader is ready. Command Summary Command
Description
ESC -'M' -#timer#< t r a cks>-CR
Prepares the reader for a magnetic card swipe. The reader’s LED turns on when the printer receives this command, indicating it is waiting for the operator to swipe the card. On a successful swipe, the LED goes out. #timer#
Sets the reader’s timer. If the operator does not swipe the card through the reader before the timer runs out, an error occurs. Values are 00-99 (seconds). 00 disables the timer.
<tracks>
The combination of tracks to read. 1
Track 1 only.
2
Track 2 only.
3
Track 3 only.
4
Tracks 1 and 2 together.
5
Tracks 2 and 3 together.
6
Tracks 1, 2, and 3 together.
Using the Magnetic Card Reader 5-1
Page 30
Command
Description The reader responds to the read command with: #trck#-(data)-' ? ' -CR-LF-NAK
2 hex (Ctrl-B)
#trck#
Track indicator. Values are %/1/ (track 1), ;/2/ (track 2), and +/3/ (track3).
(data)
The data read from the card. This field can be empty. If an error occurs, this field contains an E character and the error message text (see ”Error Messages”).
Requests the print buffer and card reader statuses. The printer responds with: ESC -'B' -#pb#-CR-LF-ESC -'M' -#sleep#-CR-LFNAK
ESC-'C'
5-2 Using the Magnetic Card Reader
#pb#
The number of characters currently in the print buffer, shown as four hex digits, which are “OR’d” with 30 hex.
#sleep#
Four ASCII hex digits (which are “OR’d” with 30 hex) representing the time left before the printer enters sleep mode.
Cancels the reading process.
Page 31
Error Messages Following is the format of the data returned when an error occurs with the magnetic card reader. When an error occurs, the reader’s LED blinks once. Syntax
Description
'%' -' E , ' -#error#-' , ' -(text)CR-LF
Indicates an error occurred.
#error#,(text)
Error number and corresponding text. 05
Timeout Expired.
07
Invalid Track Number.
08
Unsupported Track Selected.
09
Cancel Request.
Considerations ♦
We recommend designing your applications so the user can manually enter data when the reader cannot read a card.
♦
Keep the value for the timer long enough to allow the swipe, but small enough to not allow multiple swipes. If multiple swipes are done (with different cards) and each uses different tracks to store data, the data sent back to the handheld will be a mixture from the two cards .
Using the Magnetic Card Reader 5-3
Page 32
5-4 Using the Magnetic Card Reader
Page 33
USING THE BAR CODE SCANNER
6
The operator can use the handheld’s scanner indirectly from buttons on the printer. This functionality must be built into the appli cation. The printer does not do the scanning. It communicates with the handheld, indicating the operator is pressing the printer’s scanner buttons, and the handheld should activate the scanner. The application must integrate these commands with the commands running the scanner. For example, using the API commands, the application must enable the scanner and define the connection to the printer buttons before performing the scan. The interaction between the printer and handheld goes as follows: 1.
The application defines the data the handheld expects from the printer to indicate the printer’s button(s) are being pressed.
2.
When the operator presses the printer button(s), the printer automatically sends the data indicating the buttons are being pressed.
3.
When the operator releases the printer button(s), the printer automatically sends the data indicating the buttons have been released.
4.
The handheld disables the printer’s scanner buttons.
Using the Bar Code Scanner 6-1
Page 34
Command Summary Command
Description
ESC -'Y' -(on)-(onstring)(off)-(offstring)
Defines what data the handheld expects from the printer to indicate the printer buttons are being pressed, and when they are not.
(on) (onstring) (off) (offstring)
The number of characters in (onstring). The data indicating the buttons are being pressed. The number of characters in (offstring). The data indicating the buttons have been released.
Example ESC -'Y' -'2' -'ON'-'3' -'OFF'
Specifies to enable/disable the scanner buttons with the words ON and OFF.
ESC -'Y00'
Disables the printer’s scanner buttons.
6-2 Using the Bar Code Scanner
Page 35
A
SAMPLE APPLICATION This appendix describes a sample application that prints the following sales receipt.
Application Code The printer’s data stream is integrated with the commands that make up the handheld’s application. For example, the application must define and initialize variables, open the serial port and allocate memory before it sends the data stream to the printer.
Sample Application A-1
Page 36
Dim ESC Dim CR Dim CmdString Dim Buffer Dim BufferSize Dim iSerialPort Dim iReturn Dim CRLF Dim LF Dim NAK Dim Byte Dim String
'Declare variables
ESC = Chr(27) CR = Chr(13) CRLF = Chr(13) & Chr(10) LF = Chr(10) NAK = Chr(21) Byte = "" String=""
'Initialize variables
LPrint(Chr(24)) LPrint(ESC & "P#") LPrint(ESC & "F1") LPrint(ESC & "k3") LPrint(ESC & "A0")
'Reinitialize Printer 'Online Mode 'ASCII Chars 'Font 3 'Zero space between lines
A-2 Sample Application