(User.programs) Item: 510 by akcs.kirkland@hpcvbbs.external.hp.com [Dan Kirkland] Subj: Universal IR Send and Receive Library Date: 11 Mar 1994 --> S/SX/G/GX USND.LIB v3.0 (Library #1698) Universal IR Send and Receive Version 3.0, March 1994 by Dan Kirkland [Note: This is an upgrade from the USND on Goodies Disk #8. -jkh-] Version 3.0 works on HP48 versions S/SX/G/GX. Version 3.0 does not talk to earlier versions of USND. If you have earlier versions, you should upgrade to version 3.0. USND.LIB is a library with the commands USEND and URECV. USEND and URECV are fast, all purpose, IR send and receive commands for FAST IR data transfer between two HP48's. With USEND and URECV, you can send objects directly from the stack without storing them in a variable. Try putting a library on stack level one and sending it! You must use USEND on the sending HP48 and URECV on the receiving HP48. USEND and URECV are typically 4+ times faster than the HP48 SEND and RECV commands. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ INSTALLING USND3.LIB ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Transfer USND3.LIB to your HP48. Recall the library from the USND3.LIB variable to the stack. Purge the USND3.LIB variable. Enter the port number where you want to store USND3.LIB and press STO. Turn the HP48 off and back on again to allow USND3.LIB to attach. To get to the USND3 menu, press the shifted LIBRARY key then press the USND softkey. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ REMOVING USND3.LIB ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Go to the HOME directory. Enter 1698 and execute DETACH . Enter 1698 tagged with the port number which USND3.LIB is stored and execute PURGE. ( or :&:1698 PURGE) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ USEND USAGE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ USEND will send ANY type object from stack level one. USEND uses flag #1 (user flag). With flag #1 clear (no 1 in the status area). ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Defined variables (both global and local variables that have something 'stored' in them) are sent and stored in the current directory on the receiving HP48. Undefined variable names will be sent and left on the stack of the receiving HP48. SENDING LISTS The objects in a list will be sent separatly and defined variables in the list will be stored in the current directory. To send a list as an complete object, either put the list as an object in another list or set flag #1 (see below). Defined variable names nested inside two or more list will be sent as as names in a list. The object stored in the variable will not be sent. Only defined variable names are stored in the current directory, all other objects are left on the stack of the receiving HP48. With flag #1 set (a 1 showing in the status area). ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Stack level one object sent as is to stack level one of the receiving HP48. This means that all variable names will be sent as variable names only. Lists will be sent as one complete object. The receiving HP48 will receive to stack level one exactly what was sent from level one of the sending HP48. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ URECV USAGE ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ Just execute URECV on the receiving HP48. URECV does NOT use any flags (flag #1 only needed for USEND). ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ SAMPLE PROGRAMS ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ SSTK (Send Stack) BYTES: # F386h 30.5 (SSTK will send the entire stack from one HP48 to another AS IS.) Arguments: obj#n ... obj#1 #n -> << 1 SF DEPTH ->LIST USEND 1 CF >> RSTK (Recv Stack) BYTES: # 11BEh 20.5 Arguments: -> obj#n ... obj#1 << URECV OBJ-> DROP >> ÚÄÄÄÄÄÄÄÄÄÄ¿ ³ COMMENTS ³ ÀÄÄÄÄÄÄÄÄÄÄÙ USEND and URECV do not require any setup (except maybe flag #1; see above). USEND and URECV are quiet. They do not display what is being sent. If the data transfer arrow is blinking, then everthing is okay. USEND and URECV do not do packet checks like the built in SEND program (and TSEND). So, don't move the HP48's once you start the transfer. URECV does a checksum check, so any object is sure to be the same as the object that was sent. With USEND, there is no longer any need to store a library in a variable to send it. Just put the library on the stack and send it. It will be received on the stack of the receiving HP48 and can then be stored in the proper port with no variable to purge. Thanks to Detlef Mueller for his RPL and library tools, without which these programs would not be. Any comments, questions, or suggestions send email to: kirkland@ee.utah.edu Dan Kirkland