.; MACRO DEFINITIONS .MAC NP .SK 1 .TE 5 .FILL .IN 8 .E .MAC NARROW .LE 25 .E .; Fudge tabs for IN -5 with tab broken from text .MAC TFU .TA 17 24 33 .E .; .; TABLE ENTRY N IS -- OR [N] FOR NUMBERED LIST .MAC TAB N .SK 1 .TE 4 .NARROW .TFU .IN -5 %1 .E .MAC PRMPT PROM .TE 5 .NOFILL .SK 1 .IN 17 %1 .SK 1 .FILL .E .; MACRO FOR NORMAL PAGES .MAC NORM .PAPER SIZE 60, 105 .SPACING 1 .LE 17 .RI 88 .TA 17 25 33 41 49 57 65 73 81 89 .E .; MACRO FOR LISTING ERROR MESSAGES .MAC ERLS .SK 2 .TE 6 .RI 100 .E .; .; NEW SECTION MACRO .MAC NS TITLE;TEST;LPN .SK 4 .TE %2 .IN 0 %1 .LPN %3 .SK 1 .E .; .; NEW SUBSECTION MACRO .MAC SECT TEST .SK2 .TE %1 .IN 0 .E .NJ .TI ################# ^^A-RCB-0065-SP-6 ###### USER'S GUIDE FOR HPXFR .NORM .NUMBER 1 THIS PAGE LEFT INTENTIONALLY BLANK .PAGE .NS 1.0 INTRODUCTION;20;100 .FILL .NP The Hewlett-Packard Transfer program (HPXFR) permits the transfer of numerical data between the Hewlett-Packard 9820A calculator [1] and a Digital Equipment PDP-11/45 [2] computer running under RSX-11D V6.2 [3]. .NP The transfer of data to the PDP-11 is desirable since it allows access to data reduction programs and superior output formatting capabilities. Transfer of data to the calculator permits the HP-9862A Calculator Plotter [4] to be used indirectly by a digital computer program. .NP Once the data has been transferred to the storage device (disk file for the PDP-11, memory for the calculator), it may be manipulated with existing utility programs or special user-written programs. .NP HPXFR is written in FORTRAN IV-PLUS [5] using the FORTRAN debug feature. A version may be compiled with the debug lines included. These debug lines generally print messages at each step in the transfer sequence to allow tracing of improper program execution. .NS 2. OPERATING PROCEDURE;20;200 .NS 2.1 HARDWARE;20;210 .NP The calculator system must have the following devices connected: .NOFILL .SK 1 1. HP-11205A Serial I/O Interface [6]. This device must be set for the following: 10 bit code Select code 15 The baud rate of the DL11-B computer interface must be the same as the HP-11205A baud rate! A rate of 1200 baud is recommended. The range for the HP-11205A interface is 110 baud to 1200 baud. 2. HP PC2 ROM [7] in calculator ROM slot 1. .FILL .NP To connect the calculator system to the computer, one of the HP-2640A terminals must be disconnected and its DL11-B [8] interface connected to the HP-11205A interface. It is usually most convenient to break the cable between the terminal and the computer at the computer side of the null modem. The null modem is not required for the calculator system. The cable from the HP-11205A interface connects directly to the cable from the computer interface. .NS 2.2 LOADING HPXFR;20;220 HPXFR is not stored in the system. Mount DECtape RCB-0045-4-DT-6.0/1 on a DECtape drive and transfer HPXFR.TSK to the disk using FLX [9]. A privileged user may install HPXFR for convenience. .NS 2.3 INITIATING HPXFR;20;230 .NP HPXFR can be initiated by two methods. If it is not installed, the following method is used .PRMPT MCR>RUN HPXFR If HPXFR is installed, then type the following response to the MCR prompt: .PRMPT MCR>HPX .NS 2.4 RUNNING HPXFR;20;240 If the program has been initiated correctly, it will identify itself on the user's terminal with the following message: .NOFILL .SK 1 HP9820 - PDP-11 DATA TRANSFER PROGRAM **** SET BAUD RATES CORRECTLY **** INTERFACE? (HP0 OR HP1) > .FILL .NP The user then types HP0 or HP1 dependent upon which terminal interface the calculator has been connected. If the information is entered correctly, the program will print on the terminal: .PRMPT HPXFR WAITING FOR S, R, OR Z .NP .TE 8 The program is now seeking input from the calculator. The following options can be selected: .NOFILL .TE 6 ##########S - initialize the program to receive data ##############from the calculator ##########R - send data to the calculator ##########Z - exit. .FILL .NP If HPXFR does not print the above prompt, there was probably some program linked to the HP terminal when the cable was disconnected. Writing a CTRL Z (decimal ASCII code = 26) and a carriage return, as described in section 2.4.3, will correct this problem. .NP The calculator program to send data to the computer, or alternately, the program to receive data from the computer should now be started. The control of HPXFR is now by calculator command. Section 3 outlines loading and running the two calculator programs for transferring the data. .NS 2.4.1 SENDING DATA TO THE COMPUTER;20;241 .NP Once the HPXFR WAITING FOR S, R, OR Z message has been printed, the calculator program to send data to the computer is started, and the program sends the S to HPXFR. See section 3 for loading and starting the calculator program. HPXFR then requests, on the user's terminal, a filename to be used for storing the data on disk, with the prompt: .PRMPT ENTER FILENAME TO STORE DATA > The filename is typed in the normal RSX-11D file specification format [10]. HPXFR now opens the file, accepts the data and places it in the file. When the data transfer is finished, the file is closed and HPXFR seeks another command from the calculator. The user is informed of the last step with the message: .PRMPT HPXFR WAITING FOR S, R, OR Z .NP HPXFR reads the data in 80A1 format, so any valid ASCII printing character may be placed in the file. .NS 2.4.2 RECEIVING DATA FROM THE COMPUTER;20;242 .NP When the HPXFR WAITING FOR S, R,OR Z message has been printed, the calculator program, that receives data from the computer, is started. This program sends an R to HPXFR. See section 3 for loading and starting the calculator program. HPXFR will request, on the user's terminal, the name of the disk file that contains the data to be sent to the calculator. The following prompt will be issued: .PRMPT ENTER FILENAME FOR DATA > The filename is entered in the normal RSX-11D format [10]. HPXFR opens the file and transfers data to the calculator. At the completion of the transfer, the program will print on the terminal: .PRMPT DONE RECEIVED FROM HP9820 .PRMPT HPXFR WAITING FOR S, R OR Z .NP Although HPXFR reads the disk file with an alphanumeric format, the calculator 'READ' command is incapable of reading any alphabet characters other than the 'E' in the exponential format. See page 2-6 of [7]. .NS 2.4.3 WRITING TO HPXFR FROM CALCULATOR KEYBOARD;20;243 .NP The S or R command is sent to HPXFR by the calculator program. The Z command is sent manually from the calculator keyboard. To write a character (any ASCII character) use the WRITE BYTE (WTB) command [7]. For example, write a Z from the calculator keyboard to the HPXFR program to cause an exit. .NOFILL .SK 1 WTB 15,90;WTB 15,13 .SK 1 where: 15 is the HP11205A interface address 90 is the decimal ASCII code for a Z 13 is the decimal ASCII code for a carraige return that must terminate each line sent to HPXFR is the calculator EXECUTE key. .NS 3. RUNNING THE HP-9820 CALCULATOR PROGRAMS;20;300 .NP There are two programs written for the HP-9820 calculator to communicate with the PDP-11 via HPXFR. The first, SEND, sends data to the PDP-11 while the second program, RECEIVE, receives data from the PDP-11. These programs are an example of how to communicate via HPXFR from the calculator. While SEND is a good general purpose routine, RECEIVE is essentially only a test program because nothing is done with the data other than listing it on the calculator's printer. .NS 3.1 SENDING DATA TO THE COMPUTER;20;310 .NP Enter the program 'SEND', listed in appendix 1, as instructed in the 'HP-9820A Operating and Programming' manual [1]. The data to be transferred must be stored on magnetic cards for this program. Any number of cards (sides) may be used to store the data. .NP When the program is loaded, and HPXFR is running and 'WAITING FOR S, R, OR Z' has been printed on the user terminal, start the calculator program by pressing the following keys in sequence: .PRMPT END EXECUTE RUN PROGRAM .NP The program will ask for the number of data cards (sides) to be transferred into the file with the prompt: .PRMPT NUMBER OF CARDS .NP The number is entered and the RUN PROGRAM key is pressed. The proper control character for the direction of transfer is automatically sent to HPXFR and it will then ask for a filename (at the user's terminal). Once this filename has been entered, the calculator program starts the reader (listen for it) and the first data card may be read. Each time a new data card is required the card reader will start automatically. After the desired number of data cards has been read and the data sent to the computer, the message .PRMPT DONE RECEIVED will appear in the calculator display. To restart the program, press the calculator END EXECUTE and RUN PROGRAM keys as before. .NS 3.2 RECEIVING DATA FROM THE COMPUTER;20;320 .NP Enter the program 'RECEIVE', listed in appendix 2, as instructed in the 'HP9820A Operating and Programming' manual [1]. This program receives the data from the PDP-11 via HPXFR and stores it in registers R0 through R100. It does nothing with the data other than offer the facility to list the register contents on the calculator's printer. More data could be read in as long as there is enough room in the calculator's memory. .NP It is the user's responsibility to modify this program to make use of the data and also to ensure that the calculator's free memory is large enough to accommodate the data in the file. The calculator program starts at the highest memory address and expands downward while the registers start at address 0 and expand upward. A program listing always gives the number of free registers. .NP Line 16 of the calculator program is an example of how to test for possible overflow of memory. The number '100' would be changed to the maximum number of free locations available for data storage. When the memory capacity is about to be exceeded, the character 'M' is sent to HPXFR which stops the data transfer. The calculator program also stops with the lettter 'M' in the display. .NP To modify this program to do something with the data other than to list it on the printer, only the LI subroutine need be changed. The remainder of the program (other than the maximum free memory value in line 16) should not be altered since it interacts with HPXFR to control the data transfer. .NS 3.3 DATA TRANSFER TIMES;20;330 .NP The time taken to transfer the data is essentially controlled by a fixed wait period programmed into HPXFR. The length of the wait is determined empirically by observing the results of attempted data transfers. If the wait period is too short, the calculator usually misses a control character. .NP The wait period takes place before HPXFR sends data to the calculator. This time allows the calculator to take the character from the HP-11205A interface, process it and then get ready to read the next character. The calculator must be doing a read of the HP-11205A interface when the character arrives or it will not be received. .NP For the hardware configuration used and the HP calculator programs SEND and RECEIVE (appendix 1), the wait period was set at 0.35 seconds. .NP When data is being sent to the PDP-11 computer, the wait period is 0.35 seconds plus a small amount of processing time. However, when data is being sent from the computer back to the calculator, there is a wait of 0.35 seconds between each character! The two calculator programs each send or receive about 65 characters per line. .NS 4. ERROR MESSAGES;20;400 .NP The error messages listed in this section are messages that result due to user error. The messages that result because of some RSX-11D operating system failure are not listed. All error messages are essentially self-explanatory. .NS 4.1 HPXFR USER ERROR MESSAGES;20;410 .NP HPXFR user error messages are prefixed with 'HPXFR', if they occurred in the main program. Error messages occurring in subroutines are prefixed with the name of the subroutine. .NOFILL .ERLS HPXFR--ILLEGAL CHARACTER--NOT S, R, OR Z HPXFR received a character other than one of the three valid characters. The octal value of the character(s) received is printed on the user's terminal. The illegal characters are ignored and the program waits for valid input. .ERLS ISEND--BAD OPEN Either the filename syntax was bad or the filename specified does not exist. The program will ask for another filename. .ERLS ISEND--D EXPECTED, RECEIVED 'characters' A letter D was supposed to be received from the calculator indicating it got an end-of-file flag. The improper characters (up to 6) are printed. This error does not necessarily mean that the data transferred is bad since it happpens after the actual data transfer. The data should be closely examined. .ERLS ISEND--HP MEMORY CAPACITY (MAY BE) EXCEEDED The letter M has been sent to HPXFR indicating that the calculator has filled its free memory. The data transfer stops and the disk file is closed. .ERLS IACEPT--BAD OPEN Either the filename format was bad or the filename specified did not exist. The program asks for another filename. .ERLS QIORW--READ TMO 'characters' This message is produced when a record is not read within 10 seconds. This message may or may not be caused by an error. If it occurs in the middle of a data transfer, then an error has occurred. The line terminator has been missed and the line is ignored. The characters, if there are any, will be printed for diagnosis. This message will frequently be seen while HPXFR is waiting for an S, R, or Z and the calculator is not being run. In this case, it should be ignored. .FILL .NORM .NS 4.2 HP 9820A CALCULATOR ERROR MESSAGES;20;420 The calculator programs will detect some error conditions that will generally stop the calculator with the message in the display. .NOFILL .ERLS GO???? SEND has received from HPXFR a letter other than G. The G is used for communications control. The message usually indicates that the programs are not synchronized. .ERLS WAITING FOR DONE SEND did not get the character D back from HPXFR, indicating that the end-of-file flag from the calculator was received. This error does not necessarily mean that the data transferred is bad, since it occurs after the data transfer. The data should be closely examined. If an examination of the disk directory reveals a zero length (unclosed) data file, write a Z from the calculator keyboard to close the data file. See section 2.4.3. .ERLS LOOKING FOR G RECEIVE has received from HPXFR a letter other than G. The G is used for communications control. The message usually indicates that the programs are not synchronized. The program will keep reading until a G is received. .ERLS M The free memory available to store data from the computer is filled. The program stops. .ERLS UNKNOWN BYTE RECEIVE has detected a character other than Z from HPXFR, indicating an end of file. The program stops. .FILL .NORM .NS 4.3 DETECTION OF COMMUNICATIONS BREAKDOWN;20;430 .NP Once the calculator programs and HPXFR have been debugged, the error messages, other than the read timeout message, should not appear. The weakest link in the communications is missing a control character. This fault will not result in a message, if the calculator missed the character, which is the most likely case. Both calculator programs SEND and RECEIVE flash either data or informative messages in the calculator display register while the programs are running. The time between 'flashes' can be long, especially in RECEIVE. If there is not a 'flash' within a 30 second interval, the program has probably missed a control character and should be restarted. This happens rarely, but when it does, it is usually when the PDP-11 system is experiencing very heavy use by high-priority devices. .NS 5. REFERENCES;50;500 .TAB [1] "OPERATING AND PROGRAMMING for the HEWLETT-PACKARD 9820A CALCULATOR", Hewlett-Packard Company, P.O. Box 301, Loveland, Colorado. .TAB [2] "PDP 11/45 PROCESSOR HANDBOOK", Digital Equipment Corporation. Maynard, Massachusetts, 1973. .TAB [3] "RSX-11D EXECUTIVE REFERENCE MANUAL", DEC-OXERA-B-D, Digital Equipment Corporation, Maynard, Massachusetts. .TAB [4] "HEWLETT-PACKARD MODEL 9862A PERIPHERAL MANUAL" Hewlett-Packard Company, 16399 W. Bernardo Drive San Diego, California 92127, 1972. .Tab [5] "FORTRAN LANGUAGE REFERENCE MANUAL", DEC-LFLRA-C-D, Digital Equipment Corporation, Maynard, Massachusetts. .TAB [6] "11205A SERIAL INTERFACE", Installation and Service Manual, Hewlett-Packard Calculator Products Division, P.O. Box 301, Loveland, Colorado, 1973. .TAB [7] "PERIPHERAL CONTROL BLOCKS for the 9820A and 9821A CALCULATORS", Hewlett-Packard Calculator Products Division, P.O. Box 301, Loveland, Colorado, 1975. .TAB [8] "DL11 ASYNCHRONOUS LINE INTERFACE MANUAL", DEC-11-HDLAA-A-D, Digital Equipment Corporation, Maynard, Massachusetts, 1973. .TAB [9] "RSX UTILITIES PROCEDURES MANUAL", DEC-11-OXMDA-A-D, Digital Equipment Corporation, Maynard, Massachusetts. .TAB [10] "RSX-11D USER'S GUIDE", DEC-11-OXDUA-B-D, Digital Equipment Corporation, Maynard, Massachusetts. .PE .NORM .NS APPENDIX 1 LISTING OF HP9820A PROGRAM 'SEND';50;1000 .NP The following is a listing of the calculator program SEND. It will send an S to HPXFR to start a data transfer from the calculator to the computer. Four calculator registers per record (line) of data are sent in an E16.9 format with the appropriate control characters. Statement 19 (55 raised to the power 5) causes a delay between the HP-11205A interface write and read commands. Without this delay, extra bits are sometimes added to the data. .NOFILL SEE SEND.HPC FOR LISTING OF THE PROGRAM .FILL .TE 25 .NS APPENDIX 2 LISTING OF HP-9820A PROGRAM 'RECEIVE';50;2000 The following is a listing of the calculator program RECEIVE. It will send an R to HPXFR to initiate a data transfer from the computer to the calculator. It expects to receive four registers per record (line) and also the the appropriate control characters. Delays are inserted between the HP-11205A interface write and read commands by calculating 55 raised to the power 5. Without this delay, extra bits are sometimes added to the data. .NOFILL SEE RECEV.HPC FOR LISTING .FILL .TE 25 .LPN 99 .; LABEL MACROS .; There are three label macros which must be used together. .; The reason for having three is that it is hard to put all .; the label information on one macro call line. .; LAB1 prints the job title, LAB2 prints the subtitle, and .; LAB3 prints the author, date, RCB number and SP number. They .; should be used together, in order, at the start of the table .; of contents page. .; Before use, EXLONG should be used to ensure that the label .; is printed near the bottom of the page. .; After use, right and left margins must be reset to their .; desired values, since they are corrupted. .; TI is the title, which must be 57 letters. .; ST " " subtitle, " " " 57 " .; NAM is the author's name; 14 letters. .; DAT is the date; 10 letters. .; RCB is the RCB number; 4 digits. .; SP is the SP number; 2 characters (use 1# for SP-1) .MAC EXLONG .PS 66 .RMARG .E .MAC RMARG .RI 88 .E .MAC LAB1 TI .SP 1 .FO 5 .NF .NJ .RI 130 .LE 42 # # )BQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;W )B:)C%1)B: )B: : ! .E .; .MAC LAB2 ST .SP 1 .FO 1 .NF .NJ .RI 130 .LE 42 )B:%1: ! .E .; .MAC LAB3 NAM;DAT;RCB;SP .SP 1 .FO 9 .NF .NJ .RI 130 .LE 42 )B!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,7,,,,,,7,,,,,7,,,,,,," )B: DR'N#%1DATE#%2 .BLDG. .CODE . CLASS : )B!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,/,,,,,,/,,,,,/,,,,,,," )B: APP'D DATE . 600 . . E : )B!,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,/,,,,,,8,,,,,8,,,,,,," )B: ATOMIC ENERGY OF CANADA .  A-RCB-%3-SP-%4#: )B:  LIMITED .  : )B: CHALK RIVER ONTARIO CANADA  .REV. SHEET 1 OF@99: )BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;$;;;;;;;;;;;;;;;;;;;;S ! .E .;Table of Contents .; .; This page must not be preceded by a .PAGE. It will cause .; the .NU 0 to fail. .; ^^ .NU 0 .PE .LPN 10 .EXLONG .LPNON .LAB1 ##########HP-9820A - PDP-11 DATA TRANSFER PROGRAM######## .LAB2 #################USER'S GUIDE FOR HPXFR################## .LAB3 W.T.#HOWATT##;#78-03-10##;0065;6# .RMARG .NORM .EXLONG .NF .; .; Next is a blank line to force recognition of the .BL command. .BL 1 .CE A-RCB-0065-SP-6 .BL 2 .CE HP-9820A - PDP-11 DATA TRANSFER PROGRAM .BL 1 .CE USER'S GUIDE FOR HPXFR .BL 4 .CE TABLE OF CONTENTS .BL 1 .TA 78 Sheet .TA 25 79 .BL 1 .; .; There is a tab before the name and before the number. .; Each section is followed by a blank line. .; 1. INTRODUCTION @100 2. OPERATING PROCEDURE @200 2.1 HARDWARE @210 2.2 LOADING HPXFR @220 2.3 INITIATING HPXFR @230 2.4 RUNNING HPXFR @240 2.4.1 SENDING DATA TO THE COMPUTER @241 2.4.2 RECEIVING DATA FROM THE COMPUTER @242 2.4.3 WRITING TO HPXFR FROM CALCULATOR KEYBOARD @243 .BL 3. RUNNING THE HP-9820A CALCULATOR PROGRAMS @300 3.1 SENDING DATA TO THE COMPUTER @310 3.2 RECEIVING DATA FROM THE COMPUTER @320 3.3 DATA TRANSFER TIMES @330 .BL 4. ERROR MESSAGES @400 4.1 HPXFR ERROR MESSAGES @410 4.2 HP9820A CALCULATOR ERROR MESSAGES @420 4.3 DETECTION OF COMMUNICATIONS BREAKDOWN @430 .BL 5. REFERENCES @500 .BL APPENDIX 1 @1000 APPENDIX 2 @2000 .PAGE EXTRA PAGE AT END