Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 3 of 40

2D JANUS PSK for C/C++ Reference Manual, pages 21 to 30

Pages 21 to 30 of 400

The original document is the PDF (793 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Intermec J2020, Intermec J2010 and Intermec J2050

Page 21

Getting Started

1

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

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 MS-DOS 6.2. 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.

JR2020

• 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.

I/O

Co nn Da ta

Ct rl Al t

Sh ift Ca ps f

TM

~

A

_

G

-

`

"

B

+

H

=

M '

F6

{

C I

[

O

<

N S

\

T Y

,

U Z

F1

D

}

J

]

P

>

V Ctr l Alt

F7

E

:

K

;

Q

?

W

/

F2 F8

F ho s

F4

*

8

$

4 en

* % d

X

5

! en

1

@ f ter ins sp ac e

2

)

0 pg

F1

0 up

(

F5

9 / ^

6 pg dn

#

3 de l

Es

> c

.

J2050

• The operating system and protocol support programs reduce the memory available for your application to about 450K.

+

-

R Cap

F9

7

L

.

F3 me

& nu m loc k en ter

JPSK.001

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

Page 22

2D JANUS PSK for C/C++ 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 MS-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 MS-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.

1-4

Page 23

Getting Started

1

Reader Services 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. 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. If you attempt to run these programs without the Simulator, they will cause your PC to lock up and possibly corrupt your system BIOS. Consiel N’exécutez pas de programmes utilisant des extensions d’interruption spécifiques à Intermec sur votre PC. 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.

1-5

Page 24

2D JANUS PSK for C/C++ Reference Manual

Function Libraries You can use a supported language and its associated function libraries to access reader services. The term supported language describes a language that has extensive Intermec-supplied library functions that control reader services. The supported language functions are stored in libraries contained in the Programmer’s Software Kit Language Libraries found at www.intermec.com. At the time of printing, the list of supported languages includes: • Borland C/C++ • Microsoft C/C++ • Microsoft Visual C/C++ When you write applications in one of the supported languages, link your program to the library for your chosen language by including the header files in your program, and then invoke the reader services using the languagespecific reader service commands. The Intermec-specific functions are documented in Chapter 2, “C Language Support.”

1-6

Page 25

Getting Started

1

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 C). Some of the most popular languages have built-in commands for triggering software interrupts (Microsoft C and Borland C++ for example). Languages that do not have built-in interrupt commands sometimes 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.”

CAUTION

Caution Do not run programs that use Intermec-specific interrupt extensions on your PC. If you attempt to run these programs, 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. 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.

1-7

Page 26

2D JANUS PSK for C/C++ Reference Manual

Installing the Programmer’s Software Kit The files for the Programmer’s Software Kit Language Libraries are distributed in several subdirectories, each corresponding to the supported language: Subdirectory Name

Language

INTERMEC\BORLANDC

Borland C/C++

INTERMEC\MICROSFT

Microsoft C/C++ and Visual C/C++

The exact contents of the PSK Language Libraries is listed in the README.TXT file. 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 newer version files having the same name. To install the library files 1. Copy the PSK Language Libraries files from www.intermec.com to your computer. 2. Enter the following command: INSTALL dirname drive where: dirname is either BORLANDC, or MICROSFT, depending on which programming language you need. drive is the location where you want to install the utilities library. Drive C is the default drive.

1-8

Page 27 read from a scan by OCR; it may hold reading errors

t r O 0

1p u ge S a gu n

La

6

Page 28

blank

Page 29

C Language Support

2

This chapter describes how to compile and link applications in C using the Programmer’s Software Kit (PSK) library functions. It also provides the syntax and parameters for each function.

Building Your Program Using Borland C/C++ Use the following procedure to compile and link a C/C++ program that uses the Borland C/C++ library functions that you installed from the PSK web site at www.intermec.com. You will use one make file and one example program: XCDEMO.PRJ

Sample make file to create XCDEMO.EXE.

XDEMO.PRJ

Sample make file to create XDEMO.EXE.

XCDEMO.C

Sample reader program using im_receive_input.

XDEMO.C

Sample reader program using IRL-like functions.

If you are building your own program, make sure that you set the following options. The sample programs already include these settings: • The project must be set to create a DOS-executable file. • The memory model must be set to the Large compilation model.

To build a sample program using Borland C/C++ 1. Start the Borland Programmer’s Platform from Microsoft Windows. 2. Open the project file XDEMO.PRJ or XCDEMO.PRJ from: \INTERMEC\BORLANDC\SAMPLES 3. Open XDEMO.C or XCDEMO.C from: \INTERMEC\BORLANDC\SAMPLES 4. From the Options menu, set the Directories to the directory containing your Borland C include files and your Borland C library files: \BORLANDC\INCLUDE;\INTERMEC\BORLANDC\INCLUDE \BORLANDC\LIB;\INTERMEC\BORLANDC\LIB 5. Compile and link the demo program.

2-3

Page 30

2D JANUS PSK for C/C++ Reference Manual

Building Your Program Using Microsoft C/C++ Use the following procedure to compile and link a C/C++ program that uses the Microsoft C/C++ library functions that you installed from the PSK web site at www.intermec.com. You will use one make file and one example program: XCDEMO.MAK Sample make file to create XCDEMO.EXE. XDEMO.MAK

Sample make file to create XDEMO.EXE.

XCDEMO.C

Sample reader program using im_receive_input.

XDEMO.CPP

Sample reader program using IRL-like functions.

If you are building your own program, make sure that you set the following options. The sample programs already include these settings: • The project must be set to create a DOS-executable file. • The memory model must be set to the Large compilation model.

To build a sample program using Microsoft C/C++ 1. Start the Microsoft Programmer’s Workbench from Microsoft Windows. 2. Open XCDEMO.MAK or XDEMO.MAK from: \INTERMEC\MICROSFT\SAMPLES 3. Open XCDEMO.C or XDEMO.CPP from: \INTERMEC\MICROSFT\SAMPLES 4. Set OPTIONS | DIRECTORIES to the directory containing your Microsoft C include files and your Microsoft C library files. The sample project uses the following include files and library files: \MICROSFT\INCLUDE;\INTERMEC\MICROSFT\INCLUDE \MICROSFT\LIB;\INTERMEC\MICROSFT\LIB 5. Build the demo program from the Project menu.

2-4