(FILECREATED " 5-AUG-82 14:55:00" {PHYLUM}<FIKES>LISP>8200SERVER.;3 3986   

      changes to:  (VARS 8200SERVERCOMS)

      previous date: " 6-JUL-82 11:52:10" {PHYLUM}<FIKES>LISP>8200SERVER.;2)


(PRETTYCOMPRINT 8200SERVERCOMS)

(RPAQQ 8200SERVERCOMS [(FNS * 8200SERVERFNS)
		       (MACROS * 8200SERVERMACROS)
		       (P (LOAD? (QUOTE EVALSERVER.DCOM])

(RPAQQ 8200SERVERFNS (ServerPush8200Button ServerRead8200))
(DEFINEQ

(ServerPush8200Button
  [LAMBDA (button)                                           (* ref: "18-MAR-82 09:55")

          (* Send a signal to the "8200" that will have the effect of pushing the panel button specified by "button". 
"button" can be an integer 0,1,...,9, one of the globally specified buttons (e.g., CopyModeButton), or one of the atoms 
	  Blank, Clear, Copy, CopyMode, Output, PaperTray, Reduction, StartPrint, or StopPrint.)


    (Clear8200)
    (WRITEPRINTERPORT (SELECTQ button
			       (1 2048)
			       (2 2049)
			       (3 2050)
			       (4 2051)
			       (5 2052)
			       (6 2053)
			       (7 2054)
			       (8 2055)
			       (9 1024)
			       (0 1032)
			       ((Blank BlankButton)
				 1040)
			       ((StartPrint StartPrintButton)
				 1048)
			       ((StopPrint StopPrintButton)
				 1056)
			       ((Copy CopyButton)
				 1064)
			       ((CopyMode CopyModeButton)
				 1072)
			       ((Reduction ReductionButton)
				 1080)
			       ((Clear ClearButton)
				 512)
			       ((PaperTray PaperTrayButton)
				 576)
			       ((Output OutputButton)
				 640)
			       (PROG [(fix (FIXSPELL button NIL '(Blank StartPrint StopPrint Copy 
									CopyMode Reduction Clear 
									PaperTray Output BlankButton 
									StartPrintButton 
									StopPrintButton CopyButton 
									CopyModeButton 
									ReductionButton ClearButton 
									PaperTrayButton OutputButton]
				     (RETURN (if fix
						 then (Push8200Button fix)
					       else (HELP "Unknown arg to Push8200Button" button])

(ServerRead8200
  [LAMBDA NIL                                                (* ref: " 6-JUL-82 11:43")
                                                             (* Read a 30 byte status report from the 8200 copier.
							     Return a list containing the 30 bytes..)
    (PROG (byte (array (ARRAY 30 'BYTE)))
          (Clear8200)
          (repeatwhile (LOGAND byte 4096)=0 do byte←(READPRINTERPORT))
          (for i to 30 do (repeatwhile (LOGAND byte 2048)=0 do byte←(READPRINTERPORT))
			  ((ELT array i)←(LSH (LOGAND 1 byte)
					      7)+(LSH (LOGAND 2 byte)
						      5)+(LSH (LOGAND 4 byte)
							      3)+(LSH (LOGAND 8 byte)
								      1)+(LSH (LOGAND 16 byte)
									      -1)+(LSH (LOGAND 32 
											     byte)
										       -3)+(LSH
			     (LOGAND 64 byte)
			     -5)+(LSH (LOGAND 128 byte)
				      -7)+ 0)
			  (until (LOGAND (READPRINTERPORT)
					 2048)=0))
          (if (ELT array 30)=2
	      then (repeatwhile (LOGAND byte 4096)=0 do byte←(READPRINTERPORT))
		   (for i to 18 do (repeatwhile (LOGAND byte 2048)=0 do byte←(READPRINTERPORT))
				   (if i gt 15
				       then ((ELT array i)←(LOGOR (ELT array i)
								  (LSH (LOGAND 1 byte)
								       7)+(LSH (LOGAND 2 byte)
									       5)+(LSH (LOGAND 4 byte)
										       3)+(LSH
								    (LOGAND 8 byte)
								    1)+(LSH (LOGAND 16 byte)
									    -1)+(LSH (LOGAND 32 byte)
										     -3)+(LSH
								    (LOGAND 64 byte)
								    -5)+(LSH (LOGAND 128 byte)
									     -7)+ 0)))
				   (until (LOGAND (READPRINTERPORT)
						  2048)=0)))
          (RETURN (for i to 30 collect (ELT array i])
)

(RPAQQ 8200SERVERMACROS (Clear8200))
(DECLARE: EVAL@COMPILE 

(PUTPROPS Clear8200 MACRO (NIL (PROGN (DISMISS 100)
				      (WRITEPRINTERPORT 256)
				      (DISMISS 100))))
)
(LOAD? (QUOTE EVALSERVER.DCOM))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (430 3747 (ServerPush8200Button 440 . 2009) (ServerRead8200 2011 . 3745)))))
STOP