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
Page 8
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
Page 9
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
Page 10
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
Page 11
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
Page 12
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
Page 13
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
Page 15
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
Page 16
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
Page 17
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
Page 18
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
Page 19
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
Page 20
2-8 Programmer’s Manual
Page 21
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
Page 22
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
Page 23
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
Page 24
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
Page 25
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
Page 28
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.
Retrieves status of the last MPCL packet processed by the Print Engine.
Syntax
public int LastPrintStatus
Parameters
None
Return Values
0
703-793
Other
non-zero
Successful.
A motion control error occurred. After the operator corrects the
printer condition, the application must call ClearError to reset the
Motion Control subsystem. Refer to the 6039 Packet Reference Manual for more information.
Error has occurred. Refer to the 6039 Packet Reference Manual
for more information.
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); //Instantiate class
If (rPrint.LastPrintStatus <> 0) Then ' Print Status
MsgBox(nStat, MsgBoxStyle.Exclamation, "Print Error")
End If
Printing Functions 3-13
Page 34
TextDoubleByte
Description
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.
Syntax
public string TextDoubleByte
Parameters
String to be sent to print
Return Values
None
Example C#
using Ultra;
Ultra.Print rPrint = new Print(); //Instantiate class
rPrint.Text = "{F,4,A,R,E,200,200,\"Japan\"|";
rPrint.Text = "C,50,0,0,139,2,2,B,L,0,0,\"";
rPrint.TextDoubleByte = “\x82C6\x82C6\x82BD”;
strScanData + "\"|}";
rPrint.Text = "{B,4,N,1|E,0,0,1,1,0,1|}";
Writes a byte array to the Print subsystem. MPCL packets can be sent as
a byte array. After sending a completed MPCL Packet use the
LastPrintStatus function to get a status of the MPCL Packet.
Import Ultra
Dim fmtC39 As String = "{F,1,A,R,E,200,200," & Chr(34) &
"C39" & Chr(34) & "|" _
& "C,150,49,0,50,8,8,A,L,0,0," & Chr(34) & "M6039" & Chr(34)
& "|" _
& "T,1,22,V,6,1,0,1,1,1,O,C,0,0|" _
& "B,2,20,V,23,2,4,12,100,8,C,0|}"
Dim strScanData As String = "C39"
Dim rPrint As New Print ' Instantiate class
rPrint.Text = fmtC39
rPrint.Byte = "{B,1,N,1|E,0,0,1,1,0,1|"
rPrint.Byte = "1" & Chr(34) & strScanData & Chr(34) & "|"
rPrint.Byte = "2" & Chr(34) & strScanData & Chr(34) & "|}"
Printing Functions 3-17
Page 38
FileParse
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. This command is a different from the File
command by reading the passed file and sending the packets one by one
checking the status after each packet has been sent. Any data that is in
between the packets will not be sent to the printer.
Imports Ultra
Dim rPrint As New Print ' Instantiate class
Dim blnOnDemand As Boolean
blnOnDemand = rPrint.fOnDemand
If (blnOnDemand) Then ' If True
MsgBox("Blocked", MsgBoxStyle.Information, "OnDemand
Sensor")
Else ' If False
MsgBox("Not Blocked", MsgBoxStyle.Information, "OnDemand
Sensor")
End If
3-22 Programmer’s Manual
Page 43
Misc
ClearError
Description
Resets the Motion Control subsystem after an application receives a
motion control error (703-793).
The operator must correct the printer condition (a
supply jam, for example) before the application calls
this function.
Syntax
public void ClearError()
Parameters
None
Return Values
None
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); //Instantiate class
rPrint.ClearError(); //Clear Error
}
Example VB.NET
Imports Ultra
Dim rPrint As New Print ' Instantiate class
rPrint.ClearError(); ' Enable Clear Error
Printing Functions 3-23
Page 44
LockCfgMenu
Description
Allows the application to control access to all configuration menus for the
printer and scanner.
Syntax
public void LockCfgMenu(bool fLock)
Parameters
fLock
FALSE to release the lock on the menu.
TRUE to lock the menu.
Return Values
None
Example C#
using Ultra;
{
Ultra.Keypad rKeypad = new Keypad(); //Instantiate class
rKeypad.LockCfgMenu(true); //Lock Config Menu
}
Example VB.NET
Imports Ultra
Dim rKeypad As New Keypad ' Instantiate class
rKeypad.LockCfgMenu(True) ' Lock Config Menu
3-24 Programmer’s Manual
Page 45
nStatus
Description
Retrieves the Print subsystem’s status.
After submitting a print job, the application should call GetStatus in a
loop, waiting until the printer becomes free.
Syntax
public int nStatus(void)
Parameters
None
Return Values
0
1
406
412
601
756
762
763
791
703-793
not listed
above
The Print subsystem is ready.
The Print subsystem is busy.
MPCL parser error.
Could not communicate with the print engine.
Batch packet error.
Out of supplies or other motion error. Load supplies. The
application must call ClearError to reset the Motion Control
subsystem.
Low battery. Printing is disabled. Replace with a fully charged
battery. (Test labels can be printed.) The application must call
ClearError to reset the Motion Control subsystem.
Waiting to dispense label. The on-demand sensor may be
blocked. The application must call ClearError to reset the Motion
Control subsystem.
Error pending. Operator intervention is required to clear the
error. The application must call ClearError to reset the Motion
Control subsystem.
A motion control error occurred. After the operator corrects the
printer condition, the application must call ClearError to reset the
Motion Control subsystem. Refer to the 6039 Packet Reference Manual for more information.
Printing Functions 3-25
Page 46
Example C#
using Ultra;
{
Ultra.Print rPrint = new Print(); //Instantiate class
if (rPrint.nStatus > 1) // Check Status
MessageBox.Show(rPrint.nStatus.ToString(), "Status",
Imports Ultra
Dim rPrint As New Print ' Instantiate class
Dim nStat As String
nStat = Convert.ToString(rPrint.nStatus())
If (rPrint.nStatus > 1) Then ' Check Status
MsgBox(nStat, MsgBoxStyle.Exclamation, "Status")
End If
3-26 Programmer’s Manual
Page 47
ShiftMode
Description
Allows the application to determine the current shift mode of the keypad
and also to set the shift mode.
public eKSM_LEVEL ShiftMode
Parameters
KSM_NORMAL
KSM_FUNCTION
KSM_LOWERALPHA
KSM_UPPERALPHA
Normal Mode -Numeric (unshifted)
Function Mode (F1-F10)
Lower-case Alpha Mode
Upper-case Alpha Mode
Return Values
KSM_NORMAL
KSM_FUNCTION
KSM_LOWERALPHA
KSM_UPPERALPHA
Normal Mode -Numeric (unshifted)
Function Mode (F1-F10)
Lower-case Alpha Mode
Upper-case Alpha Mode
Example C#
using Ultra;
{
Ultra.Keypad rKeypad = new Keypad(); //Instantiate Class
rKeypad.ShitfMode = Ultra.Keypad.eKSMLEVEL.KSM_NORMAL;
// Force Keypad to numbers
}
Example VB.NET
Imports Ultra
Dim rKeypad As New Ultra.Keypad
rKeypad.ShiftMode = rKeypad.eKSM_LEVEL.KSM_NORMAL
' Instantiate class
' Force Keypad to numbers
Printing Functions 3-27
Page 48
3-28 Programmer’s Manual
Page 49
SCANNING FUNCTIONS
4
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 scanning functions and data structures. Refer
to Chapter 3, “Printing Functions” for printing.
The function and data structure names are case-
sensitive.
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.
Sets the AIM Duration, which is the duration of the aiming beam when the
scanner is activated.
Syntax
public int AimDuration
Parameters
AimDuration00 - 99 tenths of a second 0 disables. Default
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
//Instantiate Class
GENERAL.AimDuration = 0;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.AimDuration = 0
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-2 Programmer’s Manual
Page 51
BdirRedundancy
Description
Enables Bi-Directional Redundancy, which specifies that good scans must
occur in both directions (forward and reverse) for the scan to be
complete.
Syntax
public bool BdirRedundancy
Parameters
BdirRedundancyTRUE Scans must occur in both directions
FALSE Default
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
//Instantiate Class
GENERAL.BdirRedundancy = false;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.BdirRedundancy = False
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-3
Page 52
GoodScanWav
Description
Sets the file for a Good Scan. This sound is heard whenever a bar code
is successfully scanned. To have no sound, clear this field.
Syntax
public string GoodScanWav
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL.GoodScanWav = "ding.wav";
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.GoodScanWav = "ding.wav"
CONTROL.CommitChanges()
’ Save Changes to the Scanner Configuration
4-4 Programmer’s Manual
Page 53
LinearSecurity
Description
Sets the Linear Security, which is how many times to scan the same
barcode to determine a successful read. Select a higher level for lower
quality bar codes.
Syntax
public int LinearSecurity
Parameters
LinearSecurity1 – 4 scans Default: 1
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL. LinearSecurity = 1;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.LinearSecurity = 1
CONTROL.CommitChanges()
’ Save Changes to the Scanner Configuration
Scanning Functions 4-5
Page 54
NoReadWav
Description
Sets the file for a No Scan. This sound is heard whenever a bar code is
unsuccessfully scanned. To have no sound, clear this field.
Syntax
public string NoReadWav
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL.NoReadWav = "noscan.wav";
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.NoReadWav = "noscan.wav"
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-6 Programmer’s Manual
Page 55
Preamble
Description
Sets the Preamble, which specifies the characters to preface returned
data from scanning. The Preamble can be up to twenty user-defined
characters.
Syntax
public string Preamble
Parameters
Preambleup to 20 characters Default: Empty
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL.Preamble = "[";
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.Preamble = "["
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-7
Page 56
Postamble
Description
Sets the Postamble, which is the data to be sent after each scanned
barcode. The Postamble can be up to twenty user-defined characters.
Syntax
public string Postamble
Parameters
Postambleup to 20 characters Default: Empty
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL.Postamble = "]";
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.Postamble = "]"
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-8 Programmer’s Manual
Page 57
Timeout
Description
Sets the scan Timeout in tenths of seconds, which is the amount of time
the scanner beam is on before turning off when the trigger is pressed.
Syntax
public int Timeout
Parameters
Timeout5 – 99 tenths of a second Default: 30
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate class
GENERAL.Timeout = 30; (); // Timeout after 30 seconds
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.Timeout = 30
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-9
Page 58
Bar Code Classes
Codabar
Description
Sets the scanner configuration values for CODABAR bar code.
Syntax
public bool Enable
public bool FixedLength
public int Length1
public int Length2
public bool CLSIEdit
public bool NOTISEdit
Field Description
Enable
FixedLength
Length1
Length2
CLSIEdit
NOTISEdit
Enables/disables the ability to scan Codabar bar
codes. Default: FALSE
If FixedLength is TRUE, lengths 1 and 2 are fixed; if
FixedLength is FALSE, length 1 is the minimum and
length 2 is the maximum. Default: FALSE
Specifies lengths (including start and stop
characters) for Codabar bar codes.
Length 1: 0, 1-99, Default: 5
Length 2: 0, 1-99, Default: 55
Enables/disables the ability to strip the start and stop
characters from 14-character Codabar bar codes and
insert a space after the first, fifth, and tenth
characters. Default: FALSE
Enables/disables the ability to strip the start and stop
characters from Codabar bar codes. Default: FALSE
Return Values
None
4-10 Programmer’s Manual
Page 59
Example C#
using Ultra;
Ultra.Scan.Codabar CODABAR = new Ultra.Scan.Codabar();
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CODABAR As New Scan.Codabar ' Instantiate class
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CODABAR.Enable = True ' Enable Codabar Symbology
CODABAR.CLSIEdit = True ' Enable CLSIEDit
CODABAR.NOTISEdit = True ' Enable NOTISEdit
CODABAR.FixedLength = False ' Variable Length Enabled
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-13
Page 62
Code39
Description
Sets the scanner configuration values for Code39 bar code.
Syntax
public bool Enable;
public bool Trioptic;
public bool XlatetoCode32;
public bool Code32Prefix;
public bool FixedLength;
public int Length1;
public int Length2;
public bool VerifyCD;
public bool XmitCD;
public bool FullASCII;
Field Description
Enable
Trioptic
XlatetoCode32
Code32Prefix
FixedLength
VerifyCD
Enables/disables the ability to scan Code 39 bar
codes. Default: TRUE
Enables/disables the ability to scan Trioptic Code 39
bar codes. Do not enable Trioptic and FullASCII at
the same time. Default: FALSE
Enables/disables the ability to convert Code 39 bar
codes to Code 32 bar codes. You must enable Enable
when enabling this parameter. Default: FALSE
Enables/disables the ability to add “A” as a prefix to
all Code 32 bar codes. You must enable
xlatetoCode32 when enabling this parameter.
Default: FALSE
If FixedLength is TRUE, lengths 1 and 2 are fixed; if
FixedLength is FALSE, length 1 is the minimum and
length 2 is the maximum. Default: FALSE
Enables/disables the ability to check the integrity of
Code 39 bar codes. When this parameter is enabled,
only Code 39 symbols with a modulo 43 check digit
are decoded. Default: FALSE
4-14 Programmer’s Manual
Page 63
Field Description
XmitCD
FullASCII
Enables/disables the ability to transmit check digits
with the data. Default: FALSE
Enables/disables the ability to scan Full ASCII Code
39 bar codes. The scanner cannot distinguish Code
39 bar codes from Full ASCII Code 39 bar codes. Do
not enable Trioptic and FullASCII at the same time.
Default: FALSE
Return Values
None
Scanning Functions 4-15
Page 64
Example C#
using Ultra;
Ultra.Scan.Code39 C39 = new Ultra.Scan.Code39();
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-20 Programmer’s Manual
Page 69
I2of5
Description
Sets the scanner configuration values for I2of5 bar code.
Syntax
public bool Enable;
public bool FixedLength;
public int Length1;
public int Length2;
public bool VerifyCD;
public bool XmitCD;
public bool XlatetoEAN13;
Field Description
Enable
FixedLength
Length1
Length2
VerifyCD
XmitCD
XlatetoEAN13
Enables/disables the ability to scan I2of5 bar codes.
Default: TRUE
If FixedLength is TRUE, lengths 1 and 2 are fixed; if
FixedLength is FALSE, length 1 is the minimum and
length 2 is the maximum. Default: TRUE
Specifies lengths (including start and stop characters)
for I2of5 bar codes.
Length 1: 0, 2-99, Default: 14
Length 2: 0, 2-99, Default: 0
Specifies whether the scanner should check the
integrity of 2of5 bar codes to ensure they comply with
either the Uniform Symbology Specification (USS) or
Optical Product Code Council (OPCC) algorithms.
Default: FALSE
Enables/disables the requirement to transmit check
digits with the data. Default: FALSE
Enables/disables the requirement to convert 14character I2of5 bar codes into EAN13 bar codes, and
transmit them as EAN13 bar codes.
To use this parameter, enable Enable, set the length
to 14, and ensure the data has a leading zero and a
valid EAN 13 check digit. Default: FALSE
Scanning Functions 4-21
Page 70
Return Values
None
Example C#
using Ultra;
Ultra.Scan.I2OF5 I2OF5 = new Ultra.Scan.I2OF5 ();
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-23
Page 72
MSI
Description
Sets the scanner configuration values for MSI bar code.
Syntax
public bool Enable;
public bool FixedLength;
public int Length1;
public int Length2;
public bool Use2CDs;
public bool XmitCD;
public bool UseMod10Mod11CDAlg;
Field Description
Enable
FixedLength
Length1
Length2
Use2CDs
XmitCD
UseMod10Mod11CDAlg
Enables/disables the ability to scan MSI bar codes.
Default: FALSE
If FixedLength is TRUE, lengths 1 and 2 are fixed; if
FixedLength is FALSE, length 1 is the minimum and
length 2 is the maximum. Default: FALSE
Specifies lengths (including start and stop
characters) for MSI bar codes.
Length 1: 0, 1-99, Default: 6
Length 2: 0, 1-99, Default: 55
Indicates the bar code contains two check digits
instead of one. If True, enable
UseMod10M0d11CDAlg. Default: FALSE
Enables/disables the requirement to transmit data
with the check digit. Default: FALSE
Uses the Mod10/Mod11 check digit algorithm instead
of Mod10/Mod10 algorithm.
Default: FALSE
Return Values
None
4-24 Programmer’s Manual
Page 73
Example C#
using Ultra;
Ultra.Scan.MSI MSI = new Ultra.Scan.MSI ();
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-27
Page 76
UPCEAN
Description
Sets the scanner configuration values for UPC and EAN bar codes.
Syntax
public bool EnableUPCA;
public bool EnableUPCE;
public bool EnableUPCE1;
public bool EnableEAN8;
public bool EnableEAN13;
public bool EnableBklnd;
public eSUPPLEMENTAL Supplement;
public int SupRedundancy;
public bool XmitUPCACD;
public bool XmitUPCECD;
public bool XmitUPCE1CD;
public eXMITUPCPREAMBLE XmitUPCAPre;
public eXMITUPCPREAMBLE XmitUPCEPre;
public eXMITUPCPREAMBLE XmitUPCE1Pre;
public bool XlateEToA;
public bool XlateE1toA;
public bool EANZeroExtend;
public bool Xlate8to13;
public int Security;
public bool CouponCode;
4-28 Programmer’s Manual
Page 77
Field Description
EnableUPCA
EnableUPCE
EnableUPCE1
EnableEAN8
EnableEAN13
EnableBklnd
Supplement
SupRedundancy
XmitUPCACD
XmitUPCECD
XmitUPCE1CD
Enables/disables the ability to scan UPCA bar
codes. Default: TRUE
Enables/disables the ability to scan UPCE0 bar
codes. Default: TRUE
Enables/disables the ability to scan UPCE1 bar
codes. Default: FALSE
Enables/disables the ability to scan EAN8 bar
codes. Default: TRUE
Enables/disables the ability to scan EAN13 bar
codes. Default: TRUE
Enables/disables the ability to scan Bookland EAN
bar codes. Default: FALSE
Specifies how to treat UPC and EAN bar codes with
supplemental characters (UPCA+2, for example).
Values are:
USM_REQUIRED The scanner scans bar codes
with supplemental characters only. For example, it
scans a UPCA+2 bar code, but not UPCA.
USM_IGNORE The scanner ignores
supplemental characters. For example, it scans a
UPCA+2 bar code as a UPCA.
USM_AUTO Uses scanning information as
specified in SupRedundancy.
Default: USM_IGNORE
If using USM_AUTO for Supplement, this sets the
number of times a symbol without supplemental
information is decoded. Values are 2-20.
Default: 7
Enables/disables the requirement to transmit UPCA
bar codes with the check digit. Default: TRUE
Enables/disables the requirement to transmit UPCE0
bar codes with the check digit. Default: TRUE
Enables/disables the requirement to transmit UPCE1
bar codes with the check digit. Default: TRUE
Scanning Functions 4-29
Page 78
Field Description
XmitUPCAPre
Specifies how to transmit UPCA Preamble characters.
Values are:
1 = XUP_NONE Do not transmit.
2 = XUP_SYSCHAR Transmit system character.
3 = XUP_SYSCOUNT Transmit system character and
country code.
Default: XUP_SYSCHAR
XmitUPCEPre
Specifies how to transmit UPCE Preamble characters.
Values are:
1 = XUP_NONE Do not transmit.
2 = XUP_SYSCHAR Transmit system character.
3 = XUP_SYSCOUNT Transmit system character and
country code.
Default: XUP_SYSCHAR
XmitUPCE1Pre
Specifies how to transmit UPCE1 Preamble characters.
Values are:
1 = XUP_NONE Do not transmit.
2 = XUP_SYSCHAR Transmit system character.
3 = XUP_SYSCOUNT Transmit system character
and country code.
Default: XUP_SYSCHAR
XlateEToA
Translates a UPCE bar codes to a UPCA bar code.
Default: FALSE
XlateE1toA
Translates a UPCE1 bar codes to a UPCA bar code.
Default: FALSE
EANZeroExtend
Adds five leading zeros to scanned EAN8 bar codes to
make them compatible with EAN13 bar codes.
Default: FALSE
Xlate8TO13
Translates an EAN8 bar code to an EAN13 bar code.
Default: FALSE
Security
Sets the scan security level, which is how many times
to scan the same bar code to determine a successful
read. Choose the minimum-security level needed.
Values are
0 Use when most scans are successful.
1 Use when the unsuccessful scans are related
to characters 1, 2, 7, and 8.
2 Use when the unsuccessful scans are not limited
to characters 1, 2, 7, and 8.
3 Choose 4 if unsuccessful scans still occur at
level 2. Default: 0
4-30 Programmer’s Manual
Page 79
Field Description
CouponCode
Enables the ability to scan UPCA/EAN Coupon Code
bar codes. Default: FALSE
Return Values
None
Scanning Functions 4-31
Page 80
Example C#
using Ultra;
Ultra.Scan.UPC UPCEAN = new Ultra.Scan.UPCEAN ();
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-33
Page 82
Control Class
CommitChanges
Description
Retrieves the scanner configuration data from the application and saves
the reconfigured settings to the scan engine.
Syntax
public void CommitChanges();
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-34 Programmer’s Manual
Page 83
DataMode
Description
Retrieves the Data Receive Mode from the application and saves the
reconfigured settings to the scan engine.
Syntax
public eDATAMODE DataMode;
Parameters
DataMode The supply type. Values are
DRM_WMCHAR
DRM_SMSCANCHAR
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
Scanner.DataMode = Ultra.Scan.Control.eDATAMODE.DRM_WMCHAR;
// Data from Keyboard buffer
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
The application receives data by
the keyboard buffer. Default
The application receives data by
the scanner through a special
message.
Scanning Functions 4-35
Page 84
Example VB.NET
Imports Ultra
Dim Control As New Ultra.Scan.Control ' Instantiate class
Control.DataMode = Control.eDATAMODE.DRM_SMSCANCHAR
' Data from the scanner
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-36 Programmer’s Manual
Page 85
EnableScanning
Description
Allows the scanner to scan the defined bar codes.
Syntax
public void EnableScanning();
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.EnableScanning(); // Enable Scanning
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.EnableScanning() ' Enable Scanning
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-37
Page 86
DisableAllCodes
Description
Disables all bar codes. This function will cause all barcodes to be
disabled from being scanned. Use this function when you want to enable
only a few selected codes.
Syntax
public void DisableAllCodes();
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.DisableAllCodes(); // Disable all bar codes
// Enable needed bar codes here
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.DisableAllCodes() ' Disable all bar codes
' Enable needed bar codes here
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-38 Programmer’s Manual
Page 87
DisableScanning
Description
Disables the scanner from scanning the defined bar codes.
Syntax
public void DisableScanning();
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.DisableScanning(); // Disable Scanning
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.DisableScanning() ' Disable Scanning
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-39
Page 88
ScannerMode
Description
Retrieves the current scanner mode data containing the default values
and saves the reconfigured settings to the scan engine.
Syntax
public eSCANMODE ScannerMode;
Parameters
None
Return Values
SOM_MOMENTARY
SOM_CONTINUOUS
SOM_COMPATIBLE
The scanner is on when the trigger is pressed and
goes off when the trigger is released.
The scanner is always on. A good scan causes the
scanner to reset and continue scanning.
The scanner operates in Monarch® 6037
compatible mode, which means the scanner is on
when the trigger is pressed and goes off after a
successful scan or a predetermined timeout period.
Default
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
4-40 Programmer’s Manual
Page 89
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.ScannerMode = CONTROL.eSCANMODE.SOM_COMPATIBLE
' Enable Compatibility with 6037
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-41
Page 90
SendScanStatus
Description
Enable Send Scan Status to return the data after any scan. This data
precedes the bar code and includes the length of data and bar code type.
Syntax
public bool SendScanStatus
Parameters
SendScanStatusTRUE Enable Send Scan Status
FALSE Default
Return Values
None
Example C#
using Ultra;
Ultra.Scan.General GENERAL = new Ultra.Scan.General();
// Instantiate Class
GENERAL.SendScanStatus = false;
// Send Scan Status
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.CommitChanges();
//--Save Changes to the Scanner Configuration
Example VB.NET
Imports Ultra
Dim GENERAL As New Scan.General ' Instantiate class
Dim CONTROL As New Scan.Control ' Instantiate class
GENERAL.SendScanStatus = False
' Send Scan Status
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
4-42 Programmer’s Manual
Page 91
Trigger
Description
Initiates a scan, placing the scanned data in the scanner buffer. If the
LED on the keypad turns green, the scan was successful. This function
works with each scanner.
Syntax
public void Trigger();
Parameters
None
Return Values
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control();
// Instantiate class
CONTROL.Trigger(); // Start Scanning
CONTROL.CommitChanges(); //--Save Changes to the Scanner
// Configuration
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.Trigger() ' Start Scanning
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-43
Page 92
TriggerMode
Description
Sets the trigger mode configuration values the application set.
Syntax
public eTRIGGERMODE TriggerMode;
Parameters
TriggerMode The supply type. Values are
TM_SCAN
TM_DROP
TM_FORWARD
Return Values
Pressing the trigger turns on the
scanner.
The printer ignores the trigger
press and does not turn on the
scanner.
The printer passes the trigger
press to the application as an
F11, allowing more control of
the application. You can code a
custom application to perform a
special function whenever it
receives an F11. Default
None
Example C#
using Ultra;
Ultra.Scan.Control CONTROL = new Ultra.Scan.Control;
// Instantiate class
CONTROL.TriggerMode =
Ultra.Scan.Control.eTRIGGERMODE.TM_SCAN;
// Enable scanning by trigger
CONTROL.CommitChanges //--Save Changes to the Scanner
// Configuration
4-44 Programmer’s Manual
Page 93
Example VB.NET
Imports Ultra
Dim CONTROL As New Ultra.Scan.Control ' Instantiate class
CONTROL.TriggerMode = CONTROL.eTRIGGERMODE.TM_SCAN
' Enable scanning by trigger
CONTROL.CommitChanges()
' Save Changes to the Scanner Configuration
Scanning Functions 4-45
Page 94
SendScanStatus Codes
If you have enabled SendScanStatus in your General structures
definitions, use the following table to interpret the data returned from
every scan. This data precedes the bar code and includes the length of
data and bar code type. See “General” in this chapter for information
about enabling SendScanStatus. See Appendix A, “Sample Applications”
for information on receiving the scan status and extracting the length and
barcode type.
Value Bar Code Type Value Bar Code Type
0 No Scan 22 Bookland EAN
1 Code 39 23 Coupon Code
2 Codabar 48 RSS 14
3 Code 128 49 RSS Limited
4 Discrete 2of5 50 RSS Expanded
5 IATA 2of5 72 UPC A with 2 Supplements
6 Interleaved 2of5 73 UPC E with 2 Supplements
7 Code 93 74 EAN 8 with 2 Supplements
8 UPC A 75 EAN 13 with 2 Supplements
9 UPC E 80 UPC E1 with 2 Supplements
10 EAN 8 136 UPC A with 5 Supplements
11 EAN 13 137 UPC E with 5 Supplements
14 MSI Plessey 138 EAN 8 with 5 Supplements
15 EAN 128 139 EAN 13 with 5 Supplements
16 UPC E1 144 UPC E1 with 5 Supplements
21 Trioptic Code 39
4-46 Programmer’s Manual
Page 95
SAMPLE APPLICATIONS
A
This chapter contains two sample applications written in both
VB.NET and C#. The first application can be used as a demo. The second
application shows how to use the scanning and printing functions.
VB.NET Demo Sample
'************************************************************
'* Name: 6039 Demo Application (Demo VB) *
'* Version: 1.0.0 *
'* Date: 5/1/2006 *
'* Development *
'* Environment: Microsoft Visual Studio .NET 2003 *
’* (Visual Basic.NET) *
'* Company: Paxar Americas, Inc *
'* Copyright 2006 *
'* Supply Size 2020 (2.0" x 2.0") *
'* Description: *
'* Setup Barcode Symbologies for only UPCA in the *
'* Form1_Load Event *
'* Scan/Enter UPC and Print Label with UPCA barcode *
'* References *
'* Add Reference to Ultra.dll *
'************************************************************
Imports System ' For Strings
Imports System.Drawing
' provides access to GDI+ basic graphics functionality
Imports System.Collections
' collections of objects, ArrayList
Imports System.Windows.Forms ' Forms
Imports Ultra ' Needed for Scanning & Printing
Public Class Form1
Inherits System.Windows.Forms.Form
Friend WithEvents btnClear As System.Windows.Forms.Button
Friend WithEvents btnEnter As System.Windows.Forms.Button
Friend WithEvents txtUPC As System.Windows.Forms.TextBox
Friend WithEvents lblScanEnterData As
System.Windows.Forms.Label
Sample Applications A-1
Page 96
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
' This call is required by the Windows Form Designer.
InitializeComponent()
' Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing
As Boolean)
MyBase.Dispose(disposing)
End Sub
' NOTE: The following procedure is required by the Windows
' Form Designer
' It can be modified using the Windows Form Designer.
' Do not modify it using the code editor.
Private Sub InitializeComponent()
Me.btnClear = New System.Windows.Forms.Button
Me.btnEnter = New System.Windows.Forms.Button
Me.txtUPC = New System.Windows.Forms.TextBox
Me.lblScanEnterData = New System.Windows.Forms.Label
' btnClear
Me.btnClear.Location = New System.Drawing.Point(136, 120)
Me.btnClear.Text = "Clear"
' btnEnter
Me.btnEnter.Location = New System.Drawing.Point(40, 120)
Me.btnEnter.Text = "Enter"
' txtUPC
Me.txtUPC.Location = New System.Drawing.Point(32, 40)
Me.txtUPC.MaxLength = 12
Me.txtUPC.Size = New System.Drawing.Size(168, 22)
Me.txtUPC.Text = ""
' lblScanEnterData
Me.lblScanEnterData.Location = New
System.Drawing.Point(24, 16)
Me.lblScanEnterData.Size = New System.Drawing.Size(136,
Public Shared Sub Main()
Application.Run(New Form1)
End Sub
#End Region
'************************************************************
'* Form1_Load Event
'* Description:
'* Set App Name & Version
'* Enable/Disable Barcode Symbologies & Commit Changes(save
'* to ultra.cfg)
'************************************************************
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
' ---Set Application Name & Version Info
Dim rVersion As New Ultra.Version
' Instantiate Version class
rVersion.AppName = "Demo VB"
' Application Name
rVersion.AppVersion = "1.0"
' Application Version
' Setup Scanner Configuration Programatically
Dim GENERAL As New Ultra.Scan.General
GENERAL.Postamble = "\n\r"
' Append CR -- Auto-Enter
' CONTROL
Dim CONTROL As New Ultra.Scan.Control
' Set TriggerMode (Activate scanner on trigger press/release)
CONTROL.TriggerMode = CONTROL.eTriggerMode.TM_SCAN
Sample Applications A-3
Page 98
' Set ScannerMode (Scanner is on until T/O or successful
' scan)
CONTROL.ScannerMode = CONTROL.eSCANMODE.SOM_COMPATIBLE
' Set DataMode (application receives data is by the WM_CHAR
' standard method.)
CONTROL.DataMode = CONTROL.eDataMode.DRM_WMCHAR
CONTROL.SendScanStatus = False
' Don't Send Scan Status Message
CONTROL.DisableAllCodes()
' Disable All barcodes
'************************************************************
'* Enable UPCA Barcodes only
'************************************************************
Dim UPC As New Ultra.Scan.UPCEAN
' Instantiate UPCEAN class
UPC.EnableUPCA = True ' Enable UPCA
UPC.XmitUPCACD = True ' Xmit UPCA C/D
UPC.XmitUPCAPre =
Ultra.Scan.UPCEAN.eXMITUPCPREAMBLE.XUP_SYSCHAR
' --Save Changes to the Scanner Configuration which builds a
' new Ultra.cfg
CONTROL.CommitChanges()
' --Set focus to txtUPC text box
txtUPC.Focus()
End Sub
A-4 Programmer’s Manual
Page 99
'************************************************************
'* txtUPC_KeyDown Event
'* Description:
'* Handle the KeyDown event to determine the
'* type of character entered into the control.
'* if Enter is Pressed, execute the btnEnter_Click Event
'************************************************************
Private Sub txtUPC_KeyDown(ByVal sender As Object, ByVal e
As System.Windows.Forms.KeyEventArgs) Handles txtUPC.KeyDown
If (e.KeyCode.ToString() = "Return") Then
btnEnter_Click(sender, e)
End If
End Sub
'************************************************************
'* btnEnter_Click Event
'* Description:
'* If length of data is 12 print label if not
'* display error message
'************************************************************
Private Sub btnEnter_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnEnter.Click
Dim fmtUPCA As String = "{F,1,A,R,E,200,200," & Chr(34)
& "UPCA" & Chr(34) & "|" _
& "C,150,49,0,50,8,8,A,L,0,0," & Chr(34) & "Demo
VB.NET" & Chr(34) & "|" _
& "B,1,12,F,25,28,1,4,100,7,L,0|}"
Dim rPrint As New Print
' Instantiate Print class
If (txtUPC.Text.Length <> 12) Then
' Make sure Length is 12
txtUPC.Text = ""
' Reset content to nothing
txtUPC.Focus()
' Focus on the text box
Else
rPrint.ClearError()
' Clear any errors
If (Not rPrint.IsBatteryOKToPrint) Then
Sample Applications A-5
Page 100
' Check Battery
MsgBox("Low Battery", MsgBoxStyle.OKOnly, "Battery Check")
Else
' --Print Format and then Batch Data
rPrint.Text = fmtUPCA
rPrint.Text = "{B,1,N,1|E,0,0,1,1,0,1|"
rPrint.Text = "1," & Chr(34) & txtUPC.Text & Chr(34) &
"|}"
' --Clear UPC and Set Focus
txtUPC.Text = "" ' Reset content to nothing
txtUPC.Focus() ' Focus on the text box
End If
End If
End Sub
'************************************************************
'* btnClear_Click Event
'* Description:
'* Erase data &
'* Set focus back to txtUPC
'************************************************************
Private Sub btnClear_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnClear.Click
txtUPC.Text = "" '
Erase any data
txtUPC.Focus() '
Put focus back on the txt box
End Sub
End Class
A-6 Programmer’s Manual
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.