home *** CD-ROM | disk | FTP | other *** search
- .de
- .pa
- SAMPLE USER-DEFINED HELP FILE FOR USE WITH HELPME ROUTINE
-
-
- HELPME will check for any 3-character match with a line not having a " " in
- column 1.
-
- HELPME will dump the subsequent information to the CRT until a "$" is
- encountered in column 1.
-
-
- $USER-DEFINED HELP FILE
- GENERAL HELP INFORMATION
- PLOTS: TPLOT-based plot manager/command file builder
- ---------------------------- selected keywords ----------------------------
- ABOVE DASH HP2EPS MOVE QUIT SUPPRES
- ABSOLUTE DESTINATION HP2IBM NEWFILE STOP TEXT
- ALTER DISPLACE HP2LJET NEWLU REGULAR TICK
- ARROW D0TS HP2STAR NOAXES RELATIVE TICKL
- ASPECT DOTS ITALICS NOCOLOR SCALE TICKS
- BELOW DRAW LABEL NOLEGEND SHADE TILT
- BOUNDS END LETTERS NOTITLE SLANT UNDERLI
- BUFFER EXTRAX LINE NOXNUMS SOLID UPRIGHT
- CHARACTERS EXTRAY LOGX NOYNUMS SPLIT VECTOR
- CIRCLE FILES LOGY OVERRUN SPOTS WINDOW
- COLOR GRIDCOLOR LU PATTERN SUBSCRIPT XLOGX
- CONTOUR GRIDTYPE MINOR PLOT SUPERSCRIPT XLOGY
- -----------------------------------------------------------------------------
- Enter ?,keyword for help. Note that only the first three characters are
- significant (ie. "?,STO" and "?,STOP" are equivalent). If you have any
- other questions give me a call.
-
- To leave help and return to menu just hit Enter.
- $
- QUIT
- STOP
- HELP
- If you want to get back to the menu, just hit Enter.
- If you want to stop, just hit Enter twice.
- $
- FILES
- TPLOT requires at least one file: a command file. All command files should
- have the extension ".PLT" in order for PLOTS to be able to distinguish them
- from data files. Optionally, TPLOT can handle one or more data files for a
- given command file. I recommend giving these the extension ".DAT".
- $
- NEWLU
- NEWFILE
- TPLOT comes with a program called NEWLU.COM which will reassign the LU on the
- second line of every file with the extension ".PLT" to the specified number.
- The new LU must be one of the following: 186,286,386,486,7470,7475,7550. To
- run it from DOS, enter something like:
-
- NEWLU 286
-
- which, for instance, will set all examples to EGA.
-
- NEWFILE tells TPLOT to look in a different file for data (NOTE: NEWFILE is
- one of two PLOT commands that CAN'T come before the title - it comes after
- the last legend corresponding to the data read from the original file, after
- the NEWFILE command you must start over part of the command sequence - see
- the example "data from more than one file".
- $
- HP2EPS
- HP2IBM
- HP2LJET
- HP2STAR
- HP2EPS translates HP GLC commands to Epson dot matrix commands for a printer.
-
- HP2IBM translates HP GLC commands to IBM dot matrix commands for a printer.
-
- HP2LJET translates HP GLC commands to HP LaserJet II graphics commands.
-
- HP2STAR translates HP GLC commands to STAR dot matrix commands for a printer.
- $
- 12
- Error 12 occurs when more numbers were expected on a line than were read.
- $
- .pa
- EXAMPLE ILLUSTRATING THE USE OF RS232IO
-
-
- $STORAGE:2
- PROGRAM EXAMPLE1
- C
- C this program illustrates how to use RS232IO to "talk" to an HP pen plotter
- C
- IMPLICIT INTEGER*2(I-N)
- C
- C port parameters
- C
- DATA IPORT,NBAUD,NSTOP,NBITS,IPAR/1,9600,0,8,0/
- C
- C set up RS232 port
- C
- CALL SEPORT(IPORT,NBAUD,NSTOP,NBITS,IPAR)
- C
- C initialize plotter
- C
- CALL OUTPUT('IN;VS18;',IPORT,IERR)
- IF(IERR.NE.0) THEN
- CALL WRTTY('unable to initialize plotter<')
- GO TO 999
- ENDIF
- C
- C draw a 1"x1" box with pen 1
- C
- CALL OUTPUT('SP1;PU5000,3500;PD6000,3500;PD6000,4500;PD5000,4500;P
- &D5000,3500;PU;',IPORT,IERR)
- IF(IERR.NE.0) GO TO 999
- C
- C draw a 2"x2" box with pen 2
- C
- CALL OUTPUT('SP2;PU4000,2500;PD7000,2500;PD7000,5500;PD4000,5500;P
- &D4000,2500;PU;',IPORT,IERR)
- IF(IERR.NE.0) GO TO 999
- C
- C draw a 3"x3" box with pen 3
- C
- CALL OUTPUT('SP3;PU3000,1500;PD8000,1500;PD8000,6500;PD3000,6500;P
- &D3000,1500;PU;',IPORT,IERR)
- IF(IERR.NE.0) GO TO 999
- C
- C draw a 4"x4" box with pen 4
- C
- CALL OUTPUT('SP4;PU2000, 500;PD9000, 500;PD9000,7500;PD2000,7500;P
- &D2000, 500;PU;',IPORT,IERR)
- IF(IERR.NE.0) GO TO 999
- C
- C terminate plot and put the pen away
- C
- CALL OUTPUT('PU0,0;SP0;',IPORT,IERR)
- C
- 999 STOP
- END
- SUBROUTINE SEPORT(IPORT,NBAUD,NSTOP,NBITS,IPAR)
- C
- C set up RS232 port
- C
- IMPLICIT INTEGER*2(I-N)
- C
- C determine set up parameter
- C
- ISETUP=0
- IF(NBAUD.EQ.150) ISETUP = 32
- IF(NBAUD.EQ.300) ISETUP = 64
- IF(NBAUD.EQ.600) ISETUP = 96
- IF(NBAUD.EQ.1200) ISETUP = 128
- IF(NBAUD.EQ.2400) ISETUP = 160
- IF(NBAUD.EQ.4800) ISETUP = 192
- IF(NBAUD.EQ.9600) ISETUP = 224
- C
- IF(IPAR.EQ.1) ISETUP=ISETUP+8
- IF(IPAR.EQ.2) ISETUP=ISETUP+24
- C
- IF(NBITS.EQ.7) THEN
- IF(NSTOP.NE.0) ISETUP=ISETUP+4
- ISETUP=ISETUP+2
- ELSE
- ISETUP=ISETUP+3
- ENDIF
- C
- C send setup parameter to the port
- C
- CALL RS232IO(IPORT,0,ISETUP)
- C
- RETURN
- END
- SUBROUTINE OUTPUT(CBUF,IPORT,IERR)
- C
- C send a buffer to the plotter
- C
- IMPLICIT INTEGER*2(I-N)
- CHARACTER CBUF*(*)
- DIMENSION IREADY(3),IHAND(7)
- INTEGER*4 JSEC1,JSEC2
- LOGICAL*2 IFBRK
- DATA IREADY/27,46,79/
- DATA IHAND/27,46,78,49,48,48,58/
- C
- C determine buffer length
- C
- NBUF=LEN(CBUF)
- C
- C request extended hand-shake
- C
- CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- JSEC1=INT4(3600)*INT4(IHOUR)+INT4(60)*INT4(MIN)+INT4(ISEC)
- C
- DO 101 I=1,7
- 100 CALL RS232IO(IPORT,3,II)
- IF(IAND(II,16).EQ.0) THEN
- IF(IFBRK(0)) GO TO 102
- CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- JSEC2=INT4(3600)*INT4(IHOUR)+INT4(60)*INT4(MIN)+INT4(ISEC)
- IF(JSEC2-JSEC1.GT.INT4(60)) GO TO 103
- GO TO 100
- ENDIF
- 101 CALL RS232IO(IPORT,1,IHAND(I))
- GO TO 110
- C
- 102 CALL WRTTY('BREAK detected at keyboard... TEST aborted!<')
- 103 CALL WRTTY('plotter "hand-shake" request failed<')
- IERR=1
- GO TO 999
- C
- C check for buffer empty
- C
- 110 DO 112 I=1,3
- 111 CALL RS232IO(IPORT,3,II)
- IF(IAND(II,16).EQ.0) THEN
- IF(IFBRK(0)) GO TO 113
- CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- JSEC2=INT4(3600)*INT4(IHOUR)+INT4(60)*INT4(MIN)+INT4(ISEC)
- IF(JSEC2-JSEC1.GT.INT4(60)) GO TO 114
- GO TO 111
- ENDIF
- 112 CALL RS232IO(IPORT,1,IREADY(I))
- GO TO 120
- C
- 113 CALL WRTTY('BREAK detected at keyboard... TEST aborted!<')
- 114 CALL WRTTY('plotter not ready<')
- IERR=2
- GO TO 999
- C
- C wait for response from plotter
- C
- 120 IOK=0
- DO 121 ITRY=1,10000
- CALL RS232IO(IPORT,3,II)
- IF(IAND(II,256).EQ.0) GO TO 121
- C
- CALL RS232IO(IPORT,2,II)
- IF(II.EQ.13) GO TO 130
- IOK=IOK*10+IAND(II,255)-ICHAR('0')
- 121 CONTINUE
- C
- IF(IFBRK(0)) GO TO 122
- CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- JSEC2=INT4(3600)*INT4(IHOUR)+INT4(60)*INT4(MIN)+INT4(ISEC)
- IF(JSEC2-JSEC1.GT.INT4(60)) GO TO 123
- GO TO 110
- C
- 122 CALL WRTTY('BREAK detected at keyboard... TEST aborted!<')
- 123 CALL WRTTY('plotter did not respond to status inquiry<')
- IERR=3
- GO TO 999
- C
- 130 IF(IAND(IOK,8).EQ.0) GO TO 110
- NTEST=16
- C
- C dump buffer to RS232 port
- C
- 140 DO 142 I=1,NBUF
- 141 IF(IFBRK(0)) GO TO 143
- CALL RS232IO(IPORT,3,II)
- IF(IAND(II,NTEST).EQ.0) THEN
- CALL ATIME(IHOUR,MIN,ISEC,IHUN)
- JSEC2=INT4(3600)*INT4(IHOUR)+INT4(60)*INT4(MIN)+INT4(ISEC)
- IF(JSEC2-JSEC1.GT.INT4(60)) GO TO 144
- GO TO 141
- ENDIF
- 142 CALL RS232IO(IPORT,1,ICHAR(CBUF(I:I)))
- GO TO 999
- C
- 143 CALL WRTTY('BREAK detected at keyboard... TEST aborted!<')
- 144 CALL WRTTY('plotter would not accept buffer<')
- IERR=4
- C
- 999 RETURN
- END
- .ee