Avery 6035 User Manual

MONARCH
DOS-based
PATHFINDER
System
Ultra
TC6035PM Rev. CA 6/01 ©1998 Monarch Marking Systems, Inc. All rights reserved.
TABLE OF CONTENTS
Introduction............................................................................................. 1-1
About this Manual .................................................................................. 1-2
System Requirements ............................................................................ 1-2
Hardware Requirements....................................................................1-3
Software Requirements.....................................................................1-3
SDK Contents........................................................................................1-4
Related Documentation.........................................................................1-5
Printer Features....................................................................................... 2-1
Display...................................................................................................2-2
Keypad..................................................................................................2-3
Speaker.................................................................................................2-4
Memory .................................................................................................. 2-4
Flash ROMs ........................................................................................... 2-5
Fonts.....................................................................................................2-7
Scanners...............................................................................................2-8
Using the Scanners...........................................................................2-9
Scanner Function Overview ............................................................... 2-9
Boot Process.......................................................................................2-10
Normal Boot.....................................................................................2-10
Display Control ................................................................................ 2-11
Boot Options....................................................................................2-12
Booting from the PC........................................................................2-12
Windows 95/Network Notes.................................................................2-13
Directory Names .............................................................................. 2-13
Copying Data from the Printer to PC...............................................2-13
Developing Applications ......................................................................... 3-1
Overview................................................................................................3-2
Creating MPCLII Packets.......................................................................3-3
Assessing Memory Needs......................................................................3-3
Writing Applications...............................................................................3-5
Building Applications.............................................................................3-6
Compiling Applications......................................................................3-6
Linking Applications...........................................................................3-7
Using REMSERV and REMDISK............................................................3-8
Testing the Application ..........................................................................3-9
Creating Disk Images..........................................................................3-10
Using the First Flash ROM Only......................................................3-10
Using Both Flash ROMs...................................................................3-11
Loading Disk Images into the Printer...................................................3-11
Recovering from a Disk Image Loading Problem.............................3-12
Exiting REMSERV and REMDISK........................................................3-12
Testing the Application Away from the PC...........................................3-12
Training the End Users ........................................................................ 3-12
Function Reference................................................................................. 4-1
KbdClrFunct...........................................................................................4-2
KbdGetMode ..........................................................................................4-3
KbdRestoreMode...................................................................................4-4
KbdSetAlpha .......................................................................................... 4-6
KbdSetCaps...........................................................................................4-8
KbdSetFunct ..........................................................................................4-9
KbdSetNormal......................................................................................4-11
pclBatteryOkToPrint............................................................................4-12
pclCalibrate.........................................................................................4-13
ii Programmer’s Manual
pclCalibratePaper ................................................................................4-18
pclClearError.......................................................................................4-20
pclClose...............................................................................................4-21
pclFeed................................................................................................4-22
pclGetBatteryLevel..............................................................................4-24
pclGetBlackMarkSensor.......................................................................4-26
pclGetErrorMsg....................................................................................4-28
pclGetOnDemandSensor......................................................................4-30
pclGetSupplyType................................................................................4-32
pcl
Init.................................................................................................4-34
pclOpen...............................................................................................4-36
pclPaperInfo........................................................................................4-37
pclPaperSetup.....................................................................................4-38
pclStatus.............................................................................................4-41
pclWrite...............................................................................................4-42
scnCloseScanner ................................................................................. 4-43
scnGetBarCodeType ............................................................................ 4-45
scnGetch.............................................................................................4-48
scnGetche...........................................................................................4-50
scnGetCodabarInfo ..............................................................................4-52
scnGetCode128Info.............................................................................4-53
scnGetCode39Info...............................................................................4-54
scnGetCode93Info...............................................................................4-55
scnGetD2of5Info ..................................................................................4-56
scnGetGeneralInfo...............................................................................4-57
scnGetI2of5Info...................................................................................4-58
scnGetMSIInfo .....................................................................................4-59
scnGets...............................................................................................4-60
Table of Contents iii
scnGetScanInfo...................................................................................4-62
scnGetScannedData............................................................................4-63
scnGetUPCEANInfo.............................................................................4-66
scnOpenScanner.................................................................................4-67
scnOpenScannerShared......................................................................4-69
scnScannerHit.....................................................................................4-72
scnSetCodabarInfo..............................................................................4-75
scnSetCode128Info.............................................................................4-77
scnSetCode39Info...............................................................................4-79
scnSetCode93Info...............................................................................4-81
scnSetD2of5Info..................................................................................4-83
scnSetGeneralInfo ...............................................................................4-85
scnSetI2of5Info...................................................................................4-87
scnSetMSIInfo.....................................................................................4-89
scnSetScanInfo....................................................................................4-91
scnSetUPCEANInfo.............................................................................4-93
scnTrigger...........................................................................................4-96
spkBeep...............................................................................................4-97
sysGetBIOSVersion.............................................................................4-98
vidBackLightOn..................................................................................4-100
vidGetState........................................................................................4-101
vidPutCursor......................................................................................4-102
vidPutStr............................................................................................4-103
vidReadCA.........................................................................................4-105
vidReadCursor ...................................................................................4-107
vidScroll............................................................................................4-108
vidSetCursorType..............................................................................4-110
vidSetMode........................................................................................4-112
iv Programmer’s Manual
vidSetPage........................................................................................4-113
vidWriteC ...........................................................................................4-115
vidWriteCA.........................................................................................4-117
Data Structure Reference.......................................................................5-1
CODABARINFO.....................................................................................5-2
CODE128INFO......................................................................................5-4
CODE39INFO........................................................................................5-5
CODE93INFO........................................................................................5-7
D2OF5INFO ...........................................................................................5-8
GENERALINFO .................................................................................... 5-10
Scan Security Levels.......................................................................5-11
I2OF5INFO..........................................................................................5-13
MSIINFO .............................................................................................. 5-15
PRINTINIT...........................................................................................5-17
Font Memory Requirements ............................................................. 5-17
SCANINFO...........................................................................................5-19
UPCEANINFO ......................................................................................5-23
Scan Security Levels.......................................................................5-27
Programming Techniques....................................................................... 6-1
Printing Single Labels........................................................................6-3
Printing Multiple Labels ..................................................................... 6-3
Reprinting Labels..............................................................................6-4
Pausing While Printing..........................................................................6-4
Loading Multiple Packets Together........................................................6-5
Building Packets Dynamically ................................................................ 6-5
Using the Scanner.................................................................................6-5
Reading Trigger Presses.......................................................................6-6
Table of Contents v
Utility and Driver Reference...................................................................7-1
DUMP....................................................................................................7-2
FLASH...................................................................................................7-4
LCD.......................................................................................................7-6
ONLINE.................................................................................................7-8
RDISK.SYS .......................................................................................... 7-10
REMDISK.............................................................................................7-11
REMQUIT.............................................................................................7-14
REMSERV...........................................................................................7-15
ROMDISK............................................................................................7-18
SDISK.SYS ..........................................................................................7-20
Sample Applications ............................................................................... A-1
Sample 1...............................................................................................A-2
Sample 2...............................................................................................A-2
Sample 3...............................................................................................A-3
Sample 4...............................................................................................A-4
Sample 5...............................................................................................A-5
Sample 6...............................................................................................A-5
vi Programmer’s Manual
INTRODUCTION
1
Welcome to the MONARCH® DOS-based PATHFINDER® Ultra® printer’s software development kit (SDK). The SDK consists of software and both online and printed documentation.
This chapter introduces the kit, describing
About this Manual System Requirements SDK Contents Related Documentation
Introduction 1-1
About this Manual
This manual is written for experienced Microsoft® C/C++ programmers who write applications for the printer. These programmers should also be familiar with Monarch’s MPCLII printer language.
The following table describes the conventions used in this manual.
Convention Description
[ ]
Ellipses indicate the preceding item is repeated one
Italics An item appearing in italics is a variable, a function
Bold An item appearing in bold is being emphasized. + A plus sign placed between two keys indicates to
Brackets indicate optional items.
or more times .
parameter, or a value of a variable.
press the keys at the same time.
System Requirements
Following are the hardware and software requirements for the SDK. Refer to your Windows™ and C/C++ documentation for additional requirements.
1-2 Programmer’s Manual
Hardware Requirements
You need an IBM® PC or 100% compatible with
80486 or higher processor VGA monitor (SVGA recommended) at least 8 MB of memory (16 MB recommended) hard disk with 8 MB of free space (not including the space
needed for C/C++)
Microsoft Windows 3.1- or Windows 95®-compatible CD-
ROM drive
serial port Microsoft mouse or compatible pointing device either of the following serial cables:
9-pin female to 8-pin male PC cable (part #11658730) 25-pin female to 8-pin male PC cable (part #11658731).
Software Requirements
Your PC needs the following software:
Microsoft Windows 3.1 or Windows 95 Any third-party products for serial communications
(purchased separately)
Microsoft C/C++ 1.52 The SDK.
Introduction 1-3
SDK Contents
The SDK software and online documentation files are located in the directory you specified during installation and several sub­directories, described in the following table.
Sub-directory Description acropdf Online documentation dos ROM-DOS files bin Development tools include Include files lib Library files samples Source code samples font MPCLII packets containing the printer’s external
base fonts
images Pre-built ROM disk images
1-4 Programmer’s Manual
Related Documentation
The following table describes other documentation for the printer.
Item Describes…
ROM-DOS User Manual The Datalight ROM-DOS operating
system that runs on the printer.
Equipment Manual Printer operation. Application Notes Technical information needed for
application development (beyond writing a C/C++ program). It contains information on radio networks, memory cards, etc.
MPCLII Packet Reference
Manual MONARCH quick-set
software Label Designer Online Help
MONARCH quick-set software Font Utility Online Help
The MPCLII printer language.
The Label Des igner. This utility creates designs for labels the application prints and translates the designs into MPCLII packets.
The Font Utility. This utility converts TrueType and HP fonts into MPCLII font pac kets.
Introduction 1-5
1-6 Programmer’s Manual
PRINTER FEATURES
2
There are several printer features that you must understand to write applications. For example, knowing the printer has a display does not help. You must know its size, how it treats messages written to it, how the rows and columns are numbered, and which functions manipulate it.
This chapter describes the following printer features:
Display Keypad Speaker Memory Flash ROMs Fonts Scanners Boot Process Windows 95/Network Notes
Printer Features 2-1
Display
The printer has either a 4- or 8-row display of 20 characters each. The printer can display characters in either reverse or normal video. A display backlight is also available.
Several functions that manipulate the display use a coordinate system to access a certain point on the display. Coordinate (0,0) (row, column) is the display’s upper-left corner.
Printers with 4-row displays have four virtual display pages (numbered 0-3), and printers with 8-row displays have two display pages (numbered 0-1). Each display page has its own cursor. Only one page appears on the display at a time. To ensure the
application begins on the same display page every time, use
vidSetPage to set the display page at the application’s beginning.
display pages are empty at the application’s beginning, use
vidScroll to clear the pages at the application’s beginning and end.
An application can manipulate any display page, regardless of the current page. To manipulate the display, use the functions with the vid prefix (see Chapter 4, “Function Reference”).
If the application writes to
a display page other than the current one, the displayed
information does not appear until the application uses vidSetPage to switch to the new display page.
the current display page, the displayed information appears
immediately.
2-2 Programmer’s Manual
You may want the application to write messages longer than 20 characters to the display or have a command move the cursor. If you use standard C functions such as the application, the message wraps to the next line and the cursor moves. The vid functions truncate the message if it extends beyond the twentieth column and only vidPutCursor moves the cursor.
The display is not compatible with any
standard IBM PC display adapter. There is
no program-accessible video memory.
printf, puts, and putc in
Keypad
The following table describes the keypad’s data entry modes.
Mode Acceptable Keys
Numeric/Normal Numbers, symbols, and arrows Upper-case Alpha Upper-case letters Lower-case Alpha Lower-case letters Function Key Function keys
Normally, when entering data, the operator must enter and exit the modes manually. However, using the Kbd functions described in Chapter 4, an application can change between the modes automatically (although the operator could still manually change modes). When you first turn the printer on, it is in Numeric/Normal mode.
Multiple modes can be in effect at the same
time.
Using the trigger is a special case of Function Key mode. See “Reading Trigger Presses” in Chapter 6 for more information.
For more information about the data entry modes, refer to the Equipment Manual.
Printer Features 2-3
Speaker
Applications can make the printer speaker beep for different lengths of time and frequencies. You may use the speaker to bring an error to the operator’s attention or to indicate a good scan. The spkBeep function (described in Chapter 4) manipulates the speaker.
Memory
The printer has 1 MB of memory, excluding the two flash ROMs described later in this chapter. The application can use only the lower 640K (address 00000H to 0x9FFFF), unless you use the SDISK.SYS driver. See “SDISK.SYS” in Chapter 7 for more information.
You cannot use memory managers,
HIMEM.SYS, RAM disks or load DOS high in
any memory above the lower 640K.
2-4 Programmer’s Manual
Following is the address map.
F000:0
E000:0
D000:0 C000:0
B000:0
A000:0
:0 70:0 40:0
0:0
100000H
BIOS
DOS
Reserved System Area
Application Program Space
xxx
DOS Data BIOS Data Vectors
PCMCIA Memory Mapping
System Device and Image RAM
Area
Flash ROMs
The printer also has two memory areas called flash ROMs. You load disk images (containing the application and related files) into the flash ROMs with the Flash Loader Utility.
Each flash ROM contains 1 MB, of which 832K is available for the first flash ROM and 960K for the second.
Flash ROMs are read-only, except when you
load a disk image.
Printer Features 2-5
The printer recognizes the first flash ROM automatically. For the printer to recognize the second flash ROM, you must load RDISK.SYS in the CONFIG.SYS file. Without RDISK.SYS, you can still load a disk image into the second flash ROM, but you cannot access it.
When you have loaded disk images into the flash ROMs, you can access them like a disk drive on your PC. A: is the letter designation for the first flash ROM. B: is the letter designation for the second one (assuming you are using RDISK.SYS). Following are the flash ROM memory maps.
Flash ROM 1 Flash ROM 2
1024 KB
960 KB
896 KB 832 KB
Flash System Save Area
BIOS/DOS
File Space
File Space
The printer uses 1K to 5K of the file space for the file access table. The table’s size depends on the number of files in the disk image and the space they use.
2-6 Programmer’s Manual
For more information, see
“Creating Disk Images” in Chapter 3 “Loading Disk Images into the Printer” in Chapter 3 “FLASH” in Chapter 7.
Fonts
The printer comes with a set of base fonts, one of which is internal (or resident) in the printer. The ID for the internal font (which is reduced) is 2. To use another base font or a font you have created with the Font Utility, the application must
1. Allocate memory to use for the fonts. See “PRINTINIT” in Chapter 5 for more information.
2. Initialize the Print subsystem by calling pcl “pcl
Init” in Chapter 4 for more information.
3. Open the font file with pclOpen. The base font files are located in the SDK’s Font sub-directory.
Following are the base fonts.
Font File Name Font
CG Triumvirate Bold (Full Character Set)
1001BOAF.PCL 1001 8 1002BOAF.PCL 1002 10 1003BOAF.PCL 1003 12 CG Triumvirate Bold
(Partial Character Set)
1005BOAS.PCL 1005 22
1000BOAF.PCL 1000 6.5
1004BOAS.PCL 1004 18
Init. See
Point Size
ID
Printer Features 2-7
Font File Name Font
ID
Point Size
CG Triumvirate Bold
1006BOAF.PCL 1006 6.5 Condensed (Full Character Set)
1007BOAF.PCL 1007 8 1008BOAF.PCL 1008 10 1009BOAF.PCL 1009 12 CG Triumvirate Bold
1010BOAS.PCL 1010 18 Condensed (Partial Character Set)
1011BOAS.PCL 1011 22 Letter Gothic Bold
1012BOAF.PCL 1012 6 (Full Character Set)
1013BOAF.PCL 1013 9
The partial character set fonts contain only
numeric and special characters. With fonts
1012 and 1013, the space character is only
70% as wide as the other characters.
Scanners
The printer comes with either of two bar code scanners: the 1222 or the 1223.
The 1223 scanner is more versatile than the 1222 scanner. Applications can configure it in more ways and it can scan more bar codes.
1223 scanners are compatible with scanning
applications written for the 1222 scanners.
The reverse is not true.
2-8 Programmer’s Manual
Using the Scanners
Processing
ype
Scanner Buffer
Application Buffer
2 1 3
2
To use the either scanner, the application must
1. Enable the scanner with scnOpenScanner or scnOpenScannerShared. scnOpenScanner takes over the printer’s serial port (preventing other RS-232 communications), but scnOpenScannerShared shares the port. Therefore, when using scnOpenScanner, the application should disable the scanner immediately before serial communications and enable it immediately afterwards. To avoid processing delays, use
scnOpenScannerShared when possible.
2. Configure the scanner (optional). To learn how to configure the scanner, see the appropriate scn functions in Chapter
4, “Function Reference”.
3. Call various scanner functions, such as scnGets.
4. Close the scanner with scnCloseScanner.
Scanner Function Overview
scnGets
scnTrigger
scnGetch scnGetche scnScannerHit scnGetBarCodeT
scnGets
scnGetScannedData
Application
Printer Features 2-9
The scanner contains a buffer to hold the data from a scan. The application should contain a buffer of its own if it needs to save the data before scanning again. Processing works as follows:
1. Initiate the scan, putting the data in the scanner buffer with either scnGets or scnTrigger.
2. Either:
Process the data directly in the scanner buffer with
scnGetch, scnGetche, scnGetBarCodeType, or scnScannerHit.
Save the data in the application buffer with scnGets
(continued from step 1) or scnGetScannedData.
The application buffer must be one byte
longer than the largest string that you may
scan.
3. If needed, process the data in the application buffer.
Boot Process
The printer’s boot process is straightforward and flexible enough to enable you to do a variety of things as needed, such as running (or not running) AUTOEXEC.BAT or only certain lines in AUTOEXEC.BAT.
Normal Boot
When the printer boots normally:
1. The Monarch screen appears. By default, the display is disabled (nothing other than the Monarch screen appears). It becomes enabled later in this process (if the command is given). See “Display Control” for more information.
2. A line moves left to right across the display’s bottom to indicate the boot’s progress.
2-10 Programmer’s Manual
3. The printer loads CONFIG.SYS (if it exists) and runs AUTOEXEC.BAT. When AUTOEXEC.BAT does not exist, is bypassed (see “Boot Options”), or does not enable the display, the printer prompts the operator for the date and
time.
If the printer never enables the display, the
Monarch screen never disappears and the
printer waits indefinitely for a response to
the date prompt.
4. If there is an LCD command in AUTOEXEC.BAT that enables the display or you enable the display manually (by holding down f when you turn the printer on) the printer
enables the display.
5. The Monarch screen disappears and the DOS prompt appears.
Display Control
You can either enable or disable the display.
Enabling the Display
To enable the display, either
hold down f while turning the printer on. When messages
appear on the display, release the key.
If you continue to hold down f after the
messages appear, the display moves to fast
mode.
include the LCD command in AUTOEXEC.BAT.
CONFIG.SYS messages are still disabled, because the printer processes it first. See “LCD” in Chapter 7 for more information.
Disabling the Display
To disable the display, include the LCD N command in AUTOEXEC.BAT. See “LCD” in Chapter 7 for more information.
Printer Features 2-11
Boot Options
When DOS begins loading, you have the following options for processing CONFIG.SYS and AUTOEXEC.BAT:
Bypass the files Be prompted whether to process each line of both files Process every line of both files.
To choose the boot options:
1. Turn on the printer while holding f down until messages appear. You must do this step. Otherwise, the date and time prompts (the default) wait for input without appearing
on the screen.
2. When “Starting ROM-DOS…” appears, the printer beeps. You have approximately two seconds to do one of the
following:
Press f, then 5 to bypass both files. The boot
process continues with default configurations. The printer also prompts you for the date and time.
Press f, then 8 to request a prompt at each line of
both files. Enter Y to process the line or N to bypass it.
Do nothing and let the printer process every line of both
files.
Booting from the PC
To boot the printer from the PC:
1. Gather the necessary boot files (see “Creating Disk Images” in Chapter 3) on a floppy disk or the root partition
of a non-booting hard drive.
2. Run REMSERV from the PC, using the boot files’ location as the shared drive.
2-12 Programmer’s Manual
3. Turn on the printer while holding a down until boot messages display. The printer mounts a backup drive (A:) in memory. The printer beeps twice when it starts to boot from the PC. The booting continues using the default configurations. The printer also prompts you for the date
and time.
The PC boot drive becomes drive B: on the
printer.
Windows 95/Network Notes
Directory Names
The printer does not recognize directory names longer than 8 characters, not including the extension.
Copying Data from the Printer to PC
The procedure to copy data from the printer to a PC varies, depending on your system.
FAT32, NTFS, and Networks
1. Copy the file from the printer to a diskette.
2. Copy the file from the diskette to the PC’s hard drive.
FAT16 File Systems
1. Reboot your PC in DOS mode. You must reboot. For this procedure to work, you cannot go to the DOS shell.
2. Connect the cable between the PC and the printer.
3. Lock the PC’s hard drive by entering the DOS lock
command at the DOS prompt. Enter Y at the “Are You Sure (Y/N)?” prompt.
4. Run Remserv on the PC, specifying the locked drive.
5. Run Remdisk on the printer.
Printer Features 2-13
6. Copy the file(s) from their location on the printer to the printer’s mapped drive. Include a complete path when copying. The default is that the file is saved in the root
directory.
7. Exit Remserv.
8. Unlock the PC’s hard drive by entering the DOS unlock
command at the DOS prompt.
The file(s) you copied are stored in the PC’s root directory.
2-14 Programmer’s Manual
DEVELOPING APPLICATIONS
3
Developing applications is a long, detailed process. You cannot just write the application in Microsoft C/C++. You must also understand the whole picture. For example, you must create MPCLII packets and assess the application’s memory needs.
This chapter describes this process. Following is a summary:
1. Create any needed MPCLII packets (if your application prints labels).
2. Assess the application’s memory needs.
3. Write the application.
4. Build (compile and link) the application.
5. Run REMSERV on the PC and REMDISK on the printer to
enable the printer to access a disk drive on the PC.
6. Test the application with the printer attached to the PC.
7. Create a disk image.
8. Load the disk image into the printer’s flash ROM.
9. Quit REMSERV and REMDISK.
10. Test the application with the printer detached from the PC.
Developing Applications 3-1
Overview
The following diagram is an overview of this process.
sample.c
mmsultra.h
other includes
Compiler
mmsultra.lib
mmsult2d.lib
other libraries
Linker
sample.exe
True Type
Fonts
HPCL4 Fonts
HP Laser Jet
Fonts
Font Utility
fontx.pcl formatx.fabsample.obj
format1.fmt
formatx.fmt
ROMDISK
Label
Designer
autoexec.bat
config.sys
command.com
data files
Personel Computer Printer
3-2 Programmer’s Manual
disk.img
Flash Loader
Flash ROM
Creating MPCLII Packets
An application prints labels by submitting MPCLII packets to the printer. You can create these packets manually with the MPCLII Packet Reference Manual or automatically with Label Designer.
To create the packets in Label Designer,
select Save As MPCL… from the File Menu
after completing the label.
To test your packets without writing an application, use the ONLINE Utility. See “ONLINE” in Chapter 7 for more information.
Assessing Memory Needs
When you write your application, you must determine the application’s memory needs. This information helps you decide, for example, if you need a memory card to supplement the printer’s memory.
Developing Applications 3-3
Loading...
+ 203 hidden pages