AUXSBR.SBR FUNCTION: Prints a sequential file to a printer attached to the auxiliary Port of a terminal from a BASIC program. HINTS/RESTRICTIONS: For optimum results the terminal must be capable of supporting a transparent print mode. A terminal with simultaneous (such as a SOROC IQ120) will work but the text will also be printed on the terminal screen. The terminal driver TCRT code #82 must correspond with turning on transparent mode and TCRT code #83 must correspond with turning transparent mode off. The terminal driver DUMB.TDV must be resident in memory as a driver on a TRMDEF statement in the .INI file. An example of DUMB.TDV is provided at the end of this documentation. Example: TRMDEF AUXPRT,PSEUDO,DUMB,1,1,1 or include it as a driver for a printer, Example: TRMDEF LASER,AM300=12:9600,DUMB,2,2,25 As long as the DUMB.TDV is in a TRMDEF statement, AUXSBR will find it. AUXSBR.SBR is LOKSER compatible and will work under AMOS MULTI environment. FORMAT: XCALL AUXSBR, filename, flag WHERE: filename = string variable of the name of the file to print. Default extension is .LST flag = binary one number that receives a status flag from AUXSBR.SBR. 0 = All ok. 1 = Filename not found. 2 = File is RANDOM. 3 = DUMB.TDV not on a TRMDEF statement. 4 = File is in use (LOKSER). 5 = Any other file service error (AUXSBR will report error on terminal) EXAMPLE: MAP1 FILENAME, S, 25, "AUXSBR.BAS" ! name of file to print MAP1 FLAG, B, 1 ! returned value DEFAULTS: Defaults to files with the extension .LST Always defaults to the printer attached to the terminal. OPTIONS: none OPERATION: From BASIC use the statement: XCALL AUXSBR, FILENAME, FLAG AUXSBR will change the current terminal driver to DUMB then opens the file selected. The terminal driver is then changed to DUMB.TDV so that control characters (such as microspace characters for the DIABLO) will not effect the terminal screen. AUXSBR then turns on the auxiliary port using the TCRT code 82 or Print TAB(-1,82). Then each character is then taken from the file, passed to the terminal and out the auxiliary port to the printer. At the end of the file a form feed is sent, the terminal's original driver is replaced, the auxiliary port is turned off, the sequential file is closed and the user is returned to the BASIC program. COMMAND SUMMARY: If AUXSBR does not work with your terminal and printer configuration then first check the cabling between the terminal and printer for correct data flow. Also check the terminal's terminal driver to see that TCRT code 82 is corresponding with the codes that turn the terminal's auxiliary port on in transparent print mode and that TCRT code 83 turns the auxiliary port off. Also check the protocal on the Auxiliary port and the protocal on the printer. XON/XOFF protocal on the Auxiliary port and the Printer usually works best. Also be sure the Baud rates on the Auxiliary port and the printer match. ERRORS: The FLAG variable will report: 0 if all was OK. 1 if the requested filename was not found. 2 if the requested filename was a RANDOM file. 3 if DUMB.TDV could not be found in the system TERMINAL DRIVER area. 4 if the requested filename is in use under LOKSER. 5 if any other file service error happens. The following errors are reported from AUXSBR.SBR: - Must pass 2 variable in AUXSBR.SBR The XCALL statement must have 2 arguments. - Variable 2 must be Binary in AUXSBR.SBR. The second argument on the XCALL statement must be mapped as a binary 1 number. MAP1 FLAG, B, 1 - First variable must be a STRING in AUXSBR.SBR The first argument on the XCALL statement must be mapped as a String MAP1 FILENAME, S, 24 CHARACTERISTICS: Ninety-nine point nine percent of the time that it doesn't work it is a problem with the cable hookup between the terminal and the printer. In some cases a 25-pin to 25-pin hookup works just fine. In other cases pins 2,3,7 to 2,3,7 work. In other cases 2,3,7 on the terminal end to 2,3,7 on the printer end and 5,6,8,20 on the printer end tied together work. Some printers work in the PTR RDY state, while others work in the DC1/DC3 state. Always consult your printer manual and terminal's auxiliary port configuration. I have found that in most instances any set up that works from the I/O port from an ALPHA to the printer will also work from the terminal to the printer. It also works at different baud rates. I.E. if your terminal is set at 9600 baud and the auxiliary port and printer are set at 1200 baud, AUXSBR works. I have seen set ups with BROTHER printers, DIABLO printers, TI810 printers, OKIDATA printers, and HPLaserJet printers, in use with SOROC terminals, LNK125 terminals, WYSE terminals, AM60 terminals, and FRREDOM 100 terminals. So almost any configuration is possible. Will work with LOKSER and AMOS MULTI. SPECIAL: ;DUMB.TDV OBJNAM DUMB.TDV DUMB: WORD 0 RTN RTN RTN RTN END WYSE 50 & WYSE 350 TERMINALS: In the Wyse terminal driver make sure that the transparent print on code is equivalent to a Control X (BYTE 24.,0) and the transparent off code is equivalent to a Control T (BYTE 20.,0). In setup mode of the WYSE terminal make sure that HANDSHAKE is XON/XOFF and ENHANCE is ON. Set up the printer for XON/XOFF protocal. With most printers a 25 pin to 25 pin cable will work. WYSE 50, WYSE 350 TO HP LASER JET PRINTER - 25 PIN TO 25 PIN CABLE Prints all HP escape codes with no problems. WYSE 50, WYSE 350 TO DIABLO 630 - CONNECT DIABLO CABLE DIRECTLY TO AUXILIARY PORT ON WYSE TERMINAL. Set Diablo printer to correct baud rate, PTR RDY, DISABLE Parity. Prints all codes to do underlining, bold, backspace, etc. with no adverse effects. WYSE 50, WYSE 350 to OKIDATA 93 - 25 pin to 25 Pin CABLE Set the Okidata printer to PTR RDY protocal or (OKI SIMPLEX) LINK 125 TERMINALS: In the LINK terminal driver make sure that the transparent print on code is equivalent to a Control X (BYTE 24.,0) and the transparent off code is equivalent to a Control T (BYTE 20.,0). In setup mode of the Set up LINK TERMINALS auxiliary port to PRINTER, DATA BIT=8, STOP BIT=1, PARITY=NONE, ATTRIBUTES=CHARACTER, FULL DUPLEX, HANDSHAKE XON/XOFF. With most printers a 25 pin to 25 pin cable will work. LINK 125 TO HP LASER JET - 25 PIN TO 25 PIN CABLE Set Terminal baud rate to 9600. Prints all HP codes with no problems. LINK 125 TO DIABLO 630 - CONNECT DIABLO CABLE DIRECTLY TO AUXILIARY PORT ON LINK TERMINAL. Set Diablo printer to correct baud rate, PTR RDY, DISABLE Parity. Prints all codes to do underlining, bold, backspace, etc. with no adverse effects. LINK 125 to OKIDATA 93 - 25 pin to 25 Pin CABLE Set the Okidata printer to PTR RDY protocal or (OKI SIMPLEX). OTHER PRINTERS: Most problems occur with the protocal between the terminal port and the printer. The other problem is incorrect cabling. Check cabling procedure for the printer and terminal that you have. NOTE: This program is not part of the original AMOS/L operating system distributed by Alpha Microsystems. The author of this program is: James A. Jarboe IV 1401 19th Street Huntsville, TX 77340 1-409-295-5767 GR/AM This command was donated by: James A. Jarboe IV Distributed by the Alpha Micro Users Society, 735 Walnut St., Boulder, CO 80302. (303) 449-6917. .