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 8 of 38

PEN*KEY 6100 Computer Programmer's Reference Guide: Section 2: Supporting DOS Applications, pages 61 to 68

Pages 61 to 68 of 328, from PEN*KEY 6100 Computer Programmer's Reference Guide

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.

Filed in the catalog under the Intermec 6110

Page 61

SECTION 2

Supporting DOS Applications

Configuration Required CONFIG.SYS Entry The following entry is REQUIRED in the CONFIG.SYS file, for DOS scanning: device=elanapm.exe device=nordospm.exe

Options 61PODSCN recognizes the following options: Switches -? or -H -A[n]

Usage The DOS scanner uses command line switches to drive the desired functions. For example: 61PODSCN –E –A2 –K16 where: ćE ćA2 ćK16 enables the scanner immediately and permanently. enables the aiming beam for a oneĆsecond interval. defines a keyboard key that can be pressed to initiate the scanner.

Example Scanner Application This example scanner testware enables the scanner, then displays the DOS keyĆ strokes until the return or newline character is encountered, where we exit. #include <dos.h> #include <stdio.h> #include <conio.h> void main (void) { int c; // // collect only one scan – 4500 compatible // geninterrupt(0x7a); // thread thru scan tsr // while ((c != ‘\n’) && (c != ‘\r’)) { while (kbhit()){ c = getch(); putchar(c); if (c == ‘\n’ || c == ‘\r’) break; } } _AH = 0x80;

}

PEN*KEY R 6100 Computer Programmer’s Reference Guide

2-9

2. DOS Applications

Description Either of these options results in a help screen that briefly describes the various options. Enable aiming beam for 1/2 second intervals (if supported). The n is optional (as noted by the [brackets]), and if used, it specifies the number of intervals desired. -E Enable scanner immediately, and permanently, not just when enabled via software API. -Knn Define a keyboard key to be used to initiate the scanner, where nn = scancode for the key. For example: use -K0f for TAB key. -On Power off delay, where n is the number of seconds from release of the trigger to the time power is removed from the scanner. -PLN Use the PLN API interface. -RESET Resets scanner configuration to the factory default on start-up. -SCANBIOS Use the SCANBIOS API interface.

Page 62

Supporting DOS Applications

SECTION 2

DOS NPCP Printing: PC4800.SYS Overview NPCP printing support under DOS consists of the DOS device driver PC4800.SYS, that allows DOS and PL/N applications written for the 6100 ComĆ puter to print to NORAND 4810, 4815, and 4820 Printers, using NPCP.

Driver Installation and Configuration Required CONFIG.SYS Entry PC4800.SYS is installed as a device driver in the CONFIG.SYS file. For example: device=pc4800.sys LPT1 1 /i1

If PC4800.SYS is not in the root directory, be sure to include the path. The format of the command line for PC4800.SYS is as follows: PC4800.SYS [<device name> [<port number> [/in ]]] " NOTE:

The order of the command line parameters is important (for example, specify a <device name> in order to specify a <port number>.

2. DOS Applications

The following table lists the meaning of each of the parameters: Parameter <device name> <port-number> /in

Meaning The name that opens the device. This name can be anything except PRN, and can be up to eight characters long. The default name is NP4800. The communications port number that the driver uses for output. Valid values are: 1 = COM1, 2 = COM2, etc. The default is COM1. This switch enables support for the interrupt 17h interface. This is needed for PL/N applications. `n' is a digit that specifies the LPT port that accesses the device. For exĆ ample, /I1 indicates that interrupt 17h calls for LPT1 are intended for this device drivĆ er. Note: The interface provided is not 100 percent PCĆcompatible. It is intended only to support PL/N applications. Non-PL/N applications should not use this switch.

Required AUTOEXEC.BAT Entry PC4800.SYS requires that the 4000API.EXE TSR is loaded to function correctly. Refer to the 4000API documentation in the Conversions and Interfaces section, for installation instructions.

Functionality and Usage Intermec Technologies Corporation supplies PL/N and C standard printer rouĆ tines that handle critical errors and the printing of text to NORAND printers. The following information is for those who might want to create their own print routines. PC4800.SYS must be opened before it can be used. For example, in the C proĆ gramming language, you can use fopen(). Use the correct open call for the lanĆ guage being used that allows writing to the device. Also, the open call used should return an error if the device does not exist. Some open calls will create a file if the device driver is not present. 2-10

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 63

SECTION 2

Supporting DOS Applications

To write to the device, use any appropriate output function that can be directed to the device (for example, in C programming language, you can use fprintf()). You should install a critical error handler that process errors from the printer. The printer driver returns only not ready" errors to DOS for the sake of compatibility with the standard PRINT program supplied with DOS. You can retrieve the extended error by bypassing DOS and calling the driver directly from the error handler. Ioctl calls (DOS Function AH = 44h, AL = 02h) are supported by the device drivĆ er (refer to a DOS technical reference manual for detailed information relating to this function). Calls require the handle number of the printer device in register BX, a data item with the following structure pointed to by DS:DX, and the numĆ ber of bytes to be read in register CX. struct ioargs { far *unsigned char ioctl_cmd; far *unsigned char ioctl_buf; };

The following commands may be pointed to by the ioctl_command field for execuĆ tion by the driver:

Data is returned to the buffer pointed to by the ioctl_buf, for the number of bytes specified in register CX when the ioctl call is made. The first byte of the reĆ turned data represents any error encountered during the call. If the call was successful, this byte is set to zero. If the call was unsuccessful, this byte repreĆ sents the extended error. The format of the rest of the data is described in the documentation for the printer being communicated with.

Notes The printer driver must be opened and closed for each report transaction with the printer if you want to take advantage of the lineĆloss detection features of NPCP. Applications should status (ioctl 3) the printer after the last line of a reĆ port or a series of reports are sent to the printer to ensure that all lines were printed successfully by the printer. The printer driver is multitasking. If the application needs to take full advanĆ tage of this feature, it must enable time slicing through the appropriate call to INT 15h (refer to the 4000API documentation). If timeĆslicing is not activated, the last line buffered by the driver is not sent to the printer until the device is closed or an ioctl status call to the printer is made. You should perform a ioctl status call before all closes to ensure that the driver print buffer is sent to the printer successfully, since DOS closes to character deĆ vices do not perform output flushes as part of the close operation. The driver flushes the buffer for you upon a close, but no error is returned if the flush is unĆ successful. PEN*KEY R 6100 Computer Programmer’s Reference Guide

2-11

2. DOS Applications

ONLINE = 2 STATUS = 3 GET DEVICE FEATURES = 4 SELFTEST = 5 RESET = 6 GET CURRENT CONFIGURATION =7 XTENDED ERROR = 255

Page 64

Supporting DOS Applications

SECTION 2

DOS IrDA Printing: PRDRV.SYS, IRDAPDRV.EXE Overview IrDA printing support under DOS consists of the device driver, PRDRV.SYS, plus IRDAPDRV.EXE, the actual driver handler, link management wrapper, and proĆ tocol stack. Together these two software components form the IrDA printer soluĆ tion, providing a standard DOS character driver to support IrDA printers. The IrDA printer driver supports the following DOS device driver entry points, compatible with the standard input and output libraries provided by DOS comĆ pilers, handling the request as indicated by the summarized processes details: open attempts discovery of an IrDA device, and if discovery is successful, establishes an IrLMP conĆ nection for a printer with the device discovered.

" NOTE: read write 2. DOS Applications ioctl

Only one open connection is allowed at this time. returns any data sent by the system. A return count of zero implies that no data is available. the written character is stored in a local coalescence buffer (with the IrLMP protocol header inĆ serted) until the frame size is reached, at which time the frame is transmitted to the printer. If the -n switch is used, each user write byte count is sent with the IrLMP protocol header inĆ serted without any attempt at local coalescence. this processing is specific to Intermec Technologies Corporation and is intended to support printĆ ing applications. A printing program may hook the DOS INT 24 critical error interrupt and then call the driver's ioctl directly using the information provided by INT 24. The driver reĆ sponds by setting an extended error code in the application's memory, using a pointer that was passed to it through the ioctl interface. The following ioctl call switch is currently implemented. IOCMD_STATUS : // 0x03 requestHeader.headerStatus = detailedErrorCode; break; IOCMD_ID : // 0x80 requestHeader.headerStatus = 0x0a; break; default : requestHeader.headerStatus = detailedErrorCode; break;

where detailedErrorCode is one of the following: 0

PREADY device driver is open –– a printer connection is established.

50

IRLAP_DISCONNECT_ERROR close failure –– a disconnect event state change failure occurred during the disconnect procedure processing.

51

DISCOVERY_FAILURE open failure –– no devices responded during the discovery procedure.

52

LINK_MANAGEMENT_CONNECT_FAILURE open failure –– a buffer flushing operation failed during the establishment of the link management session with a discovered device.

53

TX_BUFFER_DESC_GET_FAILURE write failure –– could not get a transmit buffer descriptor to send the data to the printer.

2-12

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 65

SECTION 2

Supporting DOS Applications

54

BUFFER_GET_FAILURE write failure –– could not get a transmit buffer to send the data to the printer.

55

BAD_CONNECTION_HANDLE open, write, or close failure –– a defective connection handle was encountered during the flushing of the driver’s coalescence buffer.

56

UNKNOWN_TRANSMIT_FAILURE open, write, or close failure –– the link access protocol failed for “unknown” reasons during an attempt to flush the driver’s coalescence buffer.

57

WRITE_WITH_PRINTER_NOT_READY write failure –– a write was attempted to the driver while the driver is in an error state.

58

I_QUEUE_FULL open, write, or close failure –– the driver could not get a queue for the transmission of an information frame.

59

CONNECT_FAILURE open failure –– after a successful discover of an IrDA device, a connection could not be established.

60

DRIVER_CLOSED write, read, ioctl, close failure –– an attempt was made to access the driver while the driver was in a closed state.

61

NO_RECURSION write, read, ioctl, close failure. er.

An attempt was made to recursively access the driv-

BAD_LINK_CONTROL_FRAME_SIZE open failure, link management failure –– the system did not receive the correct frame size for a connect confirmation by IrLMP after the IrLAP link session was established with the remote device.

63

LINK_MANAGEMENT_CONTROL_FRAME_EXPECTED open failure, link management failure –– the system did not receive an IrLMP control frame from the remote device after the IrLAP link session was established.

64

NOT_LINK_MANAGEMENT_CONNECT_CONFIRM open failure, link management failure –– the system did not receive an IrLMP connect confirm frame from the remote device after the IrLAP link session was established.

65

RECEIVE_FRAME_FAILURE open failure, link management failure –– the system did not receive the IrLMP connect confirm frame from the remote device that had a successful IrLAP link established.

66

READ_FAILURE_PRINTER_NOT_READY read failure –– an attempt was made to read from the character stream with the connection not in the ready state.

67

READ_FAILURE_PRINTER_IN_NDM read failure –– an attempt was made to read from the character stream with the connection in the normal disconnect mode.

68

READ_FAILURE_BAD_CONNECTION_HANDLE read failure –– an attempt was made to read from the core, and the connection handle used is no longer valid.

69

READ_FAILURE_UNKNOWN_STATUS read failure –– an attempt was made to read from the core that resulted in the core posting an unknown error.

70

WRITE_REQUEST_EXCEEDS_COALESCING_BUFFER write failure –– the user’s write buffer is too large to fit in the local coalescing buffer and is being rejected. Present the data to the driver with a buffer size of less than 128 bytes at this time.

close

2. DOS Applications

62

The coalescence buffer is sent to the printer and, after having verified that all data is sent to the printer, the IrLMP and IrLAP disconnects are performed (if there is a coalescence buffer being used, see the -n switch for details). PEN*KEY R 6100 Computer Programmer’s Reference Guide

2-13

Page 66

Supporting DOS Applications

SECTION 2

Installation and Configuration Make sure the following files are on the system: IRDAPDRV.EXE PRDRV.SYS

If your system was delivered with an application requiring these files, they should already be in flash. If not, they can most likely be found in the Tool Kit.

Required CONFIG.SYS Entry The following entries are required in the CONFIG.SYS file: device=d:\pathname\prdrv.sys install=d:\pathname\irdapdrv.exe –t6100 where d:\pathname is your specific path to the directory where the printer drivĆ ers exist; and where t6100 is the for the platform on which this driver is used.

Required AUTOEXEC.BAT Entry There are no required entries in the AUTOEXEC.BAT file for IRDAPDRV.EXE.

Usage Both PRDRV.SYS and IRDAPDRV.EXE have optional parameters. 2. DOS Applications

PRDRV.SYS

[fileNameToUse] where fileNameToUse is the name of the device to which this driver should reĆ spond. If this option is used, the f option (for IRDAPDRV.EXE) must be used, and the optional name selected must match this name string exactly. The deĆ fault is IRDALPT. IRDAPDRV ?

provides information about version, revision level, a command line example, a list of the availĆ able switches, and brief descriptions of each.

" NOTE:

bn dn fs n 2-14

[ –? –bn –dn –fs –n –rn –t6100 –x ]

Use only the switches shown here. This driver is a multi-platform program, providing features for all of the 6000 Series platforms. None of the other switches are intended for the 6100 Computer and could cause a malfunction, if used on this platform. REMOVES a baud rate from consideration for data transfer rate negotiated during connect. The (n) part of this parameter is one of 19200, 38400, 57600, or 115200. This switch is accumuĆ lative and can REMOVE any, or all, of the above baud rates from the default negotiables. When the two systems negotiate, the largest common value is selected and that baud rate is used for communication, after completion of the negotiation. specifies the disconnect time (in seconds) requested during negotiation. The (n) part of this paĆ rameter is one of 3, 8, 12, 16, 20, 25, 30, or 40. This switch is accumulative and can add any, or all, of the preceding disconnect times to the default of 3. The two systems negotiating select the largest common value. defines the file name to be used by the driver. This string must be supplied, and must match the driver name option used with PRDRV.SYS when it was loaded (if used). The default name for this driver is IRDALPT. designates NO coalescing buffer support for devices that send data back to escape sequence.

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 67

SECTION 2 rn ts x

Supporting DOS Applications specifies the number of discovery retries done at the DOS open command by the driver. For each (n) count, the user is allowed approximately 500 milliseconds to bring the system within range of the printer for data transfer discovery. The default is 2 retries. identifies the 6100 Computer as the IrDAĆequipped system, on which the driver is running. The required string is 6100. specifies that the driver should disable interrupts not in the open state. This implies that the core is not discoverable and connectable, and therefore cannot perform that role.

2. DOS Applications

PEN*KEY R 6100 Computer Programmer’s Reference Guide

2-15

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

Supporting DOS Applications SECTION 2 ad eS) Oo 7) > x], = © =4 re) =) 7

2-16 PEN*KEY® 6100 Computer Programmer’s Reference Guide