HP 82477A HP-IL LINK SOFTWARE HP-71 <--> Personal Computer Link OWNER'S MANUAL Copyright (C) Hewlett-Packard Company 1986 Edition 1.2 6/25/86 Contents Introduction to the HP-IL LINK Software .............................. ( 1 ) Installing the HP-IL Interface ....................................... ( 2 ) Connecting HP-IL Devices ............................................. ( 3 ) Getting Started with HP-IL LINK ...................................... ( 4 ) Moving files between the PC and the HP-71 ............................ ( 5 ) Technical Information and Advanced Applications ...................... ( 6 ) Using the HP-IL LINK Software with the HP-75 and HP-41 ............... ( 7 ) INTRODUCTION TO THE HP-IL LINK SOFTWARE Congratulations! You have purchased a quality Hewlett-Packard Software Product that enables you to transfer information between your HP-71 and your Personal Computer via HP-IL. HP-IL LINK enables you to use the PC as a full-sized keyboard and display for the HP-71 or HP-75. It also enables you to upload files from the HP-41 and HP-75. FEATURES OF THE HP-IL LINK SOFTWARE * File uploading and downloading between the HP-71 and your PC. * Automatic translation between HP-71 TEXT files and MS-DOS TEXT files. * Option to convert HP-71 DATA files to MS-DOS TEXT files. * Use of PC disk drive for the HP-71. * Automatic file transfers through your own HP-71 programs. * Use of full-size PC keyboard for the HP-71, and HP-75 with I/O ROM. * Use of PC display and printer for the HP-41, HP-71, and HP-75. * File uploading from the HP-75 or HP-41 (with HP-IL Interface) to your PC. * Owner's manual is on the disk. SYSTEM CONFIGURATIONS The following equipment is necessary to run the HP-IL LINK software: HP-71 with HP 82401A HP-IL Interface or HP-75 with 00075-15001 I/O ROM or HP-41 with HP 82160A HP-IL Interface AND HP Vectra with HP 82973A HP-IL Interface or IBM PC,PC/XT,PC/AT (and compatibles) with HP 82973A HP-IL Interface or HP 150 with HP 45643A Extended I/O Accessory or HP Portable/Portable PLUS The software disk contains the programs and information needed to operate HP-IL LINK. To protect your investment in this product, you should make a backup copy of the disk as soon as possible and store the original disk in a safe place. Use the copy of the software disk for all your operations. To make a copy of your disk, follow the instructions in the owner's documentation for your computer on how to care for and copy disks. Refer to your MS-DOS documentation for information about disk care. The HP-IL LINK software disk contains several files. The only file which MUST be present to run HP-IL LINK is HPILLINK.EXE. File Name When needed Description _____________________________________________________________________ HPILLINK.EXE RUN only Program which makes the PC an HP-IL device. BOOT.BAS *RUN only HP-71 BASIC: set up the HP-71 for HP-IL LINK. KEYSET.BAS *RUN only HP-71 BASIC: map escape sequences, set up KEYBOARD IS and DISPLAY IS. KEYBOARD.LEX *RUN only HP-71 LEX: contains KEYBOARD IS (needed if FORTH/ Assembler ROM, HP 82441A is not present). ????????.IN$ P.A.M. only P.A.M. install information for the HP 150. HELP.BAT &HELP only Enables you to read this manual on the display. PILOT.EXE &HELP only Program which formats and displays HELP screens. ????????.PI &HELP only Data for PILOT.EXE; contains HELP screens. NOTES: &) Files marked & are needed only if you are using the on-line manual. *) These files are included so that you may customize them as needed. The HPILLINK.EXE program contains a copy of these files which it uses when the requested file is not available in the current directory. For a more detailed description of BOOT.BAS and KEYSET.BAS, see the "GETTING STARTED WITH HP-IL LINK" chapter, subsection "Information about BOOT.BAS and KEYSET.BAS". INSTALLING THE HP-IL INTERFACE Installing the Interface in the PC ................................... ( 1 ) *** The following apply only to the HP 82973A HP-IL Interface *** Selecting an Address ................................................. ( 2 ) Specifying an Address for HP-IL LINK ................................. ( 3 ) INSTALLING THE INTERFACE IN THE PC To install an HP 45643A Extended I/O Accessory in your HP 150, follow the instructions in the Owner's Guide. To install an HP 82973A HP-IL Interface in your PC, follow the instructions in your PC computer owner's manual (if these instructions are not available, consult your HP dealer for information about installing the interface). You do not need to set any system switches on the PC. CAUTION! The interface card is shipped in a wrapping that protects it from electrostatic discharge (ESD). A common example of ESD occurs when you walk across a carpet and get an electrical shock from touching a doorknob. The shock you feel is a discharge. Even if you don't feel a shock, a static discharge can occur. To prevent ESD from damaging the interface card, keep the card in its protective wrapping until you are ready to install it. When you are ready to install the card, touch a grounded metal object to remove any static charge that you might have accumulated. After grounding yourself, you can remove the card from the wrapping and remove the protective cover from the edge connector. Always handle the interface card by its edges! NOTE: If you are using the HP Portable, HP Portable PLUS, or the HP 150, the remainder of this section does not apply to you. SELECTING AN ADDRESS (HP 82973A ONLY) The HP 82973A HP-IL Interface has a memory address of 1700 (hexadecimal) preset at the factory. In most cases, you will not need to change this address. If another card has this address, change the address setting on either the HP-IL interface or the other card. You may skip the remainder of this section if you do not need to change the address of the interface. To change the address of the HP-IL interface, first determine a new, unique address, such as 1600 (hexadecimal). Then: 1. Physically set the address switches on the HP-IL interface. (The procedure is described in the HP 82973A manual). 2. Tell HP-IL LINK about the changed address each time you run HP-IL LINK (see the next screen for more information about specifying an address for HP-IL LINK). SPECIFYING AN ADDRESS FOR HP-IL LINK (HP 82973A ONLY) After altering the address on the HP-IL interface, you need to specify the address each time you use HP-IL LINK. The address is specified on the command line with the /Annnn option, where nnnn is the four-digit hexa- decimal address of the interface. For example, to set the address to 1600, the command line becomes: HPILLINK /A1600 After changing the address on the HP-IL interface and installing it, the interface is ready to use (always remember to specify the new address with the /A option). If you cannot determine a new address for the interface or, after consulting your PC's manuals, you are unable to properly install the interface, consult your HP dealer. CONNECTING HP-IL DEVICES The Hewlett-Packard Interface Loop (HP-IL) consists of an HP-IL controller (a computer), and one or more devices (such as disk drives, printers, and other computers) connected in a series. All devices must be connected and switched on for the loop to operate. You can have up to 30 devices in a loop. +----------+ IN <----------- OUT +----------+ | Device <------------------------------------------------< Device | | | | | | 2 >--------------------+ +----------------------> 1 | +----------+ OUT -----> IN | | OUT -----> IN +----------+ +-------v----^--------+ | controller | | | +---------------------+ Peripheral devices are connected to your computer (and to each other) using HP-IL cables. One HP-IL cable is shipped with the interface card, and one is shipped with each peripheral device. See the HP-71 HP-IL Interface Owner's Manual, section 1 ("Getting Started") for more information about connecting HP-IL devices and about the HP-IL system in general. If you wish to space peripherals farther from the computer than permitted by the cables, connect additional HP-IL cables. The maximum distance allowed between any two devices or a device and the computer is 10 meters (33 feet) with standard cables. Standard HP-IL cables are: HP 82167A .5 meter. HP 82167B 1 meter. HP 82167D 5 meters. GETTING STARTED WITH HP-IL LINK Introduction ......................................................... ( 1 ) Installing HP-IL LINK with the Personal Application Manager (P.A.M.) . ( 2 ) Running HP-IL LINK on the PC ......................................... ( 3 ) Using the HP-71 for the First Time with HP-IL LINK ................... ( 4 ) Using the PC as a Keyboard and Display Device for the HP-71 .......... ( 5 ) Using the PC's Printer ............................................... ( 6 ) Executing MS-DOS commands from HP-IL LINK ............................ ( 7 ) Information about BOOT.BAS and KEYSET.BAS ............................ ( 8 ) INTRODUCTION The HP-IL LINK program turns an HP-IL equipped PC into an HP-IL device controlled by an HP-71 computer. Example Configuration +----------------+ | HP-71B | | (Controller) | +------------+ +----v------^----+ +------------+ | HP 9114 | <------ OUT | | IN <------ | | | Disk Drive <+----------------+ +----------------+< PC | | >+----------------------------------------+> | | (Device 1) | -------> | (Device 2) | +------------+ +------------+ INSTALLING HP-IL LINK WITH HP'S PERSONAL APPLICATION MANAGER (P.A.M.) For P.A.M. on the HP 150, follow the directions in "Installing Applications and Using SET UP P.A.M." chapter of "Using Your HP Touchscreen Personal Computer". For P.A.M. on the Portable or Portable PLUS, follow the directions in "HP 110 Portable Computer Owner's Documentation", Chapter 2 (P.A.M.), "Installing Application Programs in P.A.M". For PAM on the HP Vectra, follow the directions "Add Application Information to PAM" in "Using Vectra", chapter 9 ("Using Vectra's PAM"). RUNNING HP-IL LINK ON THE PC To run HP-IL LINK, type HPILLINK on the PC. HP-IL LINK displays the following messages (the letters which follow "PC" may vary for different machines): HP-IL LINK (on PC150) Ver. 1.1 Copyright (c) Hewlett-Packard 1986 ALL RIGHTS RESERVED Press the F4 key for help. Press the F8 key to exit. HP-IL LINK displays any messages for the user on the top line of the display. To exit from HP-IL LINK, press the "Exit" function key (F8). If the loop is not powered down, HP-IL LINK asks for confirmation before returning to the operating system. USING THE HP-71 FOR THE FIRST TIME WITH HP-IL LINK NOTE: The PC must not use any HP-IL devices on the same loop as the HP-71 while HPILLINK is running. This includes HP-IL disk drives. If you are using an HP-IL disk drive, make sure that your PC's current directory is NOT on the HP-IL disk! If the PC is on the second loop of an HP 82402A Dual HP-IL Adapter, read "Using HP-IL LINK with more than one HP-IL Interface" in "TECHNICAL INFORMATION AND ADVANCED APPLICATIONS" before continuing with this section. NOTE: The BOOT program should be run only once on the HP-71. To use HP-IL LINK at a later time, connect the HP-71 to the PC via HP-IL, run HPILLINK on the PC and type "RUN KEYSET [ENDLINE]" on the HP-71. After running HP-IL LINK on the PC and connecting the HP-71 to the PC with HP-IL, press the "Setup HP-71" function key (F3), and type on the HP-71 "RESET HPIL @ RUN BOOT:PC [ENDLINE]" Several messages should appear momentarily on the PC's display as BOOT sets up the HP-71 for use with HP-IL LINK. When BOOT is finished, the HP-71 prompt should appear on the PC with a blinking cursor following it. If the prompt does not appear after several seconds, see the "TROUBLESHOOTING" section. The BOOT program downloads KEYSET.BAS from the PC. KEYSET sets up the HP-71 for use with HP-IL LINK. To disconnect the HP-71 from the PC, type "STARTUP '' @ BYE [ENDLINE]" on the HP-71 and press the "Exit" function key (F8) on the PC. For a summary of HP-71 editing keys available on the PC, press the "Help" function key (F4) on the PC. USING THE PC AS A KEYBOARD AND DISPLAY DEVICE FOR THE HP-71 The "Setup HP-71" function key (F3) downloads and runs "KEYSET.BAS" which sets up the HP-71 KEYBOARD IS and DISPLAY IS for use with HP-IL LINK. The PC's keyboard and display are extensions of the HP-71 keyboard and display. Keystrokes typed on the PC are sent to the HP-71, and characters sent to the HP-71 display appear on the PC screen. Type "BYE" on the HP-71 to power down the loop before exiting HP-IL LINK. To resume communications between the HP-71 and the PC at a later time, run HP-IL LINK, connect HP-IL, and type "RUN KEYSET [ENDLINE]" on the HP-71. Once the PC is talking to the HP-71 with the HP-IL LINK software, you can type HP-71 commands on the PC keyboard and see the results on the PC display. Keys are available on the PC to insert and delete characters, move the HP-71 cursor, use the HP-71 command stack, and other useful functions. For a summary of editing keys available, press the "Help" function key (F4) on the PC. The KEYSET program controls the mapping of PC keys to HP-71 keys. You can change KEYSET to match your preferences of PC keys. See "TECHNICAL INFORMATION AND ADVANCED APPLICATIONS", subsection "Escape Sequences" for a list of the escape sequences sent by the PC. NOTE: The disk drive containing the software must NOT be an HP-IL disk drive on the same loop as the HP-71. The HP-IL LINK program CANNOT access any HP-IL peripheral which is on the same loop as the HP-71. FUNCTION KEY INDEX Function key Action ------------ ------------------------ F1 Upload a file from the HP-71 to the PC F2 Download a file from the PC to the HP-71 F3 Set up the HP-71 for HP-IL LINK F4 Display a summary of HP-IL LINK commands F5 Toggle the PC's printer on/off F6 Do an MS-DOS "DIR" command F7 Enter MS-DOS command mode F8 Exit from HP-IL LINK (return to operating system) USING THE PC'S PRINTER NOTE: PRINT is not available for HP-IL printers. To send output to an HP-IL printer, instruct the HP-71 to send the data directly to the printer. See the HP-71 HP-IL Interface Owner's Manual, Section 2 ("Printer and Display Operations"). When you select the "Printer Toggle" function key (F5), all output sent to the PC by the HP-71 is automatically sent to the PRN: device of the PC. To exit PRINT mode, press the "Printer Toggle" key again. A message is displayed on the PC which tells you whether you have enabled or disabled the printer. HP-IL LINK starts with the printer disabled. When sending information to the PC's printer from the HP-71, HP-IL LINK sends all data received to the PRN: device. When using a printer, you should know how it responds to special characters such as linefeed (LF) and carriage return (CR). Otherwise, you may get unexpected results. Many printers respond to special codes called "escape sequences". Escape sequences are used to select different settings on a printer and control how information is printed. The owner's documentation for your printer should describe how your printer responds to escape sequences. EXECUTING MS-DOS COMMANDS FROM HP-IL LINK HP-IL LINK provides a way to temporarily access MS-DOS commands without leaving HP-IL LINK. For temporary access to MS-DOS, press the "DOS Commands" function key (F7). To return to HP-IL LINK from MS-DOS, type "exit". Changing the default disk drive while in MS-DOS changes the default for HP-IL LINK as well. To list an MS-DOS directory, press the "MSDOS DIR" function key (F6). HP-IL LINK prompts for the directory name: "Which directory? ". Type the name of the MS-DOS directory, then press RETURN. The default directory is the current directory. INFORMATION ABOUT BOOT.BAS AND KEYSET.BAS BOOT.BAS is a transient program downloaded to the HP-71 by HP-IL LINK when the "Setup HP-71" function key (F3) is pressed. KEYSET.BAS is automatically downloaded to the HP-71 by BOOT if no file named "KEYSET" exists in the HP-71. BOOT checks if a KEYBOARD file is present in the HP-71. If it is not present, BOOT tries to place the KEYBOARD file in a port with a larger number than that of the HP-IL ROM (1 through 5) because of HP-71 system considerations. BOOT looks for space in an Independent RAM (IRAM) for the KEYBOARD file. If an IRAM is found which is too small for KEYBOARD, a message is displayed and BOOT quits. Make room in the IRAM, then type "RUN BOOT [ENDLINE]". For more information about IRAMs, see the HP-71 Owner's Manual, section 6 ("File Operations"). Once BOOT has ensured KEYBOARD and KEYSET are present in the HP-71, it executes a "CHAIN KEYSET" command. The CHAIN command purges BOOT, then runs KEYSET. The BOOT program is not normally present in the HP-71 while HP-IL LINK is active, and is needed ONLY to set up the HP-71 for the first use with HP-IL LINK. Subsequent uses of the HP-71 can resume communications with HP-IL LINK by typing "RUN KEYSET [ENDLINE]". KEYSET.BAS sets up the HP-71 to send displayed data to the PC and read PC keys as HP-71 keystrokes. It also maps PC escape sequences into HP-71 keys. The ESCAPE command maps a two-character escape sequence into an HP-71 key, specified by key number. The statement 'ESCAPE "A",50' means a received (ESC) A should be turned into HP-71 key #50 (the up-arrow key). For more information about the ESCAPE command, see the HP-71 FORTH/Assembler ROM Owner's Manual. For more information about HP-71 key numbering, see the HP-71 Owner's Manual, section 7 ("Customizing the HP-71"). BOOT sets these HP-71 global conditions: DELAY 0,INF BEEP ON USER ON REAL I,A Defines keys "fO", "fP" KEYSET sets these HP-71 global conditions: DELAY 0,INF USER ON DISPLAY IS :PC KEYBOARD IS :PC RESET ESCAPE, map PC keys into HP-71 keys Defines keys "fO", "fP" Sets STARTUP string to "call keyset" Both BOOT and KEYSET can be modified to use keys other than "fO" and "fP". See the HP-71 Owner's Manual, section 7 ("Customizing the HP-71") for more details. MOVING FILES BETWEEN THE PC AND THE HP-71 Introduction ......................................................... ( 1 ) Uploading Files from the HP-71 to the PC ............................. ( 2 ) Downloading Files from the PC to the HP-71 ........................... ( 3 ) Format of Uploaded Files on the PC ................................... ( 4 ) Initiating File Uploads and Downloads from the HP-71 ................. ( 5 ) INTRODUCTION TO FILE TRANSFER File transfer between the PC and the HP-71 is initiated by pressing function key F1 for UPLOAD (from the HP-71), F2 for DOWNLOAD (to the HP-71). HP-IL LINK prompts for the name of the file. For UPLOAD, enter the HP-71 name; for DOWNLOAD, enter the PC file name. HP-IL LINK stores HP-71 files on the PC's disk as either text or binary data, depending on the file type. The name of an uploaded file is normally the HP-71 file name with an extension of the first 3 characters of the file type. For example, uploading an HP-71 BASIC program named "DEMO" produces a file on the PC named "DEMO.BAS". Because some extensions may conflict with extensions used by other applications on the PC, it is recommended that uploaded HP-71 files be placed in their own directory. CAUTION! An upload or download can be interrupted by pressing any key on the PC. Interrupted uploads may leave partial files on the PC's disk, and interrupted downloads may cause the HP-71 to hang up. After interrupting an upload, be sure to purge any partial file from the PC's disk. To recover an HP-71 which is hung up, press the [ATTN] key several times (until the cursor blinks normally), then type "RUN KEYSET [ENDLINE]". UPLOADING FILES FROM THE HP-71 TO THE PC To upload a file from the HP-71 to the PC, press the "Upload" function key (F1). HP-IL LINK prompts "Upload which file to PC? ". Type the HP-71 file name. HP-IL LINK sends the appropriate keystrokes to the HP-71, and the HP-71 copies the file to the PC. If the requested file does not exist or cannot be copied, an error message from the HP-71 is displayed on the PC, and the upload is aborted. HP-71 TEXT files are converted into MS-DOS TEXT files before they are stored on the PC. HP-71 DATA files are converted into MS-DOS TEXT only if HP-IL LINK was run with the convert data option (/C). The MS-DOS TEXT resulting from the convert data option is the same as the data that would be seen by the HP-71 reading data sequentially with the READ # command. See the HP-71 Owner's Manual, section 14 ("Storing and Retrieving Data") for more information. DOWNLOADING FILES FROM THE PC TO THE HP-71 To download a file from the PC to the HP-71, press the "Download" function key (F2). HP-IL LINK prompts "Download which file to HP-71? ". Type the PC's file name. HP-IL LINK sends the appropriate keystrokes to the HP-71, and the HP-71 copies the file from the PC. If the file is an HP-71 file, HP-IL LINK sends a binary image of the file. If the file is not an HP-71 file, HP-IL LINK converts it into an HP-71 TEXT file. If the file specified does not exist or cannot be copied, HP-IL LINK displays an error message, and the download is aborted. FORMAT OF UPLOADED FILES ON THE PC Files which are uploaded from the HP-71 are stored as either MS-DOS TEXT or binary data. HP-71 TEXT files are always converted to MS-DOS TEXT files. HP-71 DATA files are converted to MS-DOS TEXT files ONLY if HP-IL LINK is run with the /C option. If the /C option is not specified, DATA files are stored as binary data. All other HP-71 file types are stored as binary data. For files stored as binary data, the first 32 bytes are a directory entry (see the HP-71 HP-IL Interface Owner's Manual, Appendix D, for a description of a directory entry). The data for the file follows the directory entry. The size of the data portion is the "File Length" from the directory times 256 bytes. The following HP-71 file types are recognized by HP-IL LINK (no support beyond upload/download capability is implied by this list). For download, any other MS-DOS extension is assumed to contain only text. Type name Type value MS-DOS extension --------- ---------- ---------------- APPT E220 (hex) .APP BASIC E214 (hex) .BAS BIN E204 (hex) .BIN DATA E0F0 (hex) .DAT (.TEX if uploaded with /C option) FORTH E218 (hex) .FOR KEY E20C (hex) .KEY LEX E208 (hex) .LEX ROM E21C (hex) .ROM SDATA E0D0 (hex) .SDA TEXT 1 .TEX INITIATING FILE UPLOADS AND DOWNLOADS FROM THE HP-71 The HP-71 can initiate uploads and downloads with HP-IL Device Dependent Commands. Uploads can also be initiated with REMOTE mode on HP-IL. See "TECHNICAL INFORMATION AND ADVANCED INFORMATION", subsection "Response to Device Dependent Commands (DDT and DDL)" for more detailed information. NOTE: Uploads and downloads initiated by the HP-71 are designed for use within specialized HP-71 applications. These examples could be done more easily with the function keys on the PC, but are included to show Device Dependent Command and REMOTE mode usage. UPLOADING A FILE TO THE PC: The HP-71 commands used to initiate an upload of the BASIC program "DEMO" are: >P1 = DEVADDR("PC") >SEND UNL LISTEN P1 MTA DDL 0 DATA "DEMO.BAS",10 @ COPY DEMO TO :PC The DDL 0 tells HP-IL LINK to read a file name and upload that file from the HP-71. The COPY command uploads the file to the PC. See the HP-71 HP-IL Interface Owner's Manual for a more complete description of the SEND command. If the file "DEMO" does not exist on the HP-71, the HP-71 error message "File Not Found" is displayed, and the upload is aborted. DOWNLOADING A FILE FROM THE PC: The HP-71 commands used to initiate a download of the BASIC program "DEMO.BAS" from the PC are: >P1 = DEVADDR("PC") >SEND UNL TALK P1 DDT 0 LISTEN P1 MTA DATA "DEMO.BAS" EOL @ COPY DEMO:PC The DDT 0 tells HP-IL LINK to read a file name and download that file to the HP-71. The COPY command downloads the file to the HP-71. If "DEMO.BAS" does not exist on the PC, it sends a file named "NOTFOUND". If the file name doesn't match, the HP-71 error message "File Not Found" is displayed on the PC. Several files can be uploaded at once by enabling HP-IL REMOTE mode and COPYing the files to the PC. Here is a sample HP-71 program to upload several files. The DATA statement contains the names of the files to be uploaded. 10 DIM F$[20] 20 DATA file1, file2, file3, file4, "" 30 REMOTE 40 READ F$ @ IF F$<>"" THEN COPY F$ TO :PC @ GOTO 30 50 LOCAL 60 END NOTE: When HP-IL REMOTE mode is active, data sent to the PC is interpreted as a file to be uploaded, even if the data was intended for the display. This often causes a "ERROR: Transfer Aborted" message. Note that the HP-71 HP-IL REMOTE command enables all HP-IL devices on HP-IL to enter REMOTE mode. See the HP-71 HP-IL Interface Owner's Manual for more information about REMOTE mode. TECHNICAL INFORMATION AND ADVANCED APPLICATIONS Introduction ......................................................... ( 1 ) Using HP-IL LINK with the 82402A Dual HP-IL Adapter .................. ( 2 ) Using HP-IL LINK with more than one HP-IL Interface (HP 82973A only) . ( 3 ) Command Line Options ................................................. ( 4 ) Escape Sequences ..................................................... ( 5 ) Response to Device Dependent Commands (DDT and DDL) .................. ( 6 ) Serial Poll Response ................................................. ( 7 ) Examples ............................................................. ( 8 ) INTRODUCTION This section contains technical information not available elsewhere in this manual. This information is not needed for most applications, but may be useful for special applications which require more detail about HP-IL LINK. This section also includes information about HP-IL LINK's response to HP-IL messages. Users familiar with HP-IL protocol may want to refer to appendix A in the MANUAL.TXT file for individual message responses. HARDWARE DEPENDENCIES HP-IL LINK sets certain default conditions on different machines: HP Vectra, IBM PC compatible: Display mode is set to 80 column mode. The mode is not changed if the current mode is 3 or 7. Any other mode is set to mode 2. HP Portable, HP Portable PLUS: Function keys are set to default values. Function keys are turned off when HP-IL LINK exits. HP 150: Function keys are set to default values. The terminal configuration is set to default values. Function keys are turned on with default labels when HP-IL LINK exits. USING HP-IL LINK WITH THE 82402A DUAL HP-IL ADAPTER HP-IL LINK can be used with the second loop of a HP 82402A Dual HP-IL Adapter with only minor changes. The BOOT.BAS and KEYSET.BAS programs must be modified to use the second loop, and the HP-IL LINK software must be informed that it is on the second loop. Changes to BOOT.BAS and KEYSET.BAS: To change BOOT.BAS, instead of "RESET HPIL @ RUN BOOT:PC [ENDLINE]", type "RESET HPIL 2 @ COPY BOOT:PC:2 [ENDLINE]". When you have made the changes on the next screen, type "COPY BOOT TO BOOT2 @ RUN BOOT2 [ENDLINE]", then make the changes to KEYSET and type "RUN KEYSET [ENDLINE]". You may want to upload the modified files to the PC for future use. KEYSET.BAS needs changes on three lines (corrected lines shown): 10 RESET HPIL 2 @ RESTORE IO 2 20 DISPLAY IS :PC:2 30 KEYBOARD IS :PC:2 BOOT.BAS needs changes on six lines (changes to the lines shown): 70 A=DEVADDR("PC:2") 80 SEND 2; UNL {... remainder of line unchanged} 90 COPY KEYBOARD:PC:2 TO :PORT(I) 120 A=DEVADDR("PC:2") 130 SEND 2; UNL {... remainder of line unchanged} 140 CHAIN KEYSET:PC:2 HP-IL LINK initiates uploads/downloads with the HP-71 by sending keystrokes to the HP-71 to COPY a file to/from the PC. The COPY statement must include the loop number to send data to/receive data from the second loop. By default, HP-IL LINK assumes the loop to use is loop 1. The loop number used by HP-IL LINK can be changed by either a command line line option (/2 for loop 2) or a Device Dependent Listener 4 command. USING HP-IL LINK WITH MORE THAN ONE HP-IL INTERFACE (HP 82973A ONLY) HP-IL peripherals are normally not available to the PC while HP-IL LINK is active. It is possible to use them on the HP Vectra or IBM PC compatible while using HP-IL LINK by adding a second HP 82973A HP-IL Interface card. CAUTION! The two cards MUST be at different addresses. Failure to observe this restriction may damage the HP-IL Interface cards or the PC. See the HP 82973A HP-IL Interface card's manual for instructions on setting the address of the second card. COMMAND LINE OPTIONS These options are supported by HP-IL LINK (the option letter can be either upper or lower case): /AXXXX tells HP-IL LINK that the address of the HP-IL card is XXXX (hex). /C enables conversion of DATA files into MS-DOS TEXT when uploading (default is not to convert HP-71 DATA). /FXXXXXXXX enables logging to file XXXXXXXX. /1 sets the loop number to 1 (default). /2 sets the loop number to 2. ESCAPE SEQUENCES HP-IL LINK sends two-character escape sequences of the form (ESC) (char) to indicate that a special key (e.g. Insert line) was pressed. Each key has an associated escape sequence. The HP-71 KEYSET program uses the ESCAPE command to map some escape sequences to HP-71 keys. For more information about the ESCAPE command, see the FORTH/Assembler ROM Owner's Manual. The HP-71 ignores unrecognized escape sequences, although they are sent to the display device (usually HP-IL LINK). There is a list of escape sequences recognized by the HP-71 in the HP-71 Owner's Manual, section 13 ("Printer and Display Formatting"). KEYSET.BAS normally maps the PC's keys into reasonable HP-71 keys. The following table documents the mapping of PC keys to escape sequences. The second table lists escape sequences recognized by HP-IL LINK for use by applications which send data to the display using the HP-71 PRINT or OUTPUT commands. HP-71 DISPLAY IS converts ESC K to ESC J, and ESC N to ESC Q ESC N. Notes: 1. The Portable and Portable PLUS do not implement cursor movement which wraps around the edges of the screen. 2. Only the HP 150 implements insert and delete character with wrap. Others respond to these escape sequences with insert and delete char. HP-IL LINK converts these PC keystrokes into two-character escape sequences: Common to all machines: Key Escape Seq Key Escape Seq Key Escape Seq --- ---------- --- ---------- --- ---------- Back (ESC)(BS) Tab (ESC) I Shift-Tab (ESC) i Up (ESC) A Down (ESC) B Left (ESC) D Right (ESC) C Unique to HP 150, Portable, Portable PLUS: InsertChar (ESC) Q DeleteChar (ESC) P Select (ESC) S InsertLine (ESC) L DeleteLine (ESC) K ClearLine (ESC) K Prev (ESC) V Next (ESC) U ClearDisp (ESC) J Home (ESC) h Shift-Home (ESC) F Unique to HP Vectra, IBM PC and compatibles: Ins (ESC) Q Del (ESC) P F9 (ESC) S Home (ESC) V End (ESC) U Ctrl-right (ESC) K PgUp (ESC) h PgDn (ESC) F F10 (ESC) T HP-IL LINK recognizes these escape sequences; others are ignored: Escape Sequence Action --------------- ------ (ESC) A Move cursor up (to bottom line if already at top line). (ESC) B Move cursor down (to top line if already at bottom line). (ESC) C Move cursor right (to start of next line if at end of line). (ESC) D Move cursor left (to end of previous line if at left side). (ESC) E Move cursor to top left, clear screen. (ESC) H or h Move cursor to top left. (ESC) J Clear from cursor to bottom of screen. (ESC) K Clear from cursor to end of line. (ESC) L Insert a line above the cursor, move cursor to left side. (ESC) M Delete the line containing the cursor, cursor to left side. (ESC) N Enable insert character mode with wrap to next line. (ESC) O Delete one character at the cursor with wrap from next line. (ESC) P Delete one character at the cursor. (ESC) Q Show insert cursor (does not affect insert character mode). (ESC) R Exit insert character mode, show normal cursor. (ESC) < Turn cursor off. (ESC) > Turn cursor on. RESPONSE TO DEVICE DEPENDENT COMMANDS (DDT and DDL) HP-IL LINK supports one Device Dependent Talker Command: DDT 0: (followed by MS-DOS filename) HP-IL initiated download. HP-IL LINK supports these Device Dependent Listener Commands: DDL 0: (followed by MS-DOS filename) HP-IL initiated upload. DDL 1: Enable the PC's printer (same as F5 toggle). DDL 2: Disable the PC's printer (same as F5 toggle). DDL 3: (followed by MS-DOS command string) Remote MS-DOS command execute. DDL 4: (followed by loop number) Change loop number. DDL 5: (followed by a filename) Enable data logging (all data sent to HP-IL LINK is copied into a file). Data logging is disabled by a device clear, file error, or DDL 5 with null filename. NOTE: If the parameter string is more than 80 characters long, including the terminating line feed, HP-IL LINK aborts the Device Dependent Command. DDT 0 and DDL 0 are described in "MOVING FILES BETWEEN THE PC AND THE HP-71", subsection "Initiating File Uploads and Downloads From the HP-71". DDL 1 and DDL 2 enable and disable the printer, as described under the "Printer Toggle" function key (F5) in "GETTING STARTED WITH HP-IL LINK", subsection "Using the PC's Printer". DDL 3 executes the MS-DOS command string which follows it. Note that the command specified MUST be in either a .EXE or a .COM file, and the extension MUST be specified in the MS-DOS command string. Parameters for the command must be separated from the command with a single space. CAUTION! DDL 3 is for experienced PC users. Incorrect usage may result in unpredictable operation. HP-IL operation is suspended while the MS-DOS command is executing. See the HP-71 STANDBY command in the HP-71 HP-IL Interface Owner's Manual. If the string "COMSPEC" is given as the command, HP-IL LINK will use the value of the COMSPEC environment variable as the command. For example, if the value of COMSPEC on a PC is C:\COMMAND.COM, the HP-71 statement SEND UNL LISTEN A MTA DDL 3 DATA "COMSPEC /CDIR A: /W",10 will execute "C:\COMMAND.COM /CDIR A: /W". DDL 4 changes the loop number used by the HP-IL LINK program. The first character received following the DDL 4 must be a digit, which is the loop number in ASCII. The digit is silently ignored if not valid. All characters following the loop digit are ignored until a LF is received. DDL 5 enables or disables logging of ALL data sent to the PC in a file. When logging is active, all other Device Dependent Commands are ignored. Pressing either the "Upload" function key (F1) or the "Download" function key (F2) will disable logging until another DDL 5 is received. The HP-71 can detect if logging is currently enabled by checking bit 4 of the HP-IL LINK status byte. Logging is enabled if the bit is set. See the HP-IL SPOLL command in the HP-71 HP-IL Interface Owner's Manual for more information about reading a device's status byte. If an error occurs while writing to the file, logging will be disabled. Data logging can also be enabled with the /F command line option. SERIAL POLL RESPONSE Response to Send Status [SST]: 1 byte Bit 6: 0: Not requesting service on HP-IL (no data available) 1: Requesting service on HP-IL (data available) Bit 4: 0: Data logging disabled 1: Data logging enabled (see DDL 5) Bit 3: 0: Printer currently disabled (see DDL 2) 1: Printer currently enabled (see DDL 1) Bits 2-0: 0: IDLE (all data received goes to the display) 1: REMOTE UPLOAD (initiated by REMOTE mode) 2: UPLOAD (see DDL 0) 3: DOWNLOAD (see DDT 0) 4: SETUP HP-71 (see "Setup HP-71" function key (F3)) 5: REMOTE IDLE (goes to REMOTE UPLOAD when addressed to listen) 6: REMOTE EXECUTE (execute the next line received from HP-IL) 7: SET LOOP (first character is loop number) (see DDL 4) EXAMPLES Example 1: List an HP-71 file on the PC's printer from within a program: 10 A=DEVADDR("PC") 20 F$="LISTFILE" 30 SEND UNL LISTEN A DDL 1 @ PLIST F$ @ SEND UNL LISTEN A DDL 2 Example 2: Change to loop 2: 10 A=DEVADDR("PC") 20 SEND UNL LISTEN A DDL 4 MTA DATA "2",10 Example 3: Show a directory of drive C: using the /W option: 10 A=DEVADDR("PC") 20 SEND UNL LISTEN A MTA DDL 3 DATA "COMSPEC /CDIR C: /W",10 Example 4: Upload an HP-71 TEXT file, run XYZZY.COM on the PC with the TEXT file as input and TEMP.TEX as output, and download TEMP.TEX to a file named TEMP in the HP-71. The PC is on loop 2. 10 F$="ORIGINAL" @ P$=":PC:2" @ A=DEVADDR(P$) 20 SEND 2; UNL LISTEN A DDL 0 MTA DATA F$,".TEX",10 30 COPY F$ TO P$ 40 STANDBY 2; ON ! Must set STANDBY, the MS-DOS program may take a while 50 SEND 2; UNL LISTEN A DDL 3 MTA 60 SEND 2; DATA "COMSPEC /CXYZZY.COM <",F$,".TEX >TEMP.TEX",10 70 SEND 2; UNL TALK A DDT 0 LISTEN A MTA DATA "TEMP.TEX",10 80 COPY "TEMP"&P$ ! If TEMP.TEX not there, gives error "File Not Found" 90 STANDBY 2; OFF ! Done, restore default STANDBY 100 DISP "Done" @ END USING THE HP-IL LINK SOFTWARE WITH THE HP-75 AND HP-41 Introduction ......................................................... ( 1 ) Equipment Required ................................................... ( 2 ) Using HP-IL LINK with the HP-75 ...................................... ( 3 ) Using HP-IL LINK with the HP-41 ...................................... ( 4 ) Access to Other Features of HP-IL LINK with the HP-75 and HP-41 ...... ( 5 ) Examples ............................................................. ( 6 ) INTRODUCTION Although intended primarily for the HP-71, the HP-IL LINK software works in a more limited fashion with HP-75 and the HP-41. HP-IL LINK works as a display device with the HP-75 and the HP-41. By using the file logging capabilities of HP-IL LINK, data can be uploaded from the HP-75 or HP-41 to the PC. An HP-75 with an I/O ROM can also use the PC as a remote keyboard via the KEYBOARD IS statement (described in appendix D of the HP-75 I/O ROM Programming Techniques Manual). The "Upload" (F1) and "Download" (F2) function keys on the PC are not compatible with either the HP-75 or the HP-41. The "Printer Toggle" function key (F5) works with both the HP-75 and the HP-41. EQUIPMENT REQUIRED HP-75: HP-IL LINK can be used with either an HP-75C or HP-75D. The HP-75 I/O ROM is required to use the PC as a keyboard device. The I/O ROM is also needed to send Device Dependent Commands or read device status from the PC. HP-41: HP-IL LINK can be used with the HP-41C, HP-41CV, and HP-41CX. The HP 82160A HP-IL Interface is required. Either the HP 82183A HP-41 Extended I/O Module or the 00041-15043 HP-IL Development Module is needed to send Device Dependent Commands or read device status from the PC. USING HP-IL LINK WITH THE HP-75 Uploading data from the HP-75 to the PC is done with the data logging option of HP-IL LINK, together with the HP-75 PLIST or LIST command. With the HP-75 I/O ROM, you can also use the PC as a keyboard for the HP-75. Suppose the device name for the PC is ':I1'. With the PC running HP-IL LINK, type "DISPLAY IS ':I1' @ KEYBOARD IS ':I1' [RTN]" on the HP-75. You need to create a KEYMAP file to use the editing keys on the PC. The escape sequences sent by HP-IL LINK are described in the "TECHNICAL INFORMATION AND ADVANCED APPLICATIONS" section of this manual, subsection "Escape Sequences". USING HP-IL LINK WITH THE HP-41 Uploading data from the HP-41 to the PC is done with the data logging option of HP-IL LINK, together with the HP-41 PRA command. To upload an HP-41 program listing, type "HPILLINK /fHP41PROG.TXT [RETURN]" on the PC and connect the HP-41 to the PC via HP-IL. On the HP-41, execute the following commands to upload a program named "PROGRAM": CF 15 CF 16 MANIO 1 SELECT PRP PROGRAM The file HP41PROG.TXT on the PC now contains the program listing. NOTE: The PRP command puts a NUL (ASCII 0) in front of each program label. ACCESS TO OTHER FEATURES OF HP-IL LINK WITH THE HP-75 AND HP-41 Since HP-IL LINK can be controlled through HP-IL, and the HP-75 with an I/O ROM and the HP-41 with either the Extended I/O Module or the HP-IL Development Module can send any HP-IL message, specialized programs could be written on the HP-75 or HP-41 which allow access to other features of HP-IL LINK. For example, data logging to a file can be controlled with a Device Dependent Command. See the "TECHNICAL INFORMATION AND ADVANCED APPLICATIONS" section for more information about Device Dependent Commands. Writing such a specialized program requires a thorough understanding of HP-75 or HP-41 programs and HP-IL protocol, and is beyond the scope of this manual. EXAMPLE - UPLOAD A FILE FROM THE HP-75 TO THE PC This program uploads an HP-75 TEXT file named "GOODDATA" to the file "UPLOADED.TXT" on the PC. Type "HPILLINK /fUPLOADED.TXT [RETURN]" on the PC and connect the HP-75 to the PC via HP-IL. On the HP-75, type "ASSIGN IO ':I1' @ PRINTER IS ':I1' @ PLIST 'GOODDATA' @ ASSIGN IO * [RTN]". Exit from HP-IL LINK by pressing the "Exit" function key (F8). "UPLOADED.TXT" on the PC is a copy of "GOODDATA" in the HP-75. NOTE: The HP-75 does not print line numbers when you PLIST a TEXT file. To include line numbers in the file, use the HP-75 LIST command: "ASSIGN IO ':I1' @ DISPLAY IS ':I1' @ LIST 'GOODDATA' @ ASSIGN IO * [RTN]". EXAMPLE - UPLOAD DATA FROM THE HP-41 TO THE PC This program uploads data from an HP-41 to the file "UPLOADED.TXT" on the PC. Type "HPILLINK /fUPLOADED.TXT [RETURN]" on the PC and connect the HP-41 to the PC via HP-IL. The HP-41 data is in registers R01 through R12. 01 LBL XFER 04 MANIO 07 LBL 00 10 PRA 13 END 02 1.012 05 1 08 CLA 11 ISG 00 03 STO 00 06 SELECT 09 ARCL IND 00 12 GTO 00 Line 02 is the ISG counter for 1-12. Type in and run XFER, then exit from HP-IL LINK by pressing the "Exit" function key (F8). The PC file UPLOADED.TXT contains the data values, one value per line.