The text of a manual · part 10 of 17
Apex III / Apex IV Technical Reference Manual, Second Edition, pages 91 to 100
Pages 91 to 100 of 168
The original document is the PDF (1.2 MB). 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 Compsee Apex III and Compsee Apex IV
Page 91
Apex PDT Technical Reference Manual
6 Utility Programs
Low-Level API The basic mechanism for communicating with the installed Bar Code Driver is via the DOS multiplex interrupt (sometimes referred to as the TSR interrupt - Int 2Fh). All parameters are passed in registers to the interrupt and all registers that are not shown are undefined. Undefined registers vary by function. All API interrupts use register ax to pass the following: AH = our ID value (default is BCD_ID, defined as 0CEh). AL = requested service ID 00 – install check 01 – uninstall the driver, freed memory is returned to DOS 02 – Set API option with string 03 – Scan now 04 – Query driver (future implementation) 05 – Set and use external buffer 06 – Internal (Compsee) use only Install Check Service 00 – Install Check ah = BCD_ID Input: al = 00 ah = BCD_ID Returns: al = 0FFh if installed This function simply returns the al set to 0FFh and is used Notes: to determine if the driver is installed. There is no mechanism supplied to install the driver from an application. Do NOT attempt this! The driver must be installed from the DOS command line or a batch file such as [autoexec.bat].
Uninstall Service 01 – Uninstall ah = BCD_ID Input: al = 01 none Returns: Under DOS, a TSR can only be uninstalled from the Notes: command line and can only be uninstalled if it is the last TSR installed (DOS limitations). If possible, this function will uninstall the driver. See CAUTION and additional notes on next page.
COAM30002
Rev. 2.00
8/13/02
6-19
Page 92
Apex PDT Technical Reference Manual
6 Utility Programs
Service 01 – Uninstall continued CAUTION! This request should NOT be used from the API. System hang-ups, loss of data or files, or both can result. The command line switch “R” should be used to remove the driver from memory. Notes Continued:
If it is not possible to remove the driver (because of other drivers loaded after it or other DOS limitations), this request will disable the driver, but not remove it or free the memory used by it. Therefore, it is recommended that this TSR be loaded last into memory.
API Command String Service 02 – API Command String ah = BCD_ID Input: al = 02 dx:bx = far pointer to ASCIIZ string argument (dx=segment, bx=offset) ax = 0 if successful, else BAD_OPTION, BAD_MOD1, Returns: BAD_MOD2 This function is used to set driver options and modifiers Notes: from within applications. Options utilize the same syntax described previously in Driver Options and Modifiers section. dx:bx is used to pass a far pointer to an ASCIIZ string argument.
Scan Service 03 – Scan ah = BCD_ID Input: al = 03 ax = 0 if successful, else BAD_OPTION, BAD_MOD1, Returns: BAD_MOD2 This function causes the driver to begin scanning Notes: immediately. For applications that require fine control of when scanning is permitted, the application should disable the driver from automatically activating when the <SCAN> key is pressed (using “-BTN”). Then have the application monitor the keyboard for the <SCAN> key and invoke this function to start scanning when desired. Note that the driver will stop scanning when either the <SCAN> key is released; the programmed timeout limits are exceeded, or it successfully recognizes a symbol.
6-20
COAM30002
Rev. 2.00
8/13/02
Page 93
Apex PDT Technical Reference Manual
6 Utility Programs
Query Service 04 – Query ah = BCD_ID Input: al = 04 dx:bx = far pointer to structure for driver to fill in (dx=segment, bx=offset) ax = 0 if successful Returns: This function is currently not implemented and should not Notes: be used. Results are unpredictable.
Set Buffer Service 05 – Set Buffer ah = BCD_ID Input: al = 05 dx:bx = far pointer to apiBufferMsg structure (See below). (dx=segment, bx=offset) typedef struct { char far *addr; unsigned far *count; unsigned size; CODETYPE far *symbologyIs; } apiBufferMsg; The structure pointed to by dx:bx is used to pass arguments between the resident driver and the application code where: q addr = far pointer to a character buffer (array) for storing the decoded symbol. q count = far pointer to an unsigned integer where the number of decoded characters is stored. q size = the size of the character buffer array in bytes. q symbologyIs = far pointer to an integer variable. A value is placed in this location by the driver indicating the last symbology recognized (refer to Table 6-3 on page 6-10). Returns:
ax = 0 if successful
COAM30002
Rev. 2.00
8/13/02
6-21
Page 94
Apex PDT Technical Reference Manual
6 Utility Programs
Service 05 – Set Buffer (continued) This function is used to tell the driver to place the Notes: decoded symbol information in an external buffer (supplied by the application). The symbol information includes the following: q
The ASCII symbol data (in ASCIIZ format). The count of decoded characters placed in the buffer (not including the NULL terminator). q The symbol type (I2/5, Code 11, etc.) represented by a numeric constant (see Table 6-3 for additional details). If this function is invoked and a valid non-zero address is supplied, wedge mode is disabled. To enable wedge mode, call this function with dx:bx set to 0000:0000. The mode may be changed at any time. q
Internal
Service 06 – Internal (See CAUTION below) Input: Returns:
ah = BCD_ID al = 06 N/A
CAUTION! Reserved For Compsee, Inc. Internal Use Only! Use of this service may result in unintended, harmful effects, including system crashes and/or damaged files. DO NOT make any attempt to utilize this service.
6-22
COAM30002
Rev. 2.00
8/13/02
Page 95
Apex PDT Technical Reference Manual
6 Utility Programs
Wedge Mode The default mode when loading the driver is Wedge Mode. In Wedge Mode, decoded symbols are placed into the standard keyboard buffer and standard C calls are used to remove them (e.g. getch(), getche(), etc.). Factors affecting the use of Wedge Mode include the following: q Wedge Mode is limited by the size of the keyboard buffer, which by default (in all DOS based computers) is limited to 15 characters. The buffer size is limited to the size of the keyboard buffer. q The number of decoded characters is unknown. If decoded data will not fit into the keyboard buffer, the data is truncated. q Applications must constantly read the keyboard buffer and remove keystrokes to prevent data errors while in wedge mode. q The data may require termination with a carriage return <ENT>, thereby reducing the size of the data characters that will fit into the buffer by one. q In order to know the decoded symbology type, the symbology type identifier must be turned-on thereby reducing the number of data characters that will fit into the buffer. q The application program can NOT recognize whether the data came from the scanner or the keyboard. q The functions gets() and scanf() are NOT recommended for removing keys since both require carriage returns. q The functions gets() and scanf() are incompatible with the Apex PDT Bar Code Driver utility program. Use of the buffered mode of operation (application supplied external buffer) is recommended, since this non-wedge mode provides much finer control and reporting of the decoded symbol information. Additional BCDRIVER Resources Additional Bar Code Driver programming resources are available to the Apex PDT developer through the use of the Apex Programming Resource (APR). Refer to the Apex Programming Resource section of this manual for detailed information.
COAM30002
Rev. 2.00
8/13/02
6-23
Page 96
Apex PDT Technical Reference Manual
6 Utility Programs
References Undocumented DOS, Schulman, A.; et. al.; Addison-Wesley 1990; ISBN #0-201-57064-5 MS-DOS System Programming, Burki, D., Ward, R.; R&D Publications 3 rd ed. 1997; ISBN #0-13-207382-X PC Interrupts, Brown, R., Kyle, J.; Addison-Wesley 1991, ISBN #0-201-57797-6
6-24
COAM30002
Rev. 2.00
8/13/02
Page 97
Apex PDT Technical Reference Manual
6 Utility Programs
Infrared Communications Utility [ir.com] The [ir.com] program is loaded in the Apex PDT boot drive at the factory. This utility program is used to enable or disable the Apex PDT Infrared (IR) port, thereby enabling or disabling the Apex PDT’s capability to perform infrared communications. q q
To enable the Infrared port, type “IR ON” at the DOS prompt and press the <ENT> key. To disable the Infrared port, type “IR OFF” at the DOS prompt and press the <ENT> key.
The following characteristics apply to the [ir.com] utility program: q q q
The state of the RS-232 serial port is always the opposite of the IR port (enabling the IR port disables the RS-232 serial port). The “IR ON” command must be invoked upon every boot-up of the Apex PDT for the port to be enabled since the default value is disabled. From the factory, the “IR ON” command is included as a line in the [autoexec.bat] (see the Operating System section. The present state of the IR port can be viewed on the display screen by typing “IR” at the DOS prompt and pressing <ENT>. The message received after pressing <ENT> will be one of the following: Infrared port is disabled Infrared port is enabled q
For maximum power savings, always disable the IR port when not in use (i.e. only enable IR port when communication is in progress, disable the port when communication is complete).
Syntax: IR [ON|OFF] ON - Enables infrared port, disables RS-232 port OFF - Disables infrared port, enables RS-232 port
COAM30002
Rev. 2.00
8/13/02
6-25
Page 98
Apex PDT Technical Reference Manual
6 Utility Programs
Remote Disk Utility [remdisk.exe] Note:
To utilize this program you must have [remserv.exe] loaded onto your PC. Refer to the Remote Server Utility [remserv.exe] in this section. The program [remdisk.exe] runs on the client system and creates a new drive letter for the client. [remdisk.exe] uses the next available system drive letter. For example, if the last assigned drive was D:, [remdisk.exe] creates drive E: This drive acts like any other drive, except that it requires the serial port. [remdisk.exe] can be loaded by the DEVICE= command in the [config.sys] file or can be entered at the DOS prompt C:\>. Syntax: REMDISK [/U] [/H] [/Bnnnn][+|-][/Tnnn] [/COMn] where n = the COM port number (i.e. 1, 2, etc.). Option /U
Description Unloads [remdisk.exe] from memory, thereby disabling the drive letter and freeing the memory occupied by [remdisk.exe]. This option can only be used when [remdisk.exe] is installed from the DOS command line. A remote disk installed via [config.sys] cannot be unloaded.
/H
Selects hardware handshaking for flow control.
/Bnnnn
Selects the baud rate for transmission. Available baud rates are 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. The default baud rate is 115200.
+/-
The plus sign (+) specifies packet-style transmission and is recommended for any baud rate over 19200. The default setting is to include + for packet transmission.
(-)
Use the minus sign (-) to specify polling operation under Windows® 95.
/Tnnn
Sets the time-out in the range of 2 to 3,640 seconds.
COMn
Selects the communication port. Available ports are 1 and 2. COM1 is the default port.
6-26
COAM30002
Rev. 2.00
8/13/02
Page 99
Apex PDT Technical Reference Manual
6 Utility Programs
Remote Server Utility [remserv.exe] The server system runs the program [remserv.exe] that can make a single drive on the server system available to the client. The available drive can be changed at any time by quitting the [remserv.exe] program and then running the program again with a new drive letter. Note:
While [remserv.exe] will run on a FAT32 system, the drive it makes available to the client cannot be FAT32. It is recommended to remotely serve a PC’s floppy disk drive since it is FAT16.
Syntax: REMSERV.EXE d: [/Bnnnn] [+|-] [/COMn] [/Tnnn] [/S] [/H] where d: represents the letter of the drive that the server makes available to the client. Option /Bnnnn
Description Selects the baud rate for transmission. Available baud rates are 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200. The default baud rate is 115200.
+/-
The plus sign (+) specifies packet-style transmission and is recommended for any baud rate over 19200. The default setting is to include + for packet transmission. Use the minus sign (-) to specify polling operation under Windows® 95.
COMn /Tnnn /S
Selects the communication port. Available COM ports are COM1 and COM2. COM1 is the default port. Sets the time-out period in the range of 2 to 3,640 seconds. Instructs [remserv.exe] to run without any display output.
/H
Selects hardware handshaking for flow control.
Examples: To select drive B: as the available server drive at 115200 baud, using packet transmission and the COM1 port; type: REMSERV B:, and press the <ENT> key. To select drive C: as the server disk at 9600 baud, without packetstyle transmission, using COM port 2, type: REMSERV C: /B9600 /COM2
The server program can be terminated at any time by using the Escape command (<FN> + <E> keys); however, the client can not access the server’s drive again until the [remserv.exe] program is run again.
COAM30002
Rev. 2.00
8/13/02
6-27
Page 100
Apex PDT Technical Reference Manual
6 Utility Programs
Display Font Utility [fontsize.exe] The [fontsize.exe] utility changes the Apex PDT display screen font size for easier readability. The [fontsize.exe] utility allows font changes that vary both the font height and font width displayed on the Apex PDT LCD screen. Available font options include 8 × 8, 8 × 16, 16 × 8, and 16 × 16. To accommodate the font size changes the program simultaneously changes the Apex PDT text window size to 30 × 20, 30 × 10, 15 × 20, and 15 × 10 respectively. Syntax: fontsize [t|T|w|W|r|b] Option t T w W r b none
Description font height = 8 font height = 16 font width = 8 font width = 16 resets font size to 8 × 8 forces a 16 × 16 font fontsize with no command line parameter returns help
Notes:
1. The r and b options are case insensitive. 2. For programming information refer to the Display, Font Height Adjustments, Font Display Illustrations sections of this manual, and Apex Specific ROM BIOS Extensions..
Example:
fontsize W t Sets the font to 16 × 8; text window goes to 15 × 20. fontsize w t (or fontsize r) Sets the font to 8 × 8; text window goes to 30 × 20. fontsize w T Sets the font to 8 × 16; text window goes to 30 × 10. fontsize T W (or fontsize b) Sets the font to 16 × 16; text window goes to 15 × 10.
6-28
COAM30002
Rev. 2.00
8/13/02