Each product and program carries a respective written warranty, the only warranty on
which the customer can rely. Paxar reserves the right to make changes in the product
and the programs and their availability at any time and without notice. Although Paxar
has made every effort to provide complete and accurate information in this manual,
Paxar shall not be liable for any omissions or inaccuracies. Any update will be
incorporated in a later edition of this manual.
Monarch®, Pathfinder®, Ultra®, MPCL, and 6039 are trademarks of Paxar Americas, Inc.
Paxar® is a trademark of Paxar Corporation.
Avery Dennison® is a trademark of Avery Dennison Corporation.
UFST, Monotype, the Monotype logo, and CG Triumvirate are trademarks of Monotype Imaging, Inc.
Avery Dennison Printer Systems Division
170 Monarch Lane
Miamisburg, OH 45342
The .NET framework includes compilers for Microsoft Visual Basic and
Microsoft Visual C#. This manual includes samples for both Visual
Basic and Visual C#.
Information in this document supercedes information in previous versions.
Check our Web site (www.paxar.com) for the latest documentation and
release information.
1
Audience
This manual is written for experienced Microsoft® Visual Studio® .NET
2003 and 2005 programmers who write printer applications for the
Microsoft® Windows® CE 5.0 platform. These programmers should also
be familiar with the Monarch® Printer Control Language (MPCLII).
Using this Manual
Following is a summary of the contents of this manual:
Chapter Contents
1 Introduction Information you should know before using the SDK.
Developing
2
Applications
Printing
3
Functions
Scanning
4
Functions
Sample
A
Applications
Information about developing applications using the
SDK.
Contains syntax, definitions, and examples of each
printing function.
Contains syntax, definitions, structures, and examples of
each scanning function.
Sample applications written using Microsoft Visual
Basic and Microsoft Visual C# .
Introduction 1-1
System Requirements
Following are the hardware and software requirements:
Software Requirements
♦ Windows® 2000 Professional Edition and Windows® 2000 Service
Pack 3 or later; or Windows® XP Professional Edition and Windows®
XP.
Note: The Microsoft® Windows Vista™ operating system is not
currently supported.
♦ Microsoft ActiveSync synchronization software. The ActiveSync
software is available on the Microsoft Web site (Microsoft.com) by
searching on ActiveSync.
♦ Microsoft® Visual Studio® .NET 2003 or 2005
Minimum Hardware Requirements
♦ Desktop computer with Pentium® II, 450Mhz
(Pentium® III, 600Mhz recommended)
♦ Super VGA or higher monitor
♦ CD-ROM or DVD-ROM drive
♦ 96 MB (128 MB recommended) memory for Windows® 2000
Professional and 160 MB for Windows® XP Professional
♦ 900 MB of free hard disk space
♦ USB port
♦ USB cable (part number 125859).
1-2 Programmer’s Manual
SDK Contents
The SDK is located in the directory you specified during installation. It is
divided into several sub-directories, as described below.
Sub-directory Description
bin Development tools
docs Online documentation
include Include files
lib Library files
samples Source code samples
utilities Utility programs
Related Documentation
The following table describes other documentation for the printer:
Item Description
Quick Reference
Operator’s Handbook
Packet Reference Manual
System Administrator’s
Guide
Includes basic start-up information such as
supply loading, cleaning and minor
troubleshooting.
Includes information about using the printer,
charging the battery, loading supplies, and
more.
Includes syntax descriptions of the MPCL
printer language to design a format.
Includes information about printer diagnostics,
configuring the scanner, and using scanner
diagnostics.
Introduction 1-3
About the Printer
There are several printer features that you must understand before you
write an application, such as the speaker, memory, display, and
keyboard.
Speaker
Applications can make the printer’s speaker beep for different lengths of
time and frequencies or play a .wav file. For example, you might use the
speaker to bring an error to the operator’s attention or to indicate a good
scan. Refer to the Microsoft® Visual Studio® .NET 2003 or 2005
documentation to use the speaker.
Memory
The printer contains 64 MB of Flash memory and 32 MB of RAM. The
Flash memory contains the kernel and permanent storage used for user
applications.
Display
The printer has a touch screen display (with a backlight) similar to a hand
held computer. Refer to the Microsoft® Visual Studio® .NET 2003 or
2005 documentation to write messages to the display.
Scanner
Each printer comes with the Symbol SE-955 bar code scanner.
See Chapter 4, “Scanning Functions” for functions and data structures for
scanning.
1-4 Programmer’s Manual
Keyboard
The printer’s keyboard
appears to the right.
Refer to the Microsoft®
Visual Studio® .NET 2003
or 2005 documentation to
use the keyboard.
Key(s) Description
Enter
Tab
Fct
Alpha
Right
Arrow
Left
Arrow
On/Off
Numeric/
Alphabetic
Accepts data or a menu selection.
Tabs to the next tab stop or the next field. Pressing Fct + Tab
backspaces a tab stop or returns to the previous field.
Performs an application-defined function when pressed with a
single-digit number.
Enters upper case or lower-case alphabetic mode.
Moves the cursor to the right in a menu.
Pressing Fct + right arrow scrolls the cursor down in a menu.
Moves the cursor to the left in a menu.
Pressing Fct + left arrow scrolls the cursor up in a menu.
Backspaces in Alpha mode.
Turns on and off the printer.
Displays a numeric digit or letter.
Introduction 1-5
Fonts
The printer has many resident fonts. You must load other fonts
separately. Following is a list of these fonts and their IDs:
Standard (1), Reduced (2), Bold (3),
OCRA (4), HR1 (5), and HR2 (6)
EFF Swiss Bold (50)
CG Triumvirate Typeface Bold
(Full Character Set) 6.5 pt. (1000)
CG Triumvirate Typeface Bold
(Full Character Set) 10 pt. (1002)
CG Triumvirate Typeface Bold
(Partial Character Set) 18 pt. (1004)
CG Triumvirate Typeface Bold
Condensed (Full Character Set)
6.5 pt. (1006)
CG Triumvirate Typeface Bold
Condensed (Full Character Set)
10 pt. (1008)
CG Triumvirate Typeface Bold
Condensed (Partial Character Set)
18 pt. (1010)
Letter Gothic Bold (Full Character
Set) 6 pt. (1012)
CG Triumvirate Typeface Bold
9 pt. (10)
CG Triumvirate Typeface 6 pt. (11)
CG Triumvirate Typeface Bold
(Full Character Set) 8 pt. (1001)
CG Triumvirate Typeface Bold
(Full Character Set) 12 pt. (1003)
CG Triumvirate Typeface Bold
(Partial Character Set) 22 pt. (1005)
CG Triumvirate Typeface Bold
Condensed (Full Character Set)
8 pt. (1007)
CG Triumvirate Typeface Bold
Condensed (Full Character Set)
12 pt. (1009)
CG Triumvirate Typeface Bold
Condensed (Partial Character
Set) 22 pt. (1011)
Letter Gothic Bold (Full Character
Set) 9 pt. (1013)
Note: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.
Using Non-Resident Fonts
Within your application, instantiate a new Print class such as rPrint and
call a method such as Text or File to load the non-resident font or a font
you have created with the MPCL Toolbox Font Utility.
1-6 Programmer’s Manual
DEVELOPING APPLICATIONS
This chapter describes how to develop an application for the
printer.
You will need to:
1. Create MPCL packets for your labels and tags, if needed.
2. Write the application.
3. Build the application.
4. Transfer or copy the application to the printer. See “Transferring
Files” for more information.
2
Creating MPCL Packets
An application prints labels by submitting MPCL packets to the printer.
Refer to the 6039 Packet Reference Manual for more information.
Within your application, instantiate a new Print class such as rPrint and
call a method such as Text when you need to print. For example,
This example prints the data stored in the fmtUPCA string and quotation
marks (decimal value 34) around the data stored in the txtUPC.Text field.
The rPrint.Text lines contain the batch data.
2-2 Programmer’s Manual
C# Sample
using Ultra; // Platinum Library
string fmtUPCA = "{F,1,A,R,E,200,200,\"UPCA\"|"
+ "C,150,49,0,50,8,8,A,L,0,0,\"Demo C Sharp\",1|"
+ "B,1,12,F,25,28,1,4,100,7,L,0|}";
Ultra.Print rPrint = new Print(); // Instantiate Print
// class
rPrint.ClearError(); // Clear any errors
if (!rPrint.IsBatteryOKToPrint) // Check Battery
MessageBox.Show("Low Battery", "Battery Check");
This example prints the data stored in the fmtUPCA string and the data
stored in the txtUPC.Text field. The rPrint.Text lines contain the
batch data.
Developing Applications 2-3
Writing Applications
The SDK is designed to work with the Microsoft® Visual Studio®
development system using the .NET 2003 and 2005 framework. This
compiler can be downloaded free of charge from the Microsoft.com Web
site.
Note:To lock access to functions, such as the display, video, control
panel, refer to your standard Microsoft Windows
documentation.
Building Applications
When you are finished writing the application, select Build Application
to build and then, Deploy Application to download the application. The
application and associated files can also be copied by using the
procedure defined in “Transferring Files.”
In addition, you can also Build a Cab File. Refer to your Microsoft®
Visual Studio® .NET documentation for more information.
Import Files
You must always use Ultra.dll. This .dll file contains the scanning and
printing information.
For Socket programming, refer to your standard Microsoft® Windows
documentation.
2-4 Programmer’s Manual
Scanner Function Overview
The scanner contains a buffer to hold the data from a scan. The
application receives data from the system by one of two methods. The
first method is by the standard keyboard input and second method is by a
special Windows message. See Chapter 4, “Scanning Functions” for
information about the two methods.
Using the Scanner
To use the scanner, the application must:
1. Include the code to instantiate the class. For example, using
VB.NET:
Dim MyScanner As New Ultra.Scan.General
MyScanner.Postamble = “\n\r”
Dim Scanner As New Ultra.Scan.Control
Scanner.SendScanStatus = False
2. Configure the control scanning attributes and the attributes for each
bar code. For example, using VB.NET:
Dim UPC As New Ultra.Scan.UPCEAN
UPC.EnableUPCA = True
UPC.EnableUPCE = False
3. Call the CommitChanges function to save the new settings. For
example, using VB.NET
Scanner.CommitChanges()
Developing Applications 2-5
Transferring Files to the Printer
To transfer files between the printer and a computer, you need to have
Microsoft ActiveSync Synchronization Software installed on your
computer.
Download the ActiveSync synchronization software from the
Microsoft.com Web site. Follow the download instructions on the site.
To transfer data files to the printer:
1. Open the folder with your data files on your computer.
2. Turn on the printer and wait thirty seconds for the desktop to load.
Note: For large file transfers, change the Switch State to Suspend
setting on the printer to a longer delay time so the printer does
not shut down during the transfer.
3. Attach the USB cable to your computer and printer.
4. Click Explore on the Microsoft ActiveSync utility after it connects to
the printer. A new window appears called Mobile Device.
5. Open the destination folder for the data files on the Mobile Device
(printer).
6. Drag the files from your computer to the Mobile Device folder.
2-6 Programmer’s Manual
Programming Notes
♦ Include the Ultra.dll import file in all your applications. Without it, you
are not able to access any scanner or printing functions.
For example,
Imports Ultra ‘ for VB.NET
Using Ultra; // for C#
♦
Test your application once you have loaded it into the printer.
♦ The libraries included in this SDK are designed to support Microsoft®
Visual Basic® 2003 and 2005; therefore, some function names
changed. Visual Basic and Visual Studio® 2005 are case insensitive.
Visual C#® is case sensitive. Many developers use the same name
for Type Defines and functions, just by varying the case. However,
varying the case creates a new name and your application may not
function as designed.
♦ Train the end users (operators) and/or their supervisor (system
administrator) on the application. They also must know how to
perform procedures (loading supplies, for example) that may vary from
the generic descriptions in the Operator’s Handbook.
♦ When a file is saved in RAM, it is lost when the charge in the main
battery and backup battery has been depleted. A file saved in the
Onboard Flash folder or SD (Secure Digital) memory card is saved
even when both batteries have been depleted.
♦ For Socket programming, refer to your standard Microsoft Windows
documentation.
♦ When you are finished writing the application, select Build
Application to build and Deploy Application to download the
application. In addition, you can also Build a cab file. Refer to your
Microsoft® Visual Studio® .NET documentation for more information.
♦ To lock access to functions, such as the display, video, control panel,
refer to your standard Microsoft Windows documentation.
Developing Applications 2-7
2-8 Programmer’s Manual
PRINTING FUNCTIONS
The SDK contains a library of functions you can call in your
application. The functions are divided into two categories: Printing
Interface and Scanning Interface.
This chapter describes the printer management functions and data
structures. See Chapter 4, “Scanning Functions” for scanning functions.
The function and data structure names are case-
Note:Refer to the Microsoft® Visual Studio® .NET 2003 or 2005
documentation to configure the keyboard, sound, and display.
The libraries included in this SDK are designed to support Microsoft®
Visual Basic® 2003 and 2005; therefore, some function names changed.
Visual Basic and Visual Studio® 2005 are case insensitive. Visual C#® is
case sensitive. Many developers use the same name for Type Defines
and functions, just by varying the case. However, varying the case
creates a new name and your application may not function as designed.
Type Functions
Stock
Battery nBatteryLevel IsBatteryOKToPrint
Printing
Sensors fBlackMark fOnDemand
Misc
Calibrate
nStockType
Feed
File
Text
LastPrintStatus
ClearError
nStatus
sensitive.
TextDoubleByte
Byte
FileParse
LockCfgMenu
ShiftMode
3
Printing Functions 3-1
Stock
Calibrate
Description
Calibrates the supplies in the printer and gives the supply information to
the Print subsystem.
Operators can load supplies (as described in the Operator’s Handbook)
before running an application, but they cannot calibrate the supplies until
the application calls this function. In general, you should display a
prompt (“Load your supplies,” for example) and require the operator to
press a key, such as the trigger, to call this function.
Do not use this function when using fax paper because it has no black
mark to detect.
Syntax
public void Calibrate()
Parameters
None
Return Values
None
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); // Instantiate class
rPrint.Calibrate(); // Calibrate Supply
}
Example VB.NET
Imports Ultra
Dim rPrint As New Print ' Instantiate class
rPrint.Calibrate(); ' Calibrate Supply
3-2 Programmer’s Manual
nStockType
Description
Sets the supply type in the printer.
public eSTOCK_TYPE nStockType
Parameters
STOCK_PAPER
STOCK_FAX
STOCK_SYNTHETIC
Paper
Fax
Synthetic
Return Values
STOCK_PAPER
STOCK_FAX
STOCK_SYNTHETIC
Paper
Fax
Synthetic
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); // Instantiate class
rPrint.nStockType = Ultra.Print.eSTOCK_TYPE.STOCK_PAPER;
// Stock Type = Paper
}
Example VB.NET
Imports Ultra
Dim rPrint As New Print ' Instantiate class
rPrint.nStockType = rPrint.eSTOCK_TYPE.STOCK_PAPER;
' Set Stock Type to Paper
Printing Functions 3-3
Battery
IsBatteryOKToPrint
Description
Checks if the printer’s LiIon battery (located in the handle) is charged
enough to allow printing. Check the battery level before any printing
session.
Use this function immediately prior to printing, but not
during printing. If you use it during printing, the return
value is not accurate.
Syntax
public bool IsBatteryOKToPrint
Parameters
None
Return Values
FALSE
TRUE
The battery level is too low to allow printing.
The battery level is high enough to allow printing.
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); //Instantiate class
rPrint.ClearError(); // Clear any errors
if (!rPrint.IsBatteryOKToPrint) // Not OK to Print
Imports Ultra
Dim rPrint As New Print ' Inst anti ate cla ss
rPrint.ClearError() ' Clear any errors
If (Not rPrint.IsBatteryOKToPrint) Then ' NotOK to Print?
MsgBox("Low Battery", MsgBoxStyle.OKOnly, "Battery Check")
3-4 Programmer’s Manual
nBatteryLevel
Description
Retrieves the LiIon battery’s level. This battery is located in the printer’s
handle. This returns a value between 1 and 100, the percentage of
charge left in the battery. Check the battery level before any processing.
Use this function immediately prior to printing, but not
during printing. If you use this function during
printing, the return value is not accurate.
Syntax
public int nBatteryLevel
Parameters
None
Return Values
0
1 –100
412
You must charge the battery.
The battery level is high enough to run the printer and
print.
Could not retrieve the current battery level. Retry the
function.
Example C#
using Ultra;
{
int nStat;
Ultra.Print rPrint = new Print(); //Instantiate class
nStat = rPrint.nBatteryLevel;
MessageBox.Show("Battery at " + nStat.ToString() + "
using Ultra;
{
Ultra.Print rPrint = new Print(); //Instantiate class
rPrint.Feed(); // Feed a Label
}
Example VB.NET
Imports Ultra
Dim rPrint As New Print ' Instantiate class
rPrint.Feed() ' Feed a Label
Printing Functions 3-7
File
Description
Writes MPCL packets to the Print subsystem.
You can send more than one packet at a time in a file.
A batch packet starts a print job, which makes an asynchronous call to
the Print subsystem. After submitting a print job, the application should
call LastPrintStatus in a loop, waiting until the printer becomes free.
Syntax
public string File
Parameters
FileName to be sent for printing
Return Values
None
Example C#
using Ultra;
string strScanData = "C39";
Ultra.Print rPrint = new Print(); //Instantiate class
rPrint.File = "\\Onboard Flash\\C39Fmt.txt";
Writes a string to the Print subsystem. MPCL packets can be sent as a
string. After sending a completed MPCL Packet use the LastPrintStatus
function to get a status of the MPCL Packet.