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 4 of 25

JANUS PSK for Ada Reference Manual, pages 31 to 40

Pages 31 to 40 of 250

The original document is the PDF (415 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 31

Working With Ada

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.

2-7

Page 32

JANUS PSK for Ada Reference Manual

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.

2-8

Page 33

Working With Ada

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.

2-9

Page 34

JANUS PSK for Ada Reference Manual

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.

2-10

Page 35

Working With Ada

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.

2-11

Page 36

JANUS PSK for Ada Reference Manual

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 UserDefined, 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.

2-12

Page 37

Working With Ada

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

2-13

Page 38

JANUS PSK for Ada Reference Manual

Specific Functions With Runtime Requirements The following table lists the PSK functions that have runtime requirements.

Specific Runtime Requirements

2-14

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.

Page 39

Working With Ada

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.

2-15

Page 40

JANUS PSK for Ada Reference Manual

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) indicates success.

This macro returns a nonzero number when status 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;

2-16