.PSECT HPFIX .TITLE HPFIX CLEAR ^S OR ^O FROM HP PLOTTER .IDENT /V1.0/ .NLIST BEX .ENABL LC .SBTTL Documentation ;+ ;======================================================================== ; Phil Hoffman ; Department of Chemistry ; Michigan State University ; East Lansing, MI 48824 ; 4-August-1983 ;------------------------------------------------------------------------ ; Occasionally, the HP 7470A pen plotter generates a CNTRL/S and never ; recovers (i.e., it never sends CNTRL/Q), thereby permanently freezing ; the line. HPFIX determines if output has been suspended (CNTRL/S) ; or supressed (CNTRL/O); if either of these conditions is true, HPFIX ; instructs the system to resume output to the plotter. ; ; Note: this must be privileged task in order to perform the the ; set multiple characteristics I/O function (SF.SMC) on a terminal other ; than TI:. Since executive functions are not required, /PR:0 is used. ; ; At task build time, LUN 1 is assigned to TI0: and LUN 2 to the HP plotter, ; via an indirect command file HPFIX.CMD. ;======================================================================== ;- .SBTTL MCALLs .MCALL DIR$,QIOW$,EXIT$S ; .SBTTL Local Symbol Definitions TILUN = 1 ; LUN for TI0: HPLUN = 2 ; LUN for HP plotter TIEFN = 1 ; Event flag for QIOW$ to TI0: HPEFN = 2 ; Event flag for QIOW$ to HP plotter ; .SBTTL Ascii Messages OK: .ASCII <12>/Plotter output is NOT SUSPENDED/<15> OKL = . - OK STUCK: .ASCII <12>/Plotter output SUSPENDED/<15> STUCKL = . - STUCK RELY: .ASCII <12>/RESUME instruction accepted/<15> RELYL = . - RELY RELN: .ASCII <12>/RESUME instruction NOT accepted/<15> RELNL = . - RELN QIOER: .ASCII <12>/QIOW$ SF.GMC or SF.SMC directive rejected/<15> QIOERL = . - QIOER .EVEN ; .SBTTL QIOW$ DPBs WRITE: QIOW$ IO.WVB,TILUN,TIEFN,,ISB GMCSMC: QIOW$ SF.GMC,HPLUN,HPEFN,,ISB,, ; .SBTTL Local Working Storage ISB: .BLKW 2 ; I/O status block for QIOW$ BUF: .BYTE TC.CTS ; SF.GCM and SF.SMC status buf .BLKB 1 ; TC.CTS status ; .SBTTL Entry Point ;======================================================================== ; Entry Point ; ; Register usage: ; R0 => Terminal QIOW$ for messages ; R1 => QIOW$ for SF.GMC and SF.SMC for the HP plotter ;======================================================================== HPFIX:: MOV #WRITE,R0 ; Point to the message DPB MOV #GMCSMC,R1 ; Point to the SF.GMC and SF.SMC DPB ; DIR$ R1 ; Get status of HP output suspension BCS ERROR ; CS => Directive error - quit TSTB BUF+1 ; Is it suspended or supressed? BNE 10$ ; NE => Yes - continue ; EQ => No - write HP ok message MOV #OK,Q.IOPL(R0) ; Set message starting address MOV #OKL,Q.IOPL+2(R0) ; and length DIR$ R0 ; Write it out BR DONE ; and quit ; ; Write HP suspended message 10$: MOV #STUCK,Q.IOPL(R0) ; Set message starting address MOV #STUCKL,Q.IOPL+2(R0) ; and length DIR$ R0 ; Write it out ; CLRB BUF+1 ; Set up for resume instruction MOV #SF.SMC,Q.IOFN(R1) ; Set function for SF.SMC DIR$ R1 ; and issue the instruction BCS ERROR ; CS => Directive rejected - quit ; ; See if it really worked MOV #SF.GMC,Q.IOFN(R1) ; Set up for SF.GMC again DIR$ R1 ; and determine the current status BCS ERROR ; CS => Directive rejected - quit ; TSTB BUF+1 ; Did it work? BNE 20$ ; NE => No - write error message MOV #RELY,Q.IOPL(R0) ; EQ => Yes - set YES message addr MOV #RELYL,Q.IOPL+2(R0) ; and length DIR$ R0 ; Write the message BR DONE ; and exit ; 20$: MOV #RELN,Q.IOPL(R0) ; Set NO message address MOV #RELNL,Q.IOPL+2(R0) ; and length DIR$ R0 ; Write the message BR DONE ; and exit ; .SBTTL QIOW$ SF.GMC and SF.SMC error message ERROR: MOV #QIOER,Q.IOPL(R0) ; Set error message address MOV #QIOERL,Q.IOPL+2(R0) ; and length DIR$ R0 ; Write the message ; .SBTTL Exit point DONE: EXIT$S ; Go home ; .END HPFIX