HP-IL ADDRESSING - THE AAU MODE- by Michael Markov 3/24/89 HP-IL loop addressing, as implemented by Hewlett-Packard, is easily understood: the first device on the loop has address 1, the second has address 2, etc. It is interesting to note that this addressing mode is implemented by the vast majority of HP-IL functions, statements or other class instructions for the HP-41, the HP-75 and the HP-71. What happens is that, because users can easily add or remove peripherals from the loop, each such instruction re-validates the loop addressing scheme by sending the AAU and AAD 1 frames. To say this in english, the controller sends an Auto-Address Unconfigure frame, then an Auto-ADress frame. As this frame is received by each HP-IL peripheral, the value of the frame is stored in the appropriate HP-IL register, then the value is incremented by one and sent to the next peripheral, until it returns to the controller. This, incidentally, tells the controller how many peripheral there are on the loop. If there are more than 30 devices on the loop, devices 31 onward are assigned address 31. Since LAD 31 is better known as UNL and TAD 31 is better known as UNT, this means that you cannot use more than 30 peripherals on the loop, because you cannot make them either talkers or listners... This ignores the fact that some peripherals support secondary addresses. These peripherals are controllers such as the HP110 or the Portable plus, IBM PC compatible machines with HP-IL interface cards, etc., where each internal drive can be assigned a secondary address. With such peripherals, you are supposed to be able to have up to 931 peripherals on the loop. AAU mode, the Auto-Address Unconfigure mode, supports what is in effect parallel bus addressing, where each type of peripheral has a known default address. This means that, provided you have no more than one peripheral of each type on the loop, you do not have to waste time finding out where each peripheral is located. In the HP-71 FORTH environment, this generally translates in shorter code and faster I/O. In the HP-41 environment (with the HP-IL Development module), this has also proven to be an effective approach to faster & shorter code. It allows you to easily change the MCPY41 program from a two drive mass- copy program to a program that can handle any number of drives. See MCPY41X and MCOPY71D on SWAP11. See also the POLYCOPY program (JPC01). POLYCOPY allows HP-71 users to share their programs at chapter meetings without using disk drives: just connect all the HP-71s on the loop (more than 30 is OK). Then, anybody who wants to share a program or other type file runs POLYCOPY... AAU mode has two major advantage: 1) It allows you to make all the peripherals of a given kind listeners at the same time. 2) There are no limits to the number of peripherals you can access on the loop. This means that you could print more than 30 copies of documents / barcode / graphics at once, assuming you have more than 30 printers available. Similarily, you could record information on two or more drives at once, which means that you could make more than 30 mass-copies of a swapdisk at once. Associated with these advantages are two major disadvantages: 1) You cannot make devices talkers while in the AAU addressing mode unless you know that there is only one peripheral of that particular kind on the loop. It also means that you cannot check the status of your listeners without having them all try to talk at once. Parallel Poll does allow some checking, but that requires extensive set-up and is limited to not more than 8 peripherals.. and 2) You cannot send the information to the loop using standard printer functions. Typically, HP-71 users must use the SEND CMD ..... DATA A$ EOL sequence, while HP-41 users must invoke MANIO and send the data to the loop with OUTBUFX or with ASIZE? BSIZEX MIPT A-BUF OUTBUFX, with additional code such as 3338 OUTBIN whenever you need to send out a carriage return, linefeed sequence. Consider, for example, MCOPY71D. The key to MCOPY71D is the AAU mode: CMD 154, 34, 4, 162 RDY 129 TALK T DDT2 RDY 96 is equivalent to: AAU LAD02 SDC DDL02 AAD01 TAD DDT2 SDA AAU LAD02 makes all mass storage devices listeners, SDC sets the pointers to start of medium, DDL02 sets-up continuous write mode, and AAD01 restores the normal addressing mode. TAD makes the master drive the system talker, and DDT02 sets the master drive to continuous read mode. Finally, SDA triggers the master drive to start sending data until it reaches the end of the medium, when it will automatically send an EOT (End Of Transmission) frame. The HP-41 SF33 and CF33 instructions correspond to the HP-71 OFF IO and RESTORE IO statements. If you do not use the AAU mode, your program must locate all the drives on the loop and create a command string that sets each individual drive to listener status. While this presents some advantages, such as the opportunity to check each drive for problems (no medium, etc.), it certainly increases code length and execution time. See MCOPY71C and compare it to MCOPY71D! At this point, it makes sense to provide a list of AAU mode addresses, as collected form various sources. If anybody can provide additional data or corrections, please send a note to: Michael Markov, P.O. BOX 17, LOCKWOOD, NEW YORK 14859 USA (Thanks). C L A AAU S AID mode S (hex) address ID$ Device CLASS 0 type devices are HP-IL controllers 0 00 - - HP-41 0 01 - - HP series 80 computers 0 03 21 HP71 HP-71 0 4E ? PCPORT PC/HP110/HP Portable Plus running HPILLINK CLASS 1 type devices are Mass storage devices 1 10 2 - HP82161A cassette drives 1 10 2 HP9114A HP9114A disk drive 1 10 2 HP9114B HP9114B disk drive 1 10 2* CMTDSK4G 512K CMT disk drives 1 11 ? - PC/HP110/HP Portable Plus running HPLINK S (hex) address ID$ Device CLASS 2 type devices are printers. 2 20 1 - HP82162A thermal printer 2 21 5 HP82905 HP 80 column print 2 23 5 HP2225 Thinkjet printers 2 22 ? HP2671A HP 80 column printer 2 23 ? HP2671G HP 80 column printer w/ graphics capability 2 24 ? HP2673A HP 80 column printer CLASS 3 type devices are displays. 3 30 1 ? PAC-TEXT PAC Screen Video interface 3 30 31 ** HP82163 HP 32 column video interface 3 32 31 ** MC00701A HP 80 column video interface 3 30 2 *** LCD8x40G CMT HPIL LCD display CLASS 4 type devices are Interfaces. 4 40 4 HP82166A GPIO interface 4 40 8 HP82165A 4 41 31 ** HP82168A Acoustic Modem 4 42 8 HP82164A RS-232 Interface 4 43 15 HP82169A HP-IL/ HP-IB interface CLASS 5 type devices are Instruments 5 NONE 22 HP3468A/B Multimeters CLASS 6 type devices are Graphic I/O devices (plotters) 6 60 ? HP7470 Plotter 6 60 ? ? PAC-PLOT ? PAC Screen Graphic output CLASS 14 type devices are non-standard devices. E E0 4 MC00506A MC EPROM burner. * CMT RAMDISKs retransmit frames around the loop while in AAU mode. However, they do not respond in any other way until they receive an AAD frame. The RAMDISKs remain UNListened and UNTalked. Thus, you must use the programs like MCPY41 or MCOPY71B (see CHHU03 swapdisk), or MCOPY71C (see CHHU04 swapdisk) to mass-copy data onto a CMT RAMDISK. CMT RAMDISKs can also be used as the "master" drive for mass copy operation provided your reset the drive with CLRDEV or CLEAR :CMTDSK at the start of programs such as MCPY41X or MCOPY71D on the SWAP11 swapdisk. The reason for this sad implementation is that the CMT RAMDISK controller must simulate up to 4 drives with 131072 bytes of storage each (4 cassette drive equivalents). In AAU mode, it would be very difficult to have the controller store data on all four simulated cassette drives at the same time. ** the sad implication of this is that HP displays cannot be made listeners while in AAU mode, since the LAD31 frame is better known as UNL. This is especially maddening since certain documents show that the intended AAU address of HP-IL displays was to be 3, not 31. *** This incredible blunder by CMT was due to the desire to get the display out as soon as possible. So, they used the same code as they used for the RAMDISKS, with the difference that if you use the AAU LAD02 SDC sequence in an MCOPY program with a CMT LCD dislplay on the loop, the CMT LCD will actually be a listener, and will try to display everything that is going around the loop. This slows down the data transfer to the point where you would have been better off transfering each file individually with the COPY command!. This has made the CMT LCD display much less useful than it could have been in my HP-71 FORTH environment. (I use the AAU mode extensively to locate the system mass storage). Rewriting my FORTH source is not an attractive option... The following program can help determine the AAU mode of peripherals. It may be neccessary to add suitable device dependent commands or escape sequences to enable output on the receiving end of interfaces or peripherals.. The other source of information is, of course, the Owner's Manual, if one exists and if it is reasonably complete. 0010 ! This program determines the AAU mode address of displays, printers and 0020 ! most interfaces: whenever the AAU loop address matches the value of I, 0030 ! the printer will print the line, the display will display the line, or 0040 ! the interface will transmit the line to the output device, etc. This 0041 ! assumes the interface is properly set-up and ready to accept data. It is 0042 ! assumed that the interface is connected to a printer or equivalent. 0043 ! Note that the MTA instruction tells the HP-71 controller that it is the 0044 ! system talker. If MTA is omitted, you would get an Invalid Mode error - 0045 ! the HP-71 cannot be both a listener (following LISTEN 21) and a talker 0046 ! that can send out the DATA that follows. 0047 ! 0050 FOR I=1 TO 31 @ DISP I 0051 SEND UNT UNL CMD 154 LISTEN I MTA DATA STR$(I),' This is it' EOL UNL 0060 NEXT I