Intermec Janus 2010 Reference Manual
Text of the manual
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
Before You Begin xi
Warranty Information xi
Cautions xi
About This Manual xii
Other Intermec Manuals xv
Getting Started
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
1
2
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
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
3
Contents
vii
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
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
A
Contents
ix
Sample Programs
DISPMODE.ADA B-3
KEYCLICK.ADA B-5
PWR_STAT.ADA B-7
XCOMM.ADA B-9
Index I-3
B
Before You Begin
xi
Before You Begin
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.
CAUTION
Caution
A caution alerts you to an operating procedure, practice, condition, or
statement that must be strictly observed to prevent equipment damage or
destruction, or corruption or loss of data.
Conseil
Une précaution vous alerte d’une procédure de fonctionnement, d’une
méthode, d’un état ou d’un rapport qui doit être strictement respecté pour
empêcher l’endommagement ou la destruction de l’équipement, ou l’altération
ou la perte de données.
JANUS PSK for Ada Reference Manual
xii
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
Getting Started
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
Working With Ada
This chapter describes how to write applications in Ada
using the library functions.
3
Ada Library
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
Sample Programs
This appendix lists sample applications written in the Ada
language.
Before You Begin
xiii
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.
JANUS PSK for Ada Reference Manual
xiv
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.
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
xv
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:
Manual
Intermec
Part No.
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
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.
This chapter briefly describes the programming methods and capabilities that
apply to the JANUS family of readers and explains how to install the PSK.
What Your JANUS Reader Can Do
JPSK.001
I/O
Conn
Data
Ctrl
Alt
Shift
Caps
F6
F1
F2
F3
F4
F5
F7
F8
F9
F10
f
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Ctrl
Alt
f
~
_
+
{
}
:
`
-
=
[
]
;
"
<
>
?
'
\
,
.
/
Caps
7
8
9
4
5
6
1
2
3
space
0
.
home
&
*
(
$
%
^
!
@
#
)
>
+
pg up
-
*
/
end
enter
pg dn
Esc
num lock
enter
ins
del
TM
J2050
JR2020
JR2010
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 display, custom keyboard, and either a
port 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 operating system and protocol support
programs reduce the memory available for your
application to about 450K.
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.
JANUS PSK for Ada Reference Manual
1-4
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.
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 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.
CAUTION
Caution
Do not run programs that use Intermec-specific interrupt extensions on your
PC, unless you have the JANUS Application Simulator installed. If you
attempt to run these programs without the Simulator, they will cause your
PC to lock up and possibly corrupt your system BIOS.
Conseil
N’exécutez pas de programmes utilisant des extensions d’interruption
spécifiques à Intermec sur votre PC, à moins que JANUS Application
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre
système.
JANUS PSK for Ada Reference Manual
1-6
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.
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
Caution
Do not run programs that use Intermec-specific interrupt extensions on your
PC, unless you have the JANUS Application Simulator installed. If you
attempt to run these programs without the Simulator, they will cause your
PC to lock up and possibly corrupt your system BIOS.
Conseil
N’exécutez pas de programmes utilisant des extensions d’interruption
spécifiques à Intermec sur votre PC, à moins que JANUS Application
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre
système.
Working With Ada
2-3
2
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.
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 drive
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.
JANUS PSK for Ada Reference Manual
2-4
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:
•
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.
Working With Ada
2-5
2
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.
Customer Supplies:
.ADA Files
INTRMECD.SRL
INTRMECP.SRL
INTRMECD.JRL
INTRMECP.JRL
INTRMECD.SYM
INTRMECP.SYM
IM20_ADA.LIB
.srl
.jrl
.sym
Files
.obj
File
.exe
File
Janus/Ada Compile*
*
**
JBIND
Link
Objects
ADA, Compiler, and JBIND are available from Intermec Corporation.
Linker is supplied by the customer.
*
**
AIT-23
Source Code
Precompiled Includes
Object Libraries
PSK Language
Libraries Supplies:
JANUS PSK for Ada Reference Manual
2-6
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.
•
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.
Working With Ada
2-7
2
Compiling
The compiler processes your source code and produces a compiled output
file, progname.SRL. If you do not have the Janus/Ada compiler, you can
order it through Intermec.
To compile an Ada program
•
From the DOS prompt, enter the following command:
JANUS progname.ADA /O1 /3 /T
where:
progname is the name of your source file.
/O1 (letter “O”) tells the JANUS reader to use memory model 1, which is
required by Intermec’s utilities libraries.
/3 creates 386-machine instruction code, which executes on 80386, 80486,
or compatible processors.
/T parameter results in a smaller executable program and is optional.
When combined with the JBIND /T option, the /T parameter directs
JBIND to remove procedures in this compilation that can never be called.
JANUS PSK for Ada Reference Manual
2-8
Binding
After compiling your program, you must bind the compiled output file,
progname.SRL, into an object file that can be read by a linking program.
To bind your Ada program
•
From the DOS prompt, enter the following command:
JBIND progname /O1 /M /T
where:
progname is the compiled output file, progname.SRL, without the
extension.
/O1 (letter “O”) tells JBIND to use object code memory model 1, which
Intermec’s utilities libraries require.
/M tells JBIND to create a main program compatible with Microsoft C.
The resulting file is progname.OBJ.
/T tells JBIND to trimout unreachable subprograms from units that were
compiled with the compiler’s /T option.
Working With Ada
2-9
2
Linking
You use a Microsoft LINK.EXE program to link your Ada program with the
IM20_ADA.LIB object library file. The Janus/Ada compiler does not include
a linking program. The 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.
To link your Ada program
1. If your linker is not in your path, change to the directory containing
LINK.EXE.
2. Create a response file, progname.RSP, for linking. The response file
consists of the following four lines:
progname.OBJ
progname
(a blank line)
C:\INTERMEC\ADA\IM20_ADA.LIB
where:
the first line lists the program object file, including the path.
the second line lists only the executable filename with no extension.
the third line is left blank.
the fourth line lists the library files, including the path.
3. Link your program from DOS:
LINK /NOE @progname.RSP
4. Copy your program to the reader. Refer to your JANUS user’s manual
for complete copying instructions.
JANUS PSK for Ada Reference Manual
2-10
Debugging With JANUS Application Simulator
The JANUS Application Simulator is a terminate-and-stay resident (TSR)
program that you use to run JANUS applications on a PC. Without the
Simulator, you cannot run JANUS applications on your PC because JANUS
applications contain functions and system interrupts that may lock up a PC.
The Simulator captures the functions and interrupts before they can disrupt
the PC. Then, the Simulator uses those functions and interrupts to make the
PC mimic a JANUS reader. For more information on the Simulator, refer to
the JANUS Application Simulator User’s Manual, Part No. 062778.
To debug a JANUS application with the Simulator
1. Start the Simulator from the DOS prompt by entering this command:
janussim
2. Follow the debugging instructions provided with Janus/Ada.
Building a Sample Program Using a Batch Program
Intermec provides a batch program that compiles, binds, and links a sample
program. Follow the steps below to use the batch program.
To build the sample programs using a batch program
1. From the \INTERMEC\ADA\SAMPLES directory, enter the following
command:
CLL filename
where filename is the name of one of the sample programs without the
.ADA extension.
2. Connect the JANUS reader to a PC using the communications dock or
the optical interface cable.
3. Copy the filename.EXE file to the reader. Refer to your JANUS user’s
manual for complete copying instructions.
Working With Ada
2-11
2
Running Your Program on the Reader
After you copy your program to the reader, you are ready to run it.
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.
CAUTION
Caution
Do not run programs that use Intermec-specific interrupt extensions on your
PC, unless you have the JANUS Application Simulator installed. If you
attempt to run these programs without the Simulator, they will cause your
PC to lock up and possibly corrupt your system BIOS.
Conseil
N’exécutez pas de programmes utilisant des extensions d’interruption
spécifiques à Intermec sur votre PC, à moins que JANUS Application
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre
système.
To run your program on the reader
1. From the DOS prompt on the reader, change to the drive where the
program file progname.EXE is located. For example, enter the following
command to use drive E:
E:
2. Change to the directory where the program file filename.EXE is located.
For example, enter the following command to use the root directory:
CD \
3. Enter the following command:
progname
Your program begins executing.
JANUS PSK for Ada Reference Manual
2-12
Runtime Requirements
For some library functions to work properly, you must install and run
specific software components at program execution time. For example, if the
reader is using a communications port, you must load a protocol handler.
Because protocol handlers use a lot of memory, they are not automatically
loaded for you. Other functions require the Reader Wedge.
Protocol Handlers
You use the Intermec protocol handler (PHIMEC.EXE) when the reader is
connected with other Intermec devices. PHIMEC.EXE works with User-
Defined, Point-to-Point, Polling Mode D, and Multi-Drop protocols.
You use the PC standard protocol handler (PHPCSTD.EXE) when the
reader is connected to devices that use PC standard protocol.
PHPCSTD.EXE provides low-level communications abilities and protocol
services at the DOS level for non-communications software. It also provides
byte-by-byte transfer.
If your reader is a radio frequency (RF) unit, RFPH.EXE is automatically
loaded.
For more information on protocol handlers, refer to your JANUS user’s
manual.
To install a protocol handler
•
From the DOS prompt, enter the following command:
handler n
where:
handler is either PHIMEC or PHPCSTD.
n is the number of the communications port.
When your application is finished, the protocol handler TSR continues to
run and can prevent other applications from running due to lack of
memory. You can unload the protocol handler TSR by adding the unload
command as the last line of the batch file that launches your application.
Working With Ada
2-13
2
To unload a protocol handler
•
From the DOS prompt, enter the following command:
unload handler n
where:
handler is the installed handler (PHIMEC or PHPCSTD).
n is the number of the communications port.
Reader Wedge
Some functions, such as im_receive_input, allow the reader to receive input
from multiple sources and process the input depending on the source. You
must load the Reader Wedge (RWTSR.EXE) TSR to use these functions.
When your application is finished, the Reader Wedge TSR continues to run
and can prevent other applications from running due to lack of memory.
You can unload the Reader Wedge TSR by adding the unload command as
the last line of the batch file that launches your application.
To load the Reader Wedge TSR
•
From the DOS prompt, enter the following command:
RWTSR
To unload the Reader Wedge TSR
•
From the DOS prompt, enter the following command:
RWTSR -D
JANUS PSK for Ada Reference Manual
2-14
Specific Functions With Runtime Requirements
The following table lists the PSK functions that have runtime requirements.
Specific Runtime Requirements
This Function
Requires
im_cancel_rx_buffer
Protocol Handler
im_cancel_tx_buffer
Protocol Handler
im_clear_abort_callback
Reader Wedge
im_command
Reader Wedge
im_get_input_mode
Reader Wedge
im_get_label_symbology
Reader Wedge
im_get_length
Reader Wedge
im_input_status
Reader Wedge
im_irl_a
Reader Wedge
im_irl_k
Reader Wedge
im_irl_n
Reader Wedge
im_irl_v
Reader Wedge
If the data is from a communications port, use a
Protocol Handler and im_link_comm.
im_irl_y
Reader Wedge
Protocol Handler
Use im_link_comm.
im_link_comm
Reader Wedge
Protocol Handler
im_receive_buffer
Protocol Handler
Do not use im_link_comm.
im_receive_buffer_no_wait
Protocol Handler
Do not use im_link_comm.
im_receive_buffer_noprot
Protocol Handler
Do not use im_link_comm.
im_receive_byte
PHPCSTD.EXE
You must use PC standard protocol on the host.
Do not use im_link_comm.
Working With Ada
2-15
2
Specific Runtime Requirements (continued)
This Function
Requires
im_receive_input
Reader Wedge
Protocol Handler
If the data is from a communications port, use
im_link_comm.
im_rx_check_status
Protocol Handler
im_serial_protocol_control
Use im_link_comm.
im_set_abort_callback
Reader Wedge
im_set_display_mode
Reader Wedge
im_set_input_mode
Reader Wedge
im_standby_wait
Reader Wedge
im_transmit_buffer
Protocol Handler
im_transmit_buffer_no_wait
Protocol Handler
im_transmit_buffer_noprot
Protocol Handler
im_transmit_byte
Protocol Handler
You must install PHPCSTD.
im_unlink_comm
Reader Wedge
Protocol Handler
Note: Do not run programs that use PSK library functions or Intermec-specific
interrupt extensions 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.
JANUS PSK for Ada Reference Manual
2-16
Status Code Macros
When using any of the Intermec library functions, you can check for a
specific status value or you can use one of the PSK macros to determine the
severity of the returned status codes. For portability with future Intermec
products, we recommend that you use the macros.
The following macros are included in IM20ADAD.LIB:
im_iserror (status) This macro returns a nonzero number when status
indicates an error (either fatal or nonfatal). Zero is returned if status
indicates either success or warning.
im_issuccess (status) This macro returns a nonzero number when status
indicates either success or warning. Zero is returned if status indicates an
error (either fatal or nonfatal).
im_isgood (status) This macro returns a nonzero number when status
indicates success.
im_iswarn (status) This macro returns a nonzero number when status
indicates a warning.
The following example uses IM_ISERROR to test for an error and then
prints the error message on the reader display.
im_get_display_mode (size, video, scroll, char_ht, status);
if im_iserror (status) then
Put ("Get Disp Mode error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
New_Line;
end if;
This chapter explains the functions and procedures available in the Intermec Ada
library and provides samples and notes to help you write application programs.
Using the Ada Library Functions
In Ada, a procedure differs from a function in two major ways:
A Procedure
A Function
Can pass output parameters.
Can not pass output parameters.
Does not a return a result when called.
Returns a result when called.
The Intermec Ada library uses the following conventions to determine when
to use a function and when to use a procedure.
•
A subroutine that only needs to pass out the status code without any
other output variables is a function. The status code is returned as the
function return value.
•
A subroutine that needs to pass values as output variables is a
procedure. The status code is returned as one of the output parameters.
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.
CAUTION
Caution
Do not run programs that use Intermec-specific interrupt extensions on your
PC, unless you have the JANUS Application Simulator installed. If you
attempt to run these programs without the Simulator, they will cause your
PC to lock up and possibly corrupt your system BIOS.
Conseil
N’exécutez pas de programmes utilisant des extensions d’interruption
spécifiques à Intermec sur votre PC, à moins que JANUS Application
Simulator soit installé. Si vous tentez de les exécuter sans le Simulator, ces
programmes risquent de verrouiller votre PC et d’altérer le BIOS de votre
système.
JANUS PSK for Ada Reference Manual
3-4
Ada Library Functions Listed by Category
Communications
im_cancel_rx_buffer, 3-11
im_cancel_tx_buffer, 3-12
im_link_comm, 3-73, 3-137
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_rx_check_status, 3-104
im_serial_protocol_control, 3-105
im_transmit_buffer, 3-129
im_transmit_buffer_no_wait, 3-131
im_transmit_buffer_noprot, 3-132
im_transmit_byte, 3-134
Display
im_backlight_off, 3-8
im_backlight_on, 3-9
im_backlight_toggle, 3-10
im_decrease_contrast, 3-16
im_get_contrast, 3-20
im_get_display_mode, 3-24
im_get_display_type, 3-27
im_get_follow_cursor, 3-29
im_increase_contrast, 3-43
im_set_contrast, 3-108
im_set_display_mode, 3-112
im_set_follow_cursor, 3-115
Input
im_get_label_symbology, 3-33
im_get_length, 3-35
im_input_status, 3-45
im_receive_input, 3-100
im_set_input_mode, 3-117
IRL
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
Keypad
im_get_control_key, 3-22
im_get_keyclick, 3-32
im_get_warm_boot, 3-42
im_number_pad_off, 3-76
im_number_pad_on, 3-78
im_set_control_key, 3-110
im_set_keyclick, 3-119
im_set_warm_boot, 3-123
Program Control
im_appl_break_status, 3-6
im_standby_wait, 3-127
Sound
im_sound, 3-125
Status macros
im_iserror, 3-69
im_isgood, 3-70
im_issuccess, 3-71
im_iswarn, 3-72
System
im_command, 3-13
im_get_config_info, 3-18
im_get_postamble, 3-36
im_get_preamble, 3-38
im_message, 3-75
im_power_status, 3-80
im_rs_installed, 3-103
Note: The following syntax descriptions refer to many named constant variables, such as IM_COM1.
These variables always appear in uppercase in this manual and are described in IM20ADAD.LIB.
This function checks whether the application break sequence has been
pressed. All PSK functions are terminated when the application break
sequence is keyed in.
Place calls to this function at strategic locations in your program to detect
when a user wants to break out of a loop. Your program can determine
what action to take when the break sequence is detected.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_appl_break_status (
break_status : Out IM_APPBREAK_STATUS;
status_code : Out System.Word);
IN Parameter:
None.
OUT Parameter:
The break_status parameter is one of the following constants:
IM_REQUEST_NOT_MADE
Request for an application break has not
been made
IM_REQUEST_MADE
Request for an application break has been
made
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
Notes:
The break_status flag is reset each time this routine is called. Because this
function is also called during the input routines provided in the library, you
should check the return code from input functions for the hex value 8515H.
This value indicates that the input function has terminated because the
application break sequence was entered. In this case, the break_status flag is
cleared by the input function’s call to im_appl_break_status.
To enter an application break sequence
1. Press q to turn off the reader.
2. Press n - 2 - g at the same time.
3. Press 1 . This sets the reader’s application break bit.
4. Press q to turn on the reader.
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure appl_br Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
package IM_APPBREAK_STATUS_IO is new ENUMERATION_IO
(enum => IM_APPBREAK_STATUS);
break : IM_APPBREAK_STATUS;
status : System.Word;
in_char : Character := ' ';
begin
Put_Line ("Appl Brk Status");
Put_Line ("Set brk bit and then");
Put_Line ("press any key & return");
Get (in_char);
-- Press the following sequence at this pause (to set application break bit):
-- 1/0 key (Turn OFF the reader)
-- F3-2-Left Arrow (Press F3, 2 and left arrow at the same time)
-- 1 (Press the 1 (one) key to set application break bit)
-- 1/0 key (Turn ON the reader)
-- set break to known value
break := IM_REQUEST_MADE;
im_appl_break_status (break, status);
if break = IM_REQUEST_MADE then
Put_Line ("Break status ON");
Put ("return status : ");
SYSWORD_IO.Put (status, WIDTH => 4);
New_Line;
Put ("break_status : ");
IM_APPBREAK_STATUS_IO.Put (break);
elsif break = IM_REQUEST_NOT_MADE then
Put_Line ("Break status OFF");
Put ("return status : ");
SYSWORD_IO.Put (status, WIDTH => 4);
New_Line;
Put ("break_status : ");
IM_APPBREAK_STATUS_IO.Put (break);
end if;
New_Line;
end appl_br;
This procedure turns the display backlight off. Turn off the backlight to
prolong the reader’s battery life.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_backlight_off;
Parameters:
None.
Return Value:
None.
Notes:
You can program the backlight to automatically turn off after a specified
time to save battery power. The length of time depends on the backlight
timeout configuration parameter. The configuration parameter is set in
1-second increments. The default is 10 seconds.
This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_on, im_backlight_toggle
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure lightoff Is
begin
im_backlight_off;
Put_Line ("Backlight off");
end lightoff;
This procedure turns the JANUS display backlight on to help you see the
reader display in dimly lit environments.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_backlight_on;
Parameters:
None.
Return Value:
None.
Notes:
You can program the backlight to automatically turn off after a specified
time to save battery power. The length of time depends on the backlight
timeout configuration parameter. The configuration parameter is set in
1-second increments. The default is 10 seconds.
This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_off, im_backlight_toggle
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure lighton Is
begin
im_backlight_on;
Put_Line ("Backlight on");
end lighton;
This function toggles the LCD display backlight on and off.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_backlight_toggle return System.Word;
Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
Notes:
You can program the backlight to automatically turn off after a specified
time to save battery power. The length of time depends on the backlight
timeout configuration parameter. The configuration parameter is set in
1-second increments. The default is 10 seconds.
This procedure has no effect on the JANUS 2050.
See Also:
im_backlight_on, im_backlight_off
Example
With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure lightogl Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
status : System.Word;
begin
status := im_backlight_toggle;
Put_Line ("Backlt toggled");
if Tstbit(status, 15) then
Put ("Backlight toggle error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
New_Line;
end if;
end lightogl;
This function clears the receive buffer of the designated communications
port.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_cancel_rx_buffer (
port : IN IM_COM_PORT
) return System.Word;
IN Parameter:
The port_id parameter identifies the communications port as follows:
IM_COM1
COM1
IM_COM2
COM2, scanner port (2010 and 2050)
IM_COM4
COM4 (RF only)
OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
If there is no pending input to receive, this function returns 4602H (no
client).
Notes:
You must install a protocol handler to use this function.
See Also:
im_receive_buffer_no_wait, im_receive_buffer_noprot
Example
See example for im_receive_buffer.
This function clears the contents of the transmit buffer, stops transmission in
progress, and resets the communications port.
Use this function with Polling Mode D to clear out the buffer. Other
protocols clear the buffer automatically.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_cancel_tx_buffer (
port : IN IM_COM_PORT
) return System.Word;
IN Parameter:
The port_id parameter identifies the communications port as follows:
IM_COM1
COM1
IM_COM2
COM2, scanner port (2010 and 2050)
IM_COM4
COM4 (RF only)
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
If there are no pending transmissions to receive, this function returns 4602H
(no client).
Notes:
You must install a protocol handler to use this function.
See also:
im_transmit_buffer_no_wait, im_transmit_buffer_noprot,
im_transmit_buffer
Example
See example for im_receive_buffer.
This function modifies the reader’s configuration. For example, you can use
this function to set a specific communications port’s baud rate.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_command (
command : IN String;
command_length : IN System.Word
) return System.Word;
IN Parameter:
The command parameter is a reader command string. The command string
may include more than one reader command. For example, the command
string %.1$+BV9 turns on the backlight and raises the beep volume.
Reader commands are listed in your JANUS user’s manual.
The command_length parameter is the length of the reader command string.
OUT Parameter:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
Notes:
For more information on reader commands, refer to your JANUS user’s
manual.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure command Is
status : System.Word;
high_trast : String(1..5) := "$+DJ7";
low_trast : String(1..5) := "$+DJ0";
norm_trast : String(1..5) := "$+DJ3";
begin
Put_Line ("Setting high contrast");
status := im_command (high_trast, high_trast'Length);
status := im_standby_wait (5000);
Put_Line ("Setting low contrast");
status := im_command (low_trast, low_trast'Length);
status := im_standby_wait (5000);
Put_Line ("Setting normal contrast");
status := im_command (norm_trast, norm_trast'Length);
end command;
This function moves the cursor to the center of the current viewport. Since
the viewport can move around with or without the cursor, you can use this
function to recenter the cursor.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_cursor_to_viewport;
IN Parameters:
None.
OUT Parameters:
None.
Return Value:
None.
Notes:
This function has no effect on the JANUS 2050.
See also:
im_viewport_end, im_viewport_home, im_viewport_page_down,
im_viewport_page_up, im_viewport_to_cursor, im_viewport_move
Example
With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure crsrview Is
package STATUS_IO is new INTEGER_IO (System.Word);
row, col : System.Word;
status : System.Word;
begin
im_viewport_move (IM_VIEWPORT_RIGHT, 15, row, col, status);
im_cursor_to_viewport;
status := im_standby_wait (5000);
-- show that viewport moved
STATUS_IO.Put (row);
STATUS_IO.Put (col);
New_Line;
im_viewport_home;
end crsrview;
This function decreases the LCD display contrast by one level. The display
contrast is the lightness or darkness of the characters against the reader
display. The reader display has 32 levels of contrast (0 to 31).
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_decrease_contrast return System.Word;
Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
Notes:
The 0 to 31 scale fine-tunes the contrast more precisely than using the
keypad to adjust the contrast.
The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that
is related to the scale of 0 to 31 used by im_increase_contrast and
im_decrease_contrast. The following table shows the equivalent values for
the 0 to 7 scale.
Scale 0 to 7
Scale 0 to 31
Level
0
10
Very light
1
12
2
14
3
16
4
18
5
20
6
22
7
24
Very dark
This function has no effect on the JANUS 2050.
See Also:
im_increase_contrast, im_set_contrast, im_get_contrast
With System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Bit, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure deccontr Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
status : System.Word;
begin
Put_Line ("Decreasing contrast");
status := im_decrease_contrast;
if Tstbit(status, 15) then
Put ("Dec contrast error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
New_Line;
end if;
end deccontr;
This procedure retrieves the current reader configuration information string
and its length.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_config_info (
config_string : OUT String;
length : OUT System.Word;
status_code : OUT System.Word);
IN/OUT
Parameters:
The config_string parameter is the configuration information string. The first
two characters specify the type of configuration information returned.
For example, to get the beep duration setting, set the config_string to “BD.”
The procedure retrieves the currently configured setting for beep duration.
The length parameter is the length of the configuration information string.
The status_code parameter is one of the standard status codes defined in
Appendix A, “Status Codes.”
For a list of the configuration commands, see your JANUS user’s manual.
Return Value:
None.
Notes:
This procedure differs from im_command in that you only pass the two-
character command identifier. The im_command procedure passes an entire
command string.
See Also:
im_command
With System, Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
Use Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
procedure CONINFO is
package SYSBYTE_IO is new INTEGER_IO(System.Byte);
package SYSWORD_IO is new INTEGER_IO(System.Word);
use SYSBYTE_IO, SYSWORD_IO;
config_string : String(1..300) := (others => Ascii.NUL);
config_length : System.Word;
status : System.Word;
config_command : constant String := "BV";
begin
clrscr;
Put_Line("im_get_config_info example:");
New_line;
-- Set config request for Beeper Volume
config_string(1..2) := config_command;
im_get_config_info(config_string, config_length, status);
Put("Beep Volume: ");
for i in Integer range 1..300 loop
exit when config_string(i) = Ascii.NUL;
Put(config_string(i));
end loop;
New_line;
Put("Length : ");
Put(config_length);
New_line;
Put("Status : ");
Print_status_code(status);
New_line;
end CONINFO;
This procedure retrieves the reader’s display contrast level. There are eight
levels of contrast from very light (level 0) to very dark (level 7).
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_contrast (
contrast : OUT System.Byte;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The contrast parameter is a number from 0 to 7 or is one of the following
constants:
IM_MIN_CONTRAST
0
minimum contrast
IM_MAX_CONTRAST
1
maximum contrast
The status_code parameter is a standard status code listed in Appendix A,
“Status Codes.”
Notes:
The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that
is related to the scale of 0 to 31 used by im_increase_contrast and
im_decrease_contrast. The following table shows the equivalent values for
the 0 to 7 scale.
Scale 0 to 7
Scale 0 to 31
Level
0
10
Very light
1
12
2
14
3
16
4
18
5
20
6
22
7
24
Very dark
This function has no effect on the JANUS 2050.
im_increase_contrast, im_decrease_contrast, im_set_contrast
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getcontr Is
package SYSBYTE_IO is new INTEGER_IO (System.Byte);
package SYSWORD_IO is new INTEGER_IO (System.Word);
contrast : System.Byte;
status : System.Word;
begin
im_get_contrast (contrast, status);
Put_Line ("Getting contrast");
if im_isgood (status) then
Put_Line ("The contrast level");
Put ("setting is : ");
SYSBYTE_IO.Put (contrast, Width => 3);
else
Put ("Get Contrast error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
end if;
New_Line;
end getcontr;
You can enable or disable the Ctrl key. This procedure retrieves the current
setting.
When you disable this keycode, none of the key combinations that use the
Ctrl key will work. For example, the warm boot key sequence Ctrl-Alt-Del
will not work.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_control_key (
control_key_status : OUT IM_CONTROL;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The control_key_status parameter is one of the following constants:
IM_ENABLE
Ctrl key is enabled
IM_DISABLE
Ctrl key is disabled
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
See also:
im_set_control_key
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getcntrl Is
control_key_status : IM_CONTROL;
status_code : System.Word;
begin
im_get_control_key (control_key_status, status_code);
if control_key_status = IM_ENABLE then
put_Line ("Ctrl key ENABLED");
else
put_Line ("Ctrl key DISABLED");
end if;
end getcntrl;
This procedure retrieves the current size mode, video mode, scroll mode,
character height, and status code of the display.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_display_mode (
size_mode : OUT IM_STD_SIZE_MODE;
video_mode : OUT IM_STD_VIDEO_MODE;
scroll_mode : OUT IM_SCROLL_MODE;
character_height : OUT IM_CHARACTER_HEIGHT;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The size_mode parameter is required and is one of these constants:
IM_SIZE_MODE_80X25
80 x 25 text mode
IM_SIZE_MODE_20X16
20 x 16 text mode (2010 and 2020)
IM_SIZE_MODE_20X8
20 x 8 text mode (2010 and 2020)
IM_SIZE_MODE_10X16
10 x 16 text mode (2010 and 2020)
IM_SIZE_MODE_10X8
10 x 8 text mode (2010 and 2020)
If IM_SIZE_MODE_80X25 is set, you also need to set the video mode, scroll
mode, and character height.
If any other size_mode is set, the video mode, scroll mode, and character
height are automatically set.
The video_mode parameter requires IM_SIZE_MODE_80X25. The standard
BIOS supports up to mode 13 but the JANUS only supports up to mode 6.
You can also set video modes 0 through 3 with IC.EXE.
The video_mode parameter is one of these constants:
IM_STD_VIDEO_MODE_0
40 x 25 (use for double wide character)
IM_STD_VIDEO_MODE_1
40 x 25 (use for double wide character)
IM_STD_VIDEO_MODE_2
80 x 25
IM_STD_VIDEO_MODE_3
80 x 25
IM_STD_VIDEO_MODE_4
300 x 200 2-color
IM_STD_VIDEO_MODE_5
300 x 200 monochrome
IM_STD_VIDEO_MODE_6
640 x 200 2-color (2050)
The scroll_mode parameter requires IM_SIZE_MODE_80X25 and is one of
the following constants:
IM_LCD_SCROLL_AT_25
Scroll at line 25
IM_LCD_SCROLL_AT_16
Scroll at line 16 (2010 and 2020)
IM_LCD_SCROLL_AT_13
Scroll at line 13 (2050 and double height)
IM_LCD_SCROLL_AT_8
Scroll at line 8 (2010 and 2020)
The character_height parameter requires IM_SIZE_MODE_80X25 and is one
of the following constants:
IM_STANDARD_CHAR_HEIGHT Standard height characters, applies to
all scroll modes except line 8 and line 13
IM_DOUBLE_CHAR_HEIGHT
Double height characters, applies
only to scroll at line 8 and line 13
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
See Also:
im_set_display_mode
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getdisdl Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
package IM_STD_SIZE_MODE_IO is new ENUMERATION_IO
(enum => IM_STD_SIZE_MODE);
package IM_STD_VIDEO_MODE_IO is new ENUMERATION_IO
(enum => IM_STD_VIDEO_MODE);
package IM_SCROLL_MODE_IO is new ENUMERATION_IO
(enum => IM_SCROLL_MODE);
package IM_CHARACTER_HEIGHT_IO is new ENUMERATION_IO
(enum => IM_CHARACTER_HEIGHT);
status : System.Word;
size : IM_STD_SIZE_MODE;
video : IM_STD_VIDEO_MODE;
scroll : IM_SCROLL_MODE;
char_ht : IM_CHARACTER_HEIGHT;
begin
Put_Line ("Getting disp mode");
im_get_display_mode (size, video, scroll, char_ht, status);
if im_iserror (status) then
Put ("Get Disp Mode error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
New_Line;
end if;
Put ("size : ");
IM_STD_SIZE_MODE_IO.Put (size);
New_Line;
Put ("video : ");
IM_STD_VIDEO_MODE_IO.Put (video);
New_Line;
Put ("scroll : ");
IM_SCROLL_MODE_IO.Put (scroll);
New_Line;
Put ("char_ht : ");
IM_CHARACTER_HEIGHT_IO.Put (char_ht);
New_Line;
end getdisdl;
This function retrieves the hardware display type, either standard JANUS
reader or JANUS 2050 (VMU).
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_display_type (
type : OUT IM_STD_DISPLAY_TYPE;
status_code : OUT System.Word);
IN Parameters:
None.
OUT Parameters:
The type parameter is one of the following constants:
IM_LCD_20X16
Standard JANUS display
IM_CRT_80X25
JANUS VMU display
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
See Also:
im_get_display_mode, im_set_display_mode
With System, Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
Use Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
procedure DISTYPE is
package SYSBYTE_IO is new INTEGER_IO(System.Byte);
package SYSWORD_IO is new INTEGER_IO(System.Word);
use SYSBYTE_IO, SYSWORD_IO;
display_type : IM_DISPLAY_TYPE;
status : System.Word;
begin
clrscr;
Put_Line("im_get_display_type example:");
New_line;
im_get_display_type(display_type, status);
if (display_type = IM_LCD_20X16) then
Put_Line("Display type is Standard JANUS display");
else
Put_Line("Display type is JANUS VMU display");
end if;
Put("Status : ");
Print_status_code(status);
New_line;
end DISTYPE;
When the display is in 80X25 mode, the viewport follows the cursor as it
moves. The follow-the-cursor feature can be enabled or disabled. This
function retrieves the current setting.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_follow_cursor (
follow_cursor_status : OUT IM_CONTROL;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The follow_cursor_status parameter is one of the following constants:
IM_ENABLE
Follow-the-cursor mode is enabled
IM_DISABLE
Follow-the-cursor mode is disabled
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
Notes:
This procedure has no effect on the JANUS 2050.
See Also:
im_set_follow_cursor, im_cursor_to_viewport, im_viewport_to_cursor
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getfolcr Is
follow_cursor_status : IM_CONTROL;
status_code : System.Word;
begin
Put_Line ("Getting foll curs mode");
im_get_follow_cursor (follow_cursor_status, status_code);
if follow_cursor_status = IM_ENABLE then
Put_Line ("Follow Cursor ENABLED");
else
Put_Line ("Follow Cursor DISABLED");
end if;
end getfolcr;
This function returns the current mode of the input manager. The different
modes affect how the reader interprets and stores input.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_get_input_mode return IM_MODE;
Parameters:
None.
Return Value:
The IM_MODE return value is one of the following constants:
IM_WEDGE
Wedge mode
IM_PROGRAMMER
Programmer mode
IM_DESKTOP
Desktop mode
Notes:
There are three different reader input modes: Wedge, Programmer, and
Desktop. These different modes affect how the reader interprets and stores
input.
Wedge Mode Keypad and label input goes into the keyboard buffer with
minimal filtering. Wedge mode is the default mode at the DOS prompt after
reader services (RSERVICE.EXE) is loaded. Use Wedge mode when the
reader is running an application that uses the Virtual Wedge. When in this
mode, use standard input functions, such as TEXT_IO.Get, to retrieve
keypad or label input.
Wedge mode does not take full advantage of the reader’s power
management capabilities. You will probably notice reduced battery life
when the reader is in this mode compared to either Programmer or Desktop
mode. For more information on power management, see Chapter 5,
“Advanced Programming,” in the PSK Reference Manual.
Programmer Mode Inputs are echoed to the screen. Reader commands are
executed and saved. Use Programmer mode when the reader is executing
IRL commands. In general, when you are running an application that uses
the function libraries or software interrupts, the reader should be in
Programmer mode.
Desktop Mode The application is responsible for retrieving and displaying
input. Use Desktop mode when you need detailed information about a
pressed key. Each character returned consists of four bytes: the ASCII code,
scan code, and two bytes for the keyboard flags (Shift, Ctrl, Alt).
For more information about reader input modes, see Chapter 5, “Advanced
Programming,” in the PSK Reference Manual.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
See Also:
im_set_input_mode, im_receive_input
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getinmod Is
package IM_MODE_IO is new ENUMERATION_IO
(enum => IM_MODE);
mode : IM_MODE;
begin
mode := im_get_input_mode;
Put ("Mode is ");
IM_MODE_IO.Put (mode);
New_Line;
end getinmod;
Every time you press a key, the reader can emit a click. This procedure
retrieves the current setting (enabled or disabled) of the keyclick.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_keyclick (
keyclick_status : OUT IM_CONTROL;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The keyclick_status parameter is one of the following constants:
IM_ENABLE
Keyclick mode is enabled
IM_DISABLE
Keyclick mode is disabled
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
See Also:
im_set_keyclick
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getkeycl Is
keyclick_status : IM_CONTROL;
status_code : System.Word;
begin
im_get_keyclick (keyclick_status, status_code);
if keyclick_status = IM_ENABLE then
Put_Line ("Keyclick ENABLED");
else
Put_Line ("Keyclick DISABLED");
end if;
end getkeycl;
This function retrieves the symbology, such as Code 39, from the most
recently scanned label. Call this function after receiving the data using
im_receive_input.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_label_symbology (
symbology : OUT IM_DECTYPE;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The symbology parameter is one of the following constants:
IM_CODE_11
Code 11 bar code
IM_CODE_16K
Code 16K bar code
IM_CODE_39
Code 39 bar code
IM_CODE_49
Code 49 bar code
IM_CODE_93
Code 93 bar code
IM_CODE_128
Code 128 bar code
IM_CODABAR
Codabar bar code
IM_I_2_of_5
Interleaved 2 of 5
IM_MSI
MSI bar code
IM_PLESSEY
Plessey bar code
IM_UNKNOWN_DECODE
Unknown bar code
IM_UPC
Universal Product Code
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
Notes:
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
See Also:
im_receive_input
This function retrieves the length of the last input of the type selected. Use
this function after calling the im_receive_input function to get the data. The
length is saved when the call is initiated.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_get_length (
origin : IN IM_ORIGIN
) return System.Word;
IN Parameter:
The origin parameter is one of these constants:
IM_LABEL_SELECT
Label selected
IM_KEYBOARD_SELECT
Keypad selected
IM_COM1_SELECT
COM1 selected
IM_COM2_SELECT
COM2, scanner port selected (2010 and 2050)
IM_COM4_SELECT
COM4 selected (RF only)
OUT Parameter:
None.
Return Value:
This function retrieves the length of the last input read.
Notes:
For this function, all COM input is considered to be from the same source.
For example, if you call im_receive_input with IM_COM1_SELECT and
again with IM_COM4_SELECT, then a call to im_get_length with a source
of IM_COM1_SELECT returns the length of the message received from
COM4 because that was the last message read from a communications port.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
See Also:
im_receive_input
Example
See example for im_receive_input.
This procedure retrieves the currently configured postamble string and its
length.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_postamble (
post_string : OUT String;
post_length : OUT System.Word;
status_code : OUT System.Word);
IN Parameters:
None.
OUT Parameters:
The post_string parameter is the postamble string.
The length parameter is the length of the postamble string.
The status_code parameter is one of the standard status codes defined in
Appendix A, “Status Codes.”
Return Value:
None.
Notes:
You can set the postamble with IC.EXE, with the im_command function and
$+AE command, or by scanning a postamble. Refer to your JANUS user’s
manual for more information on configuring a postamble.
See Also:
im_get_postamble, im_get_config_info
With System, Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
Use Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
procedure POSAMBLE is
package SYSBYTE_IO is new INTEGER_IO(System.Byte);
package SYSWORD_IO is new INTEGER_IO(System.Word);
use SYSBYTE_IO, SYSWORD_IO;
postamble_string : String(1..300) := (others => Ascii.NUL);
postamble_length : System.Word;
status : System.Word;
begin
clrscr;
Put_Line("im_get_postamble example:");
New_line;
im_get_postamble(postamble_string, postamble_length, status);
Put("Postamble: ");
for i in Integer range 1..300 loop
exit when postamble_string(i) = Ascii.NUL;
Put(postamble_string(i));
end loop;
New_line;
Put("Length : ");
Put(postamble_length);
New_line;
Put("Status : ");
Print_status_code(status);
New_line;
end POSAMBLE;
This procedure retrieves the currently configured preamble string and its
length.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_postamble (
preamble_string : OUT String;
preamble_length : OUT System.Word;
status_code : OUT System.Word);
IN Parameters:
None.
OUT Parameters:
The preamble_string parameter is the preamble string.
The length parameter is the length of the preamble string.
The status_code parameter is one of the standard status codes defined in
Appendix A, “Status Codes.”
Return Value:
None.
Notes:
You can set the preamble with IC.EXE, with the im_command function and
$+AE command, or by scanning a preamble. Refer to your JANUS user’s
manual for more information on configuring a preamble.
See Also:
im_get_postamble, im_get_config_info
With System, Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
Use Intrmecd_IO, Intrmecp_IO, Text_IO, RTEXT_IO, ITOOLS;
procedure PREAMBLE is
package SYSBYTE_IO is new INTEGER_IO(System.Byte);
package SYSWORD_IO is new INTEGER_IO(System.Word);
use SYSBYTE_IO, SYSWORD_IO;
preamble_string : String(1..300) := (others => Ascii.NUL);
preamble_length : System.Word;
status : System.Word;
begin
clrscr;
Put_Line("im_get_preamble example:");
New_line;
im_get_preamble(preamble_string, preamble_length, status);
Put("Preamble: ");
for i in Integer range 1..300 loop
exit when preamble_string(i) = Ascii.NUL;
Put(preamble_string(i));
end loop;
New_line;
Put("Length : ");
Put(preamble_length);
New_line;
Put("Status : ");
Print_status_code(status);
New_line;
end PREAMBLE;
This function retrieves the current setting of the viewport lock. When the
display is in 80X25 mode, you can use the viewport in virtual display mode
unless the currently running application program restricts it. The
application program may require the viewport to be locked or unlocked.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_viewport_lock (
viewport_lock_status : OUT IM_CONTROL;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The viewport_lock_status parameter is one of the following constants:
IM_ENABLE
Viewport is locked
IM_DISABLE
Viewport is unlocked
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
Notes:
The display must be in 80X25 mode (see im_set_display_mode) to use this
function.
This function has no effect on the JANUS 2050.
When the viewport is “locked,” the viewport movement keys do not move
the viewport. The viewport can still move if follow-the-cursor mode is
enabled.
See Also:
im_set_viewport_lock, im_set_display_mode, im_get_display_mode
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure getviewl Is
viewport_lock_status : IM_CONTROL;
status_code : System.Word;
begin
im_get_viewport_lock (viewport_lock_status, status_code);
if viewport_lock_status = IM_ENABLE then
Put_Line ("Viewport Lock ENABLED");
else
Put_Line ("Viewport Lock DISABLED");
end if;
end getviewl;
This function retrieves the current setting of the warm boot status. You can
enable or disable the Ctrl-Alt-Del warm boot key sequence. When disabled,
pressing the Ctrl-Alt-Del sequence does not reboot the reader.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_get_warm_boot (
warmboot_status : OUT IM_CONTROL;
status_code : OUT System.Word);
IN Parameter:
None.
OUT Parameter:
The warmboot_status parameter is one of the following constants:
IM_ENABLE
The warm boot is enabled
IM_DISABLE
The warm boot is disabled
The status_code is one of the standard status codes defined in Appendix A,
“Status Codes.”
Return Value:
None.
See Also:
im_set_warm_boot
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure get_warm Is
warmboot_status : IM_CONTROL;
status_code : System.Word;
begin
im_get_warm_boot (warmboot_status, status_code);
if warmboot_status = IM_ENABLE then
Put_Line ("Warmboot ENABLED");
else
Put_Line ("Warmboot DISABLED");
end if;
end get_warm;
This function decreases the LCD display contrast by one level. The display
contrast is the lightness or darkness of the characters against the reader
display. The reader display has 32 levels of contrast (0 to 31), where 0 is
very light, and 31 is very dark.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_increase_contrast return System.Word;
Parameters:
None.
Return Value:
This function returns one of the standard status codes listed in Appendix A,
“Status Codes.”
Notes:
The 0 to 31 scale fine-tunes the contrast more precisely than using the
keypad to adjust the contrast.
The functions im_set_contrast and im_get_contrast use a scale of 0 to 7 that
is related to the scale of 0 to 31 used by im_increase_contrast and
im_decrease_contrast. The following table shows the equivalent values for
the 0 to 7 scale.
Scale 0 to 7
Scale 0 to 31
Level
0
10
Very light
1
12
2
14
3
16
4
18
5
20
6
22
7
24
Very dark
This function has no effect on the JANUS 2050.
See Also:
im_get_contrast, im_decrease_contrast, im_set_contrast
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure incrcont Is
package SYSWORD_IO is new INTEGER_IO (System.Word);
status : System.Word;
begin
Put_Line ("Increasing contrast");
status := im_increase_contrast;
if im_iserror (status) then
Put ("Inc contrast error = ");
SYSWORD_IO.Put (status, WIDTH => 8);
New_Line;
end if;
end incrcont;
This function checks to see if any input buffers have data and returns the
buffer identification.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
function im_input_status return IM_ORIGIN;
Parameters:
None.
Return Value:
IM_ORIGIN is one of the following constants:
IM_NO_SELECT
No selection made
IM_LABEL_SELECT
Label selected
IM_KEYBOARD_SELECT
Keyboard selected
IM_COM1_SELECT
COM1 selected
IM_COM2_SELECT
COM2, scanner (2010 and 2050)
IM_COM4_SELECT
COM4 selected (RF only)
Notes:
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
With System, Intrmecd_IO, Intrmecp_IO, Text_IO;
Use Intrmecd_IO, Intrmecp_IO, Text_IO;
procedure exinput is
label : String(1..256) := (others => Ascii.NUL);
input_status : IM_ORIGIN := IM_NO_SELECT;
receive_status : System.Word;
returned_origin : IM_ORIGIN;
begin
New_Line(2);
Put_Line(" Janus 2010 ");
Put_Line(" Input Status");
Put_Line("Input from keyboard");
Put_Line("or read label");
New_line;
im_set_input_mode(IM_DESKTOP);
-- Loop while waiting for im_input_status
while input_status = IM_NO_SELECT loop
input_status := im_input_status;
end loop;
Put("Input from ");
if input_status = IM_KEYBOARD_SELECT then
Put("Keyboard");
else
Put("Label");
end if;
New_Line;
-- Read input
im_receive_input(input_status, IM_ZERO_TIMEOUT, returned_origin,
label, receive_status);
if im_isgood(receive_status) then
Put(label);
New_Line;
else
Put("Rec status: ");
im_message(receive_status);
New_Line;
end if;
im_set_input_mode(IM_WEDGE);
end exinput;
This procedure retrieves input from bar code labels or the keypad in the
same manner as IRL ASCII input command A. This procedure returns the
input data to the buffer, edits reader commands, and displays input data.
For more information on IRL and command A, refer to the IRL Programming
Reference Manual.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_irl_a (
timeout : In System.Word;
test_table : In IM_LENGTH_SPEC_ARRAY_PTR;
mask_string : In String;
irl_string : Out String;
cmd_count : Out System.Word;
symbology : Out IM_DECTYPE;
status_code : Out System.Word);
IN Parameter:
The timeout parameter is the receive timeout period. You can exit the
function before data is received or before the timeout occurs by performing
an application break sequence (see your JANUS user’s manual). The return
status indicates whether the function was successful, a timeout occurred, or
the application break was received.
The numeric range for timeout is from 1 to 65,534 ms. You can also use one
of the following constants:
IM_ZERO_TIMEOUT
No wait
IM_INFINITE_TIMEOUT
Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the
end of message character has been received.
Data is returned only if its length matches one of the five lengths specified
in the test_table. The test_table parameter must be a matrix in this form:
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
The a position in the matrix is one of the following:
IM_NO_LENGTH
Accept data of any length
IM_LENGTH
Accept data with a specific length
IM_RANGE
Accept data within a length range
If IM_LENGTH is specified in the a position, the actual length of the data
string is placed in the d position (and b and c are not used).
If IM_RANGE is specified in the a position, the data length must be within
the range of b and c (and d is not used).
Set any unused table entries to {IM_NO_LENGTH,0,0,0}.
The mask_string parameter sets up a data mask that received data must
match. mask_string can accept a string of constants or wildcard characters.
For example, use the string ### - #### to accept only phone numbers.
You can use one or more of these wildcard characters to define the mask:
#
Numeric
@
Alpha
?
Alphanumeric printable
NULL (CHR$(0))
No mask
OUT Parameter:
You must allocate at least 256 bytes to the irl_string parameter.
The cmd_count returned will be 0 unless an abort command is passed to the
string. Refer to Chapter 5, “Advanced Programming,” in the PSK Reference
Manual for more information.
The symbology parameter is one of the following constants:
IM_CODE_11
Code 11 bar code
IM_CODE_16K
Code 16K bar code
IM_CODE_39
Code 39 bar code
IM_CODE_49
Code 49 bar code
IM_CODE_93
Code 93 bar code
IM_CODE_128
Code 128 bar code
IM_CODABAR
Codabar bar code
Interleaved 2 of 5
IM_MSI
MSI bar code
IM_PLESSEY
Plessey bar code
IM_UNKNOWN_DECODE
Unknown bar code
IM_UPC
Universal Product Code
The status_code parameter is one of the standard status codes listed in
Appendix A, “Status Codes.”
Return Value:
None.
Notes:
You must set the reader to Programmer mode with the im_set_input_mode
function.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
Data does not display correctly on the screen if the display is in the 80X25
mode after the cursor has scrolled off the bottom of the display. Set the
display to one of the other modes using im_set_display_mode.
See Also:
im_irl_k, im_irl_n, im_irl_v, im_irl_y, im_set_input_mode,
im_set_display_mode
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure ex_irl_a is
cmd_count : System.Word;
display_status : System.Word;
irl_string : String(1..256) := (others => Ascii.NUL);
length_table : IM_LENGTH_SPEC_ARRAY;
mask : String(1..80) := (others => Ascii.NUL);
status : System.Word;
symbol : IM_DECTYPE;
timeout : System.Word := 25000; -- 25 second timeout
package SYMBOL_IO is new ENUMERATION_IO(enum=>IM_DECTYPE);
begin
length_table := IM_LENGTH_SPEC_ARRAY'(
(IM_LENGTH, 0, 0, 2),
(IM_RANGE, 9, 14, 0),
(IM_LENGTH, 2, 2, 4),
(IM_RANGE, 16, 17, 2),
(IM_NO_LENGTH, 2, 2, 2));
-- Set display mode to something other than 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_20X16,
IM_STD_VIDEO_MODE_0, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
Put_Line(" Example im_irl_a");
New_Line;
Put_Line("Enter 8 AlphaNums");
Put_Line(" from keyboard");
Put_Line(" or read label");
Put_Line("q to quit");
-- Set Reader Wedge mode to program interface
im_set_input_mode(IM_PROGRAMMER);
mask(1..8) := "????????";
loop
-- Read input using im_irl_a
im_irl_a (timeout, length_table, mask, irl_string,
cmd_count, symbol, status);
exit when irl_string(1) = 'q';
if im_isgood(status) then
New_Line;
Put("Data read: ");
Put(irl_string(1..8));
New_Line;
Put_Line("The symbology read:");
SYMBOL_IO.Put(symbol);
New_Line;
else
im_message(status);
New_Line;
end if;
end loop;
-- Set Reader Wedge mode back to Virtual Wedge mode
im_set_input_mode(IM_WEDGE);
-- Set display mode back to 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_80X25,
IM_STD_VIDEO_MODE_3, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
end ex_irl_a;
This procedure receives input from the keypad in any format in the same
manner as IRL ASCII input command K. This procedure returns the input
data to the buffer, edits reader commands, and displays input data. For
more information on IRL and command K, refer to the IRL Programming
Reference Manual.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_irl_k (
timeout : In System.Word;
test_table : In IM_LENGTH_SPEC_ARRAY_PTR;
mask_string : In String;
irl_string : Out String;
cmd_count : Out System.Word;
status_code : Out System.Word);
IN Parameters:
The timeout parameter is the receive timeout period. You can exit the
function before data is received or before the timeout occurs by performing
an application break sequence (see your JANUS user’s manual). The return
status indicates whether the function was successful, a timeout occurred, or
the application break was received.
The numeric range for timeout is from 1 to 65,534 ms. You can also use one
of the following constants:
IM_ZERO_TIMEOUT
No wait
IM_INFINITE_TIMEOUT
Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the
end of message character has been received.
Data is returned only if its length matches one of the five lengths specified
in the test_table. The test_table parameter must be a matrix in this form:
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
The a position in the matrix is one of the following:
IM_NO_LENGTH
Accept data of any length
IM_LENGTH
Accept data of a specific length
IM_RANGE
Accept data within a length range
If IM_LENGTH is specified in the a position, the actual length of the data
string is placed in the d position (and b and c are not used).
If IM_RANGE is specified in the a position, the data length must be within
the range of b and c (and d is not used).
Set any unused table entries to {IM_NO_LENGTH,0,0,0}.
The mask_string parameter sets up a data mask that received data must
match. mask_string can accept a string of constants or wildcard characters.
For example, use the string ### - #### to accept only phone numbers.
You can use one or more of these wildcard characters to define the mask:
#
Numeric
@
Alpha
?
Alphanumeric printable
NULL (CHR$(0))
No mask
OUT Parameters:
You must allocate at least 256 bytes to the irl_string parameter.
The cmd_count returned is 0 unless an abort command is passed in the
string.
The status_code parameter is a standard status codes listed in Appendix A,
“Status Codes.”
Return Value:
None.
You must set the reader to Programmer mode with the im_set_input_mode
function.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
Data does not display correctly on the screen if the display is in the 80X25
mode after the cursor has scrolled off the bottom of the display. Set the
display to one of the other modes using im_set_display_mode.
See Also:
im_irl_a, im_irl_n, im_irl_v, im_irl_y, im_set_display_mode,
im_set_input_mode
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure ex_irl_k is
cmd_count : System.Word;
display_status : System.Word;
irl_string : String(1..256);
length_table : IM_LENGTH_SPEC_ARRAY;
mask : String(1..80) := (others => Ascii.NUL);
status : System.Word;
timeout : System.Word := 30000; -- 30 second timeout
begin
length_table := IM_LENGTH_SPEC_ARRAY'(
(IM_LENGTH, 0, 0, 0),
(IM_LENGTH, 0, 0, 0),
(IM_LENGTH, 0, 0, 0),
(IM_LENGTH, 0, 0, 0),
(IM_LENGTH, 0, 0, 0));
-- Set display mode to something other than 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_20X16,
IM_STD_VIDEO_MODE_0, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
Put_Line(" Example im_irl_k");
New_Line;
Put_Line("Enter 8 AlphaNums");
Put_Line(" from keyboard");
Put_Line("q to quit");
-- Set Reader Wedge mode to program interface
im_set_input_mode(IM_PROGRAMMER);
mask(1..8) := "????????";
loop
-- Clear input string
irl_string := (others => Ascii.NUL);
-- Read input from keyboard
im_irl_k (timeout, length_table, mask, irl_string, cmd_count, status);
exit when irl_string(1) = 'q';
if im_isgood(status) then
New_Line;
Put("Data::");
Put(irl_string(1..8));
Put("::");
New_Line;
else
im_message(status);
New_Line;
end if;
end loop;
-- Set Reader Wedge mode back to Virtual Wedge mode
im_set_input_mode(IM_WEDGE);
-- Set display mode back to 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_80X25,
IM_STD_VIDEO_MODE_3, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
end ex_irl_k;
This procedure receives numeric input from the keypad or a label in the
same manner as IRL numeric input command N. Nonnumeric data is
ignored.
This procedure clears any data existing in the keypad or label buffers before
the function was called, edits reader commands from input, and displays
input data. For more information on IRL and command N, refer to the IRL
Programming Reference Manual.
This procedure corresponds to IRL command N. Refer to the IRL
Programming Reference Manual for more information on IRL commands.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_irl_n (
timeout : In System.Word;
test_table : In IM_LENGTH_SPEC_ARRAY_PTR;
irl_string : Out String;
cmd_count : Out System.Word;
symbology : Out IM_DECTYPE;
status_code : Out System.Word);
IN Parameters:
The timeout parameter is the receive timeout period. You can exit the
function before data is received or before the timeout occurs by performing
an application break sequence (see your JANUS user’s manual). The return
status indicates whether the function was successful, a timeout occurred, or
the application break was received.
The numeric range for timeout is from 1 to 65,534 ms. You can also use one
of the following constants:
IM_ZERO_TIMEOUT
No wait
IM_INFINITE_TIMEOUT
Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the
end of message character has been received.
Data is returned only if its length matches one of the five lengths specified
in the test_table. The test_table parameter must be a matrix in this form:
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
{a, b, c, d},
The a position in the matrix is one of the following:
IM_NO_LENGTH Accept data of any length
IM_LENGTH
Accept data of a specific length
IM_RANGE
Accept data within a length range
If IM_LENGTH is specified in the a position, the actual length of the data
string is placed in the d position (and b and c are not used).
If IM_RANGE is specified in the a position, the data length must be within
the range of b and c (and d is not used).
Set any unused table entries to {IM_NO_LENGTH,0,0,0}.
OUT Parameters:
You must allocate at least 256 bytes to the irl_string parameter.
The cmd_count returned is 0 unless an abort command is passed in the
string.
The symbology parameter is one of the following constants:
IM_UNKNOWN_DECODE
Unknown bar code
IM_CODABAR
Codebar bar code
IM_CODE_11
Code 11 bar code
IM_CODE_16K
Code 16K bar code
IM_CODE_39
Code 39 bar code
IM_CODE_49
Code 93 bar code
IM_CODE_93
Code 49 bar code
IM_CODE_128
Code 128 bar code
Interleaved 2 of 5
IM_MSI
MSI bar code
IM_PLESSEY
Plessey bar code
IM_UPC
Universal Product code
The status_code parameter is a standard status codes listed in Appendix A,
“Status Codes.”
Return Value:
None.
Notes:
You must set the reader to Programmer mode with the im_set_input_mode
function.
You must install the Reader Wedge to use this function. For information on
loading RWTSR.EXE, see “Runtime Requirements” in Chapter 2, “Working
With Ada.”
Data does not display correctly on the screen if the display is in the 80X25
mode after the cursor has scrolled off the bottom of the display. Set the
display to one of the other modes using im_set_display_mode.
See Also:
im_irl_a, im_irl_k, im_irl_v, im_irl_y, im_set_input_mode,
im_set_display_mode
Example
With System, Text_IO, Intrmecd_IO, Intrmecp_IO;
Use System, Text_IO, Intrmecd_IO, Intrmecp_IO;
procedure ex_irl_n is
cmd_count : System.Word;
display_status : System.Word;
irl_string : String(1..256);
length_table : IM_LENGTH_SPEC_ARRAY;
status : System.Word;
symbol : IM_DECTYPE;
package SYMBOL_IO is new ENUMERATION_IO(enum=>IM_DECTYPE);
begin
length_table := IM_LENGTH_SPEC_ARRAY'(
(IM_LENGTH, 0, 0, 2),
(IM_RANGE, 9, 14, 0),
(IM_LENGTH, 0, 0, 4),
(IM_RANGE, 16, 17, 2),
(IM_LENGTH, 0, 0, 6));
-- Set display mode to something other than 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_20X16,
IM_STD_VIDEO_MODE_0, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
Put_Line(" Example im_irl_n");
New_Line;
Put_Line("Enter Numeric data");
Put_Line(" from keyboard");
Put_Line(" or read label");
Put_Line("99 to quit");
-- Set Reader Wedge mode to program interface
im_set_input_mode(IM_PROGRAMMER);
loop
-- Clear input string
irl_string := (others => Ascii.NUL);
-- Read numeric input from keyboard or label
im_irl_n (IM_INFINITE_TIMEOUT, length_table, irl_string,
cmd_count, symbol, status);
exit when irl_string(1..2) = "99";
if im_isgood(status) then
New_Line;
Put_Line("Data read: ");
-- Print only printable charaters
for i in Integer range 1..256 loop
exit when irl_string(i) = Ascii.NUL;
if irl_string(i) in '0'..'9' then
Put(irl_string(i));
else
Put('?');
end if;
end loop;
New_Line;
Put_Line("The symbology read:");
SYMBOL_IO.Put(symbol);
New_Line;
else
im_message(status);
New_Line;
end if;
end loop;
-- Set Reader Wedge mode back to Virtual Wedge mode
im_set_input_mode(IM_WEDGE);
-- Set display mode back to 80X25
display_status := im_set_display_mode(IM_SIZE_MODE_80X25,
IM_STD_VIDEO_MODE_3, IM_LCD_SCROLL_AT_16, IM_STANDARD_CHAR_HEIGHT);
end ex_irl_n;
This procedure receives input from any specified source in any format, in
the same manner as an IRL universal input command V. For more
information on IRL and command V, refer to the IRL Programming Reference
Manual.
This procedure corresponds to IRL command V. Refer to the IRL
Programming Reference Manual for more information on IRL commands.
Syntax:
With Intrmecd_IO, Intrmecp_IO;
Use Intrmecd_IO, Intrmecp_IO;
procedure im_irl_v (
timeout : In System.Word;
edit : In IM_CONTROL;
beep : In IM_LABEL_BEEP_CONTROL;
display : In IM_CONTROL;
source : In Out IM_ORIGIN;
irl_string : Out String;
cmd_count : Out System.Word;
symbology : Out IM_DECTYPE;
status_code : Out System.Word);
IN Parameters:
The timeout parameter is the receive timeout period. You can exit the
function before data is received or before the timeout occurs by performing
an application break sequence (see your JANUS user’s manual). The return
status indicates whether the function was successful, a timeout occurred, or
the application break was received.
The numeric range for timeout is from 1 to 65,534 ms. You can also use one
of the following constants:
IM_ZERO_TIMEOUT
No wait
IM_INFINITE_TIMEOUT
Wait forever
If IM_INFINITE_TIMEOUT is selected, the function will not return until the
end of message character has been received.
If IM_INFINITE_TIMEOUT is selected, the function does not return until
data is received.
The edit parameter determines whether the Reader Wedge parses reader
commands. Use one of the following constants:
IM_DISABLE
Disable reader command parsing
IM_ENABLE
Enable reader command parsing
If edit is IM_DISABLED, reader commands are treated as data.
The beep parameter determines whether the IRL V command beeps or not
when data is entered.
If beep is set to IM_APPLI_BEEP, the Reader Wedge does not control the
beep. Instead, you code the application to sound a beep when your program
design requires one.
If beep is set to IM_WEDGE_BEEP, the reader always beeps when data is
entered. The beep parameter is one of the following constants:
IM_APPLI_BEEP
Application controls the beep
IM_WEDGE_BEEP Beeps occur automatically
The display parameter determines if the data is displayed as it is entered.
The display parameter is one of the following constants:
IM_DISABLE
Disable display of data
IM_ENABLE
Enable display of data
IN/OUT
Parameters:
The source parameter determines which input sources are allowed. When
the IRL V command returns, source indicates where the data came from.
When both keyboard and label inputs are allowed, the source always returns
keyboard because it is possible for keyed and scanned data to be
intermixed. Although intermixing is possible, it is not likely to occur.
If you have both the keyboard and scanner enabled, and you want to know
where the data came from, first check the symbology: