hp110 talks to hp41 Equipment used: hp41 with IL-Interface and X-I/O Module. hp110 with hpillink-Software(hp82477A) The hpillink Software Package is an MSDOS-Program that enables easy File-Transfer between hp71 and hp110. Also the keyboard and display of the hp110 can be used as remote device for programming the hp71. For users of hp75 and hp41 the manual offers only one feature of hpillink, that is file logging for uploading data to the PC. This feature is usually called by specifying the option "/f" and a filename, when running hpillink. In the section "Technical Information and Advanced Applications" of the hpillink manual I have now found the Device Dependent Listener Command DDL 5 to initiate this file logging from HP-IL. In the first example program "LOGPC" the hp41 initiates file logging, sends a filename, prints some registers and closes the logfile. 01*LBL "LOGPC" 02 78 Accessory ID of hpillink 03 FINDAID 04 SELECT 05 5 initiate file logging 06 DEVL 07 "REGS41" log-filename 08 CF 17 09 OUTA 10 MANIO we print to a non printer device 11 .005 12 PRREGX 13 AUTOIO 14 CLRDEV close file 15 END For a successful run of this example You should have the printer switch of the IL-Module in enable position and Flags 15 and 16 cleared. If You have a thermal printer in the loop the print switch should be MAN. You have now 6 of your hp41 Registers in the file "REGS41"(or more if You have changed the number in line 11). If You want to use the "REGS41"-file further in Your hp110, be warned, that the hp41 End of Line - sequence is LF,CR but the MSDOS EOL-sequence is CR,LF. (Warning valid for -PRINTER 2D Modules only!) If You only print the file it's all right, but if You load the file into Your Word-Processor You might get unexpected results. But the greatest problem with our "REGS41"-file is, that we can't download it again to the hp41. Even if we dry this with the DDT 0 Command, we get an Error-Message "Not an hp71 file" on the hp110 and "NOTFOUND" sent via HP-IL. The reason for this is, that the normal file transfer commands of hpillink, DDL 0 and DDT 0 expect a 32 byte header which is similar to a directory entry on a tape or disc. When receiving, the hp110 gets the filename and number of records to receive from this DIR-entry and puts it as the first 32 bytes into the file, followed by file-data in multiples of whole 256-byte records. (Therefore the smallest file size is 288 bytes). In our second example "TOPC", we initiate file upload, create and send the 32-byte DIR-entry, send some data registers and fill the file to 256 data bytes, which automatically ends the upload. 01*LBL "TOPC" 02*LBL 01 24*LBL05 43*LBL11 AUTOIO 78 FINDAID 7 XEQ 12 1 OUTXB OUTXB DSE Y GTO 11 SELECT RTN 29*LBL 06 07*LBL02 6 XEQ 12 48*LBL20 0 DEVL .005 SCI 9 0 CF 17 32*LBL 07 10*LBL 03 128 OUTXB 1 OUTXB 53*LBL 21 "REGS41" "}.BIN" CF 17 CLA ARCL IND Y OUTA OUTA 37*LBL 08 ALENGIO + 2 + ISG Y 4 XEQ 12 GTO 20 GTO 21 FIX 2 256 - 15*LBL 04 ABS XEQ 12 "DONE" 10 ENTER^ 32 XEQ 11 41*LBL 12 BEEP PROMPT END 226 OUTXB 4 OUTXB 0 The many Labels are only for reference in the following description: LBL 01: Find and select the hp110 in the loop. LBL 02: Initiate file-upload. LBL 03: Send filename.(please see the note on the appended .BIN extension) LBL 04: Send ten blanks and the filetyp BIN(E204hex). LBL 05: Send seven NULLS and the number of records (one in our example). LBL 06: Send six Nulls (date and time field). LBL 07: Send 8001hex as special LIF mark. LBL 08: Fill with four NULL-bytes to complete the DIR-entry. LBL 12: Subroutine for sending NULL-bytes. LBL 11: Subroutine for sending Y number of value X bytes. LBL 20: Start of file data send-routine -- we initialize the loop counter and set maximum accuracy. LBL 21: Send out each register with CR,LF (CF 17) and count the number of bytes sent. Finally fill with NULLS up to the number of 256 bytes(1 record). NOTE: You may change the Filename but please preserve the .BIN extension. This is because of a special feature of hpillink with the hp71. Hpillink "knows" all hp71 filetypes and needs the proper extension to the filename on upload. When downloading to hp71 (or in our next example to hp41) the file is only send as it is, if it is of known type(except .TEX). If there is no extension, or the extension is .TEX or unknown, then hpillink assumes it is a MSDOS-text file and translates the File to LIF-textfile format(the same as used by SAVEAS on tape or disc). For my experiments I have chosen .BIN to get the bytes back that I have sent. For this kind of storage we need between 15 and 18 bytes per register, having included CR,LF and maximum precision. This is about two and a half times as much as we need in the hp41 registers. Please keep in mind we are doing binary data transfer in our "TOPC" program and You are free to develop Your own send routines under Label 20! But for the time we want to get our data back into the hp41, and that leeds us to our last example "FROMPC". 01*LBL "FROMPC" 18* LBL 03 37*LBL 21 .005 ENTER^ 0 "REGS41" "}.BIN" CF 17 INA ALENGIO - 2 - OUTA ANUMDEL STO IND Z RDN 05*LBL 00 ISG Y GTO 21 FIX 2 STO IND Y ISG Y GTO 00 23*LBL 05 19 INAN INXB 256 * 49*LBL 22 09*LBL 01 12 INAN RDN INXB RDN DSE X GTO 22 AUTOIO 78 FINDAID "DONE" BEEP PROMPT SELECT 32*LBL 20 END SCI 9 .005 X<>Y CF17 15*LBL 02 0 DEVT Description: LBL 00: Clear registers 0 to 5 (not necessary, only for check). LBL 01: Select hp110. LBL 02: Initiate file-download LBL 03: Filename (same note as before!) LBL 05: Get number of records and make number of bytes for count. LBL 20: Set accuracy and prepare loop counter. LBL 21: Get data back, subtract number of bytes received from count of Label 05 (hold in the X-register) and store data in registers. LBL 22: Get some NULL bytes for the full record-length and throw them away. You have now Your data back in the registers of Your hp41 and I am at the end of my little explanation. Please note, that the above material should only be a introduction into the mechanism of the data-transfer, with small, but working examples. This should be a starting point for You to develop "real" hp41 programs to transfer all that You want to the hp110 and get it back. My own research will now go to saving hp41 programs maybe with the help of the OUTP and INP functions of the I/O module. If You have some news I hope to read from You in Datafile or You write to me: Franz Ulz Roemerweg 12 A-2345 BRUNN/GEB. Austria At last, please apologize my bad english, but my native language is German. Happy Programming Franz