Intermec Janus 2010, Janus 2050, Janus 2020, JANUS PSK for Ada Reference Manual

Reference Manual
P/N 062038-002
®
JANUS
PSK for Ada
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
Authors Beryl Doane
Maureen Norling
Editor Craig Thompson
Technical Illustrators John Bickley
George Wilson
Technical Reviewers Roy Law
Yong-Qin Lu
Manual Change Record
This page records the changes to this manual.
Version Date Description of Change
001 9/94 This manual was first released as version -001. 002 7/95 Renumbered 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:
im_flush_expanded_keyboard im_get_expanded_keyboard im_set_expanded_keyboard im_kb_insert_keycodes im_kb_insert_string
Contents
Contents
Before You Begin xi
Warranty Information xi Cautions xi About This Manual xii Other Intermec Manuals xv
Getting Started
1
2
What Your JANUS Reader Can Do 1-3 Virtual Wedge 1-4 Reader Services 1-5
Function Libraries 1-6 Software Interrupts 1-6
Installing the JANUS PSK Ada Library 2-3
Working With Ada
Programming With Ada 2-4 Building an Executable File 2-5
Build Requirements 2-6 Compiling 2-7 Binding 2-8 Linking 2-9
Debugging With JANUS Application Simulator 2-10 Building a Sample Program Using a Batch Program 2-10 Running Your Program on the Reader 2-11
v
Contents
Runtime Requirements 2-12
Protocol Handlers 2-12 Reader Wedge 2-13 Specific Functions With Runtime Requirements 2-14
Status Code Macros 2-16
Ada Library
3
Using the Ada Library Functions 3-3 Ada Library Functions Listed by Category 3-4
im_appl_break_status 3-6 im_backlight_off 3-8 im_backlight_on 3-9 im_backlight_toggle 3-10 im_cancel_rx_buffer 3-11 im_cancel_tx_buffer 3-12 im_command 3-13 im_cursor_to_viewport 3-15 im_decrease_contrast 3-16 im_get_config_info 3-18 im_get_contrast 3-20 im_get_control_key 3-22 im_get_display_mode 3-24 im_get_display_type 3-27 im_get_follow_cursor 3-29 im_get_input_mode 3-30 im_get_keyclick 3-32 im_get_label_symbology 3-33 im_get_length 3-35 im_get_postamble 3-36 im_get_preamble 3-38 im_get_viewport_lock 3-40 im_get_warm_boot 3-42 im_increase_contrast 3-43
vi
im_input_status 3-45 im_irl_a 3-47 im_irl_k 3-51 im_irl_n 3-55 im_irl_v 3-59 im_irl_y 3-64 im_iserror 3-69 im_isgood 3-70 im_issuccess 3-71 im_iswarn 3-72 im_link_comm 3-73 im_message 3-75 im_number_pad_off 3-76 im_number_pad_on 3-78 im_power_status 3-80 im_protocol_extended_status 3-83 im_receive_buffer 3-85 im_receive_buffer_no_wait 3-89 im_receive_buffer_noprot 3-93 im_receive_byte 3-97 im_receive_input 3-100 im_rs_installed 3-103 im_rx_check_status 3-104 im_serial_protocol_control 3-105 im_set_contrast 3-108 im_set_control_key 3-110 im_set_display_mode 3-112 im_set_follow_cursor 3-115 im_set_input_mode 3-117 im_set_keyclick 3-119 im_set_viewport_lock 3-121 im_set_warm_boot 3-123 im_sound 3-125 im_standby_wait 3-127 im_transmit_buffer 3-129 im_transmit_buffer_no_wait 3-131
Contents
vii
Contents
im_transmit_buffer_noprot 3-132 im_transmit_byte 3-134 im_unlink_comm 3-137 im_viewport_end 3-138 im_viewport_getxy 3-139 im_viewport_home 3-141 im_viewport_move 3-142 im_viewport_page_down 3-145 im_viewport_page_up 3-146 im_viewport_setxy 3-147 im_viewport_to_cursor 3-148
Status Codes
A
Status Code Bit Values A-3 Status Codes Listed Numerically A-4 Status Codes Listed by Subsystem A-22
Subsystem 0100 RS (Reader Services) A-23 Subsystem 0200 CM (Configuration Management) A-24 Subsystem 0300 SC (Scanner) A-27 Subsystem 0400 DC (Decodes) A-28 Subsystem 0500 RW (Reader Wedge) A-30 Subsystem 0600 CU (Communications) A-32 Subsystem 0800 PM (Power Management) A-34 Subsystem 0A00 TM (Timer) A-35 Subsystem 0B00 BP (Beep) A-36 Subsystem 0E00 IM (Intermec Library) A-37 Subsystem 0F00 LG (Event Logger) A-38 Subsystem 1000 KB (Keyboard Buffer) A-39 Subsystem 1100 SS (System Configuration) A-40 Subsystem 1200 KP (Keypad Services) A-41 Subsystem 1300 DP (Display) A-42
viii
Sample Programs
Contents
B
DISPMODE.ADA B-3 KEYCLICK.ADA B-5 PWR_STAT.ADA B-7 XCOMM.ADA B-9
Index I-3
ix
Before You Begin
y
y
p
p
pp
p
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) 755­5505, 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:
Chapter What You Will Find
1 Gettin
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.
2 Workin
This chapter describes how to write applications in Ada using the library functions.
3 Ada Librar
This chapter explains the purpose and syntax for each Ada function and provides samples.
Appendix A Status Codes
This appendix lists status codes that are returned by the PSK functions.
Appendix B Sam
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
Part No.
062133 063191 058426 059951 062874 062778 048609 044737 051241
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 Name Language
INTERMEC\ADA Janus/Ada INTERMEC\BORLANDC Borland C/C++ INTERMEC\MICROSFT Microsoft C/C++ and Visual C/C++ INTERMEC\QUICKB Microsoft QuickBasic INTERMEC\VBDOS Visual 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:
INTRMECD.SRL INTRMECP.SRL INTRMECD.JRL INTRMECP.JRL INTRMECD.SYM INTRMECP.SYM
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.
Working With Ada
2
Customer Supplies:
.ADA Files
PSK Language Libraries Supplies:
INTRMECD.SRL INTRMECP.SRL INTRMECD.JRL INTRMECP.JRL INTRMECD.SYM INTRMECP.SYM
IM20_ADA.LIB
ADA, Compiler, and JBIND are available from Intermec Corporation.
*
Linker is supplied by the customer.
**
Source Code Precompiled Includes
Object Libraries
Janus/Ada Compile
.srl .jrl .sym Files
JBIND
*
.obj File
Link Objects
.exe File
*
**
AIT-23
2-5
JANUS PSK for Ada Reference Manual
Build Requirements
Use the following checklist to make sure you meet the requirements for building your program:
• The following six files must be in your working directory or in your DOS path:
INTRMECD.SRL INTRMECP.SRL
INTRMECD.JRL INTRMECP.JRL INTRMECD.SYM INTRMECP.SYM
• Your DOS path must include the following directories in this exact order:
C:\JADOS\M1; C:\JADOS; C:\INTERMEC\ADA\WITH
• The following lines must be at the start of your program:
With Intrmecd_IO, Intrmecp_IO; Use Intrmecd_IO, Intrmecp_IO;
• You must have a Microsoft linking program, LINK.EXE.
2-6
• You must compile and bind your program with memory model 1 (M1). Your DOS path must include the M1 subdirectory, as in C:\JADOS\M1.
Loading...
+ 220 hidden pages