Intermec Corporation
6001 36th Avenue West
P.O. Box 4280
Everett, WA 98203-9280
U.S. technical and service support: 1-800-755-5505
U.S. media supplies ordering information: 1-800-227-9947
Canadian technical and service support: 1-800-688-7043
Canadian media supplies ordering information: 1-800-268-6936
Outside U.S. and Canada: Contact your local Intermec service supplier.
The information contained herein is proprietary and is provided solely for the purpose of
allowing customers to operate and/or service Intermec manufactured equipment and is not to
be released, reproduced, or used for any other purpose without written permission of Intermec.
Information and specifications in this manual are subject to change without notice.
1995 by Intermec Corporation
All Rights Reserved
The word Intermec, the Intermec logo, JANUS, IRL, Duratherm, Virtual Wedge, and CrossBar
are trademarks of Intermec Corporation.
Throughout this manual, trademarked names may be used. Rather than put a trademark ()
symbol in every occurrence of a trademarked name, we state that we are using the names only
in an editorial fashion, and to the benefit of the trademark owner, with no intention of
infringement.
Contributors
AuthorsBeryl Doane
Maureen Norling
EditorCraig Thompson
Technical IllustratorsJohn Bickley
George Wilson
Technical ReviewersRoy Law
Yong-Qin Lu
Manual Change Record
This page records the changes to this manual.
VersionDateDescription of Change
0019/94This manual was first released as version -001.
0027/95Renumbered chapters and made other changes according to
current Technical Publications document standards.
Updated manual to support the Programmer’s Software Kit
version 2.1. The new information includes:
Functions to support JANUS J2050 VMU.
Preamble and postamble functions.
Other new topics include:
Using the status code macros.
Using JANUS Application Simulator.
Deleted the following five functions from the manual. They are
still available in the PSK library, but Intermec does not
recommend using them:
This section introduces you to standard warranty provisions, safety
precautions, warnings and cautions, document formatting conventions, and
sources of additional product information.
Warranty Information
To receive a copy of the standard warranty provision for this product,
contact your local Intermec sales organization. In the U.S. call (800) 7555505, and in Canada call (800) 688-7043. Otherwise, refer to the Worldwide
Sales & Service list shipped with this manual for the address and telephone
number of your Intermec sales organization.
Cautions
The cautions in this manual use the following format.
Before You Begin
CAUTION
Caution
A caution alerts
statement that must be strictl
destruction, or corru
Conseil
Une
récaution vous alerte d’une procédure de fonctionnement, d’une
méthode, d’un état ou d’un ra
em
êcher l’endommagement ou la destruction de l’équipement, ou l’altération
ou la perte de données.
ou to an operating procedure, practice, condition, or
observed to prevent equipment damage or
tion or loss of data.
ort qui doit être strictement respecté pour
xi
JANUS PSK for Ada Reference Manual
g
g
y
p
About This Manual
This manual is part of the JANUS Programmer's Software Kit manual set. It
describes the special features and methods needed for programming the
JANUS family of PC-compatible readers. If you plan to write programs in
Ada, the information in this manual is very valuable. You may also refer to
one of the other books listed under “Other Intermec Manuals” later in this
section.
Organization
The JANUS Programmer’s Software Kit for Ada Reference Manual is divided
into three chapters and one appendix as described below:
ChapterWhat You Will Find
1Gettin
This chapter describes the capabilities and programming
methods applicable to the Intermec family of PC-compatible
readers. It also explains how to install the Programmer’s
Software Kit Language Libraries disk that is provided with
this manual.
2Workin
This chapter describes how to write applications in Ada
using the library functions.
3Ada Librar
This chapter explains the purpose and syntax for each Ada
function and provides samples.
Appendix AStatus Codes
This appendix lists status codes that are returned by the
PSK functions.
Appendix BSam
This appendix lists sample applications written in the Ada
language.
Started
With Ada
le Programs
xii
Before You Begin
Terms and Conventions
• A reader is the JANUS 2010, 2020, or 2050 PC-compatible bar code reader.
• An operator is anyone who runs applications on the reader.
• A programmer is anyone who writes applications for the reader.
• A normal PC is assumed to be a DOS-based PC/AT-compatible 386, with
a hard disk, 14-inch monitor, full-size keyboard, floppy disk drives, and
at least two communication ports.
• Reader services are the functional abilities that distinguish the Intermec
family of PC-compatible readers from a normal PC. For example, the
reader’s ability to decode bar code data as if it came from a PC keyboard
is a typical reader service.
• Software interrupts are the synchronous triggering of interrupts used for
application program interfaces.
• Library functions are the specialized Ada functions provided in the
language libraries that you use to invoke various reader services.
• PSK means the Programmer’s Software Kit and refers to both the
language libraries and this manual.
• The Programmer’s Software Kit Language Libraries is the disk shipped with
this manual. It contains sample programs and library functions for
interfacing with the reader.
• The keypad is the custom JANUS keyboard. Throughout this manual,
specific references to the JANUS keyboard use the term keypad.
• The keyboard buffer is the machine-level buffer that stores key presses
and scanned labels. Throughout this manual, specific references to this
buffer and its status flags use the term keyboard.
xiii
JANUS PSK for Ada Reference Manual
Keypad Input
• Keys that you press on the keypad are emphasized in bold. For example,
“press Enter” means you press the key labeled “Enter” on the reader
keypad.
• All key names use first-letter capitalization. For example:
Ctrl = Control key
Enter = Enter key
F3 =F3 key
• When you are required to press and release a series of keys in order, the
keys are listed in order with no connectors. For example, to enter the
uppercase character A, press Shift A. To enter this character, you press
and release the Shift key, and then press the key marked A.
• When you are required to press more than one key at the same time, the
keys are connected by a dash in the text. For example, press Ctrl-Alt-Del
to perform a warm boot on a standard PC. When the keys are connected
by a dash, it is important that you press and hold the keys in the order
they are listed in the text.
xiv
Commands
• DOS commands are printed in Courier, exactly as you must type them.
For example:
COPY INTERMEC.* E:\
• Code examples are printed in 8-point Courier. For example:
if(step != 0) level = step;// use step value if provided
if(level >= 31) level = 0;// keep level within bounds
Other Conventions
• Italic type identifies a syntax parameter where it is defined in text. Italic
type is also used to indicate references to other manuals and to indicate
important terminology.
• Hexadecimal numbers in text are followed by an uppercase H. For
example, 03 hex is shown as 03H.
• Hexadecimal numbers in C language code segments begin with 0x. For
example, AX_REG = 0x5300.
Before You Begin
Other Intermec Manuals
You may need additional information for working with the PSK in a data
collection system. To order additional manuals, contact your local Intermec
representative or distributor.
The following publications contain useful information for programming the
Intermec family of PC-compatible readers:
Intermec
Manual
JANUS Programmer’s Software Kit for C/C++ Reference Manual
JANUS Programmer’s Software Kit for Basic Reference Manual
JANUS 2010 Hand-Held Computer User’s Manual
JANUS 2020 Hand-Held Computer User’s Manual
JANUS 2050 Vehicle Mount Unit User's Guide
JANUS Application Simulator User's Manual
IRL Programming Reference Manual
Data Communications Reference Manual
The Bar Code Book
For additional programming information, see the software development kit
manuals provided with your language.
Note: The Programmer’s Software Kit Language Libraries disk accompanying this
manual includes a file called README.TXT. This file contains updates to this
document and errata of specific importance to programmers.
xv
nugget code39
helconital
1
Getting Started
nugget code39
helconital
This chapter briefly describes the programming methods and capabilities that
0
play
p
p
prog
apply to the JANUS family of readers and explains how to install the PSK.
What Your JANUS Reader Can Do
Your JANUS reader is a portable, programmable bar
code reader and a 386-based computer in one. Each
reader has the Intermec controlled BIOS and Microsoft
ROM DOS 5.0. The reader behaves and functions like
a normal PC with 640K of memory, with these
exceptions:
• The JANUS 2010 and 2020 are hand-held, with a
small LCD dis
ort for a bar code input device or a built-in
scanner.
• The JANUS 2050 is mounted to a vehicle, such as a
forklift, and has a monochrome CGA display,
custom keyboard, built-in RF, and a port for a bar
code input device.
• The o
erating system and protocol support
rams reduce the memory available for your
application to about 450K.
JR2020
I/O
Conn Data
Ctrl Alt
Shift
Caps
f
~
_
ABCDEF
`
+
-=
{
GHI JKL
"
MNOPQR
[
'
\
<
STUVWX
,
YZ
Ctrl Alt
J2050
}:
]
>
.
Caps
;
?
/
f
home
&*
+
789
$
*
456
%
end enter pg dn
!@#
123
ins del
space
)
0
JR201
TM
F6
F1
F7
F2
F8
F3
F9
F4
F10
pg up
(
F5
/
^
Esc
>
.
num lock
enter
JPSK.001
Getting Started
1
, custom keyboard, and either a
You can run batch programs and copy, name, or move files in the same
manner as you would with any normal PC. The only difference is that the
JANUS reader has ROM and RAM drives and a PC card drive.
You can also run DOS-based programs on the reader the same as you can
on a PC. When you do, the reader behaves like a PC, but has the advantage
of accepting bar code input as if it came from the keypad. If you are an
experienced PC programmer, you have already written programs that will
run on the reader.
1-3
JANUS PSK for Ada Reference Manual
Virtual Wedge
The Virtual Wedge feature of the reader allows application programs to
receive decoded bar codes from the keyboard buffer. The Virtual Wedge
makes the reader functionally equivalent to a reader wedge connected to a
PC. Bar code input is inserted into the PC keyboard buffer as if entered from
the keypad. The Virtual Wedge also allows rapid porting of PC applications
to the reader.
Note: If your PC application follows DOS programming conventions, it should
run correctly on the JANUS reader. Not all programming languages, especially
database languages, follow these conventions. If your PC application does not
follow DOS programming conventions, your scanned input will be incorrect.
Valid configuration commands and reader commands are not put into the
keyboard buffer. Bar code configuration commands beginning with $+ are
tagged as configuration commands by the Virtual Wedge and sent to the
configuration manager to reconfigure the reader. The command parser in
the Virtual Wedge software recognizes and processes reader commands.
1-4
You can run applications that use the Virtual Wedge (instead of Intermec
interrupt extensions or function libraries) on either the reader or on your
PC.
Reader Services
prog
y
p
p
p
p
prog
Reader services include several functions ranging in complexity from
controlling the reader beeper to controlling the function of the power
management software. With reader services, you can easily use bar code
input from a wand or scanner by using the direct program interface to
handle the functions of the reader keyboard, display, and beeper.
There are two methods for incorporating the reader services into your
programs:
• Using function libraries
• Using software interrupts
You can use either one or a combination of both methods.
Note: Do not run programs that use PSK library functions on your PC, unless
you have the JANUS Application Simulator installed. If you attempt to run these
programs without the Simulator, you will receive an error message and the program
will not run.
Getting Started
1
CAUTION
Caution
Do not run
PC, unless
attem
PC to lock u
Conseil
N’exécutez
s
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
système.
t to run these programs without the Simulator, they will cause your
écifiques à Intermec sur votre PC, à moins que JANUS Application
rammes risquent de verrouiller votre PC et d’altérer le BIOS de votre
rams that use Intermec-specific interrupt extensions on your
ou have the JANUS Application Simulator installed. If you
and possibly corrupt your system BIOS.
as de programmes utilisant des extensions d’interruption
1-5
JANUS PSK for Ada Reference Manual
Function Libraries
The Intermec library functions provide extensive access to reader services.
The supported language functions are stored in libraries on the
Programmer’s Software Kit Language Libraries disk. The list of supported
languages includes:
• Borland C/C++
• Microsoft C/C++
• Microsoft Visual C/C++
• Microsoft QuickBasic
• Microsoft Visual Basic for MS-DOS
• Janus/Ada
When you write applications in Ada, link your program to the library by
including the header files in your program, and then invoke the reader
services using the Ada reader service command. See “Building an
Executable File” in Chapter 2 for instructions on compiling, binding, linking,
and running an Ada program. Refer to the PSK Reference Manual for more
information about other language support.
Software Interrupts
The reader supports special software interrupts in addition to those
available on a normal PC. If your programming language supports software
interrupts, you can write applications that use the reader services. However,
it is much easier to use the PSK library functions.
Interrupts are a very low-level method of controlling a computer.
Programming with interrupts is more difficult than with a high-level
language (such as Ada, C, or Basic).
Some of the most popular languages have built-in commands for triggering
software interrupts (Microsoft C, Borland C++, and QuickBasic, for
example). Languages that do not have built-in interrupt commands
sometime allow you to access interrupts by embedding fragments of
assembly language inside your program. There are other methods for
triggering software interrupts, and you can generate software interrupts
from almost any language.
1-6
CAUTION
prog
y
p
p
p
p
prog
Getting Started
For complete descriptions and examples of the software interrupts that
govern reader services, see Chapter 3, “Software Interrupts,” and
Appendix B, “Sample Interrupt Programs,” in the PSK for C/C++ Reference
Manual.
Caution
Do not run
PC, unless
attem
PC to lock u
Conseil
N’exécutez
s
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
système.
t to run these programs without the Simulator, they will cause your
écifiques à Intermec sur votre PC, à moins que JANUS Application
rammes risquent de verrouiller votre PC et d’altérer le BIOS de votre
rams that use Intermec-specific interrupt extensions on your
ou have the JANUS Application Simulator installed. If you
and possibly corrupt your system BIOS.
as de programmes utilisant des extensions d’interruption
1
1-7
nugget code39
helconital
nugget code39
Working With Ada
helconital
2
nugget code39
helconital
nugget code39
helconital
This chapter explains how to install the Intermec Ada library and how to build a
program using Ada.
Installing the JANUS PSK Ada Library
The files on the Programmer’s Software Kit Language Libraries disk are
distributed in several subdirectories, each corresponding to the supported
language:
Subdirectory NameLanguage
INTERMEC\ADAJanus/Ada
INTERMEC\BORLANDCBorland C/C++
INTERMEC\MICROSFTMicrosoft C/C++ and Visual C/C++
INTERMEC\QUICKBMicrosoft QuickBasic
INTERMEC\VBDOSVisual Basic for MS-DOS
The exact contents of the PSK Language Libraries disk are listed in the
README.TXT file contained on the disk. To use the library functions,
install the correct files on your computer. You can also use the DOS copy
command to copy only the specific files you are sure you will need.
Working With Ada
2
Note: If you have an existing Intermec directory, the installation process will
update any files in the existing Intermec directory with the new version files having
the same name.
To install the library files
1. Insert the PSK Language Libraries disk into the disk drive on your PC.
2. Change to the appropriate disk drive. For example, type A:.
3. Enter the following command:
INSTALL ADA
where drive is the location where you want to install the utilities library.
If no drive is designated, the utilities library is installed on drive C.
drive
2-3
JANUS PSK for Ada Reference Manual
Programming With Ada
The PSK disk contains the following files for building programs with the
Ada functions library:
• The IM20ADAD.LIB file contains the constant definitions.
• The IM20ADAP.LIB file contains the function prototypes.
• The IM20_ADA.LIB file contains the object modules.
• The following six files are compiled Ada definition library files and
symbol tables:
While the PSK disk includes complete JANUS reader Ada functions, you
will require additional products before you can use Intermec’s Ada
functions and procedures. You will need the following:
2-4
• Janus/Ada Compiler
• Text editor for creating source code
• Microsoft Linker
Support for Intermec’s Ada is only available using the Janus/Ada
“nonprofessional” compiler by R.R. Software, Inc. of Madison, Wisconsin.
You can order the Janus/Ada compiler through Intermec. It is coincidental
that the name of the Janus/Ada software compiler resembles the tradename
of the Intermec JANUS reader.
Your text editor must create standard ASCII text files. You can use the DOS
Edit program or any other ASCII editor.
Microsoft C/C++ linkers are the only linkers certified to work with Intermec
Ada. The Microsoft QuickBasic, Visual Basic, Visual C, and MASM linkers
have not been tested, but may link your object files successfully.
Building an Executable File
The procedures in this section lead you through the process of compiling,
binding, linking, and running a program that use the PSK Ada Library. The
following figure outlines the build process and shows the types of files
produced at each stage.