`
`{ewlett - Packard
`
`)esktOp Computer
`
`
`
`Page 1 of 100
`
`
`
`Matrix/Plotter Programming
`HP 983 1A Desktop Computer
`
`M
`
`
`
`Hewlett-Packard Calculator Products Division
`PO. Box 301, Loveland, Colorado 80537, Tel. (303) 667-5000
`(For World-wide Sales and Service Oilices see back of manual.)
`Copyright by Hewlett-Packard Company 1977
`
`Page 2 of 100
`
`
`
`Page 3 of 100
`
`Page 3 of 100
`
`
`
`
`
`
`
`
`
`HP Computer Museum
`www.hpmuseum.net
`
`
`
`
`For research and education purposes only.
`
`Page 4 of 100
`
`
`
`iii
`
`Table of Contents
`
`Chapter 1:
`
`Introduction
`
`Description of ROMS L
`
`.
`
`.
`
`V
`
`.
`
`,,,,,,,,,,,,,,,,,,,,,,,,,,, .
`
`L
`
`_
`
`,
`
`,
`
`_
`
`_
`
`Inspection and Installation ..................................... _
`
`_
`
`,
`
`L
`
`,
`
`,
`
`L
`
`L
`
`V
`
`,
`
`,
`
`L
`
`L
`
`L
`
`,
`
`_ 1
`
`L
`
`1
`
`SyntaxConventionsLV,,....................................... V.
`
`,.,,._,.,LL..L2
`
`Error Messages
`
`........................................ _
`
`,
`
`_
`
`............ 2
`
`Chapter 2: 9862A and 9872A Plotter Operation
`
`Plotter Operations ............................................................ 3
`The 9862A Plotter .....................................................
`L
`V
`L
`V
`. 4
`
`The 9872A Plotter ........................................................... 5
`
`Plotter Setup Procedure .............................. L.....
`Pen Installation ........................ ,.........................
`
`5
`6
`
`Loading Paper ......................... ................................ ,
`
`L
`
`.
`
`. 6
`
`SettingtheScalingPointsLVVVV.LVV.V.LVL.,L.V...LVL.L.,.VV.L
`
`,,,,,,,
`
`6
`
`Specifying the Plotter .......................................................... 7
`User-Units
`.......................................
`L
`\\\\\
`V
`.
`L, 8
`
`L, ....................................... V
`.
`,
`.
`Plotting Operations .
`The SCALE Statement L .................................. .
`
`,
`V
`
`_____
`L
`L
`L
`
`V
`
`.
`
`V
`.
`
`L 9
`9
`
`.
`
`L
`
`The AXIS Statements ...........................................
`
`,
`
`The PEN Statement .
`
`V
`
`L ............................................ .
`
`The PLOT Statement ......................................... ,
`
`The OFFSET Statement ..................................... L
`
`,
`
`V
`
`.
`
`L
`
`,
`
`.
`
`_
`
`_
`
`L
`
`L
`
`L
`
`.
`
`L
`
`,
`
`t 10
`
`L 12
`
`. 12
`
`L 15
`
`V
`
`_
`
`L
`
`L .................................... .
`
`L
`
`,,,,, 17
`
`The IPLOT Statement
`
`L
`
`Printing Operations .......................................... .
`
`TheLABELStatement,.,..LL.,.VL.L...L,VV,.,>.L,.L.L,VL_
`
`The CPLOT Statement ................................ V
`
`,
`
`.
`
`V
`
`,
`
`,
`
`,
`
`V
`
`V
`
`,
`
`V
`
`,
`
`,
`
`,
`
`_
`
`,
`
`.
`
`,
`
`_ 19
`
`_____ 19
`
`_
`
`V
`
`_
`
`V
`
`. 22
`
`VVVVVVVV L.L.L,L_L_..,,23
`TheCharacterSpace
`The LETTER Statement VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ,
`,
`L
`,
`,
`,
`,
`.
`. 29
`
`Chapter 3: Additional 9872A Operations
`
`Introduction
`
`WindowPlotting,,L,LL VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`Line Patterns ,
`
`. VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ,
`
`Character Slant
`
`....................................... _
`
`_
`
`Pen Selection VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV L
`
`,
`
`,
`
`V
`
`_
`
`,
`
`L
`
`Pen Velocity _
`
`, VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV _
`
`Changing Scaling Points. V
`
`L
`
`VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`L
`
`L
`
`_,31
`
`_31
`
`, 33
`
`35
`
`L
`
`, 36
`
`L 38
`
`_
`
`_ 38
`
`_
`
`L
`
`L
`
`,
`
`_
`
`,
`
`_
`
`,
`
`V
`
`,
`
`,,
`
`L
`
`,
`
`_.
`
`.
`
`,
`
`L
`
`V
`
`L
`
`,
`
`.
`
`,
`
`,
`
`.
`
`,
`
`L
`
`,
`
`L
`
`,
`
`V
`
`L
`
`Page 5 of 100
`
`Page 5 of 100
`
`
`
`Digitizing .
`
`V
`
`,
`
`_ ............................................................. 39
`
`Plotter Mnemonics .......................................................... 41
`
`TheTicLengthInstruction
`
`....................... 42
`
`The Automatic Pen Pick-Up Instruction ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 43
`
`CharacterSets
`
`........................... 44
`
`The Designate Standard Character Set Instruction ........................ 45
`
`The Designate Alternate Character Set Instruction ........................ 45
`
`The Select Standard Set Instruction ....................................... 45
`
`The Select Alternate Set Instruction ...................................... 46
`
`The LB Instruction ....................................................... 46
`
`The User Defined Character Instruction .................................. 46
`The Symbol Mode Instruction .............................................. 48
`
`TheAdaptivePenVelocityInstruction50
`
`The Normal Velocity Instruction .......................................... 50
`
`The Default Instruction ..................................................... 50
`
`The Initialize Instruction ................................................. 5o
`
`TheMaskInstruction,...,,l.y....h..H..,..i,W.t(MUHHS .............. 51
`
`The Output Status Instruction ................................... ............ 52
`
`Locating Current P1 and P2 .............................................. 52
`
`Chapter 4: Matrix Operations
`
`Description .................................................................... 53
`
`MatrixNames
`
`MatrixDefinition
`
`............ 53
`
`,,,,,,,,,,,,,,,,,,,,,,,,, 54
`
`Matrix Boundaries ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 55
`
`Redimensioning a Matrix ......................................... ,
`
`r
`
`,
`
`ttttttttt 55
`
`InputandOutputofMatrices
`
`............................... 56
`
`KeyboardDataInput .......................
`
`)_._.H.._56
`
`Data Input From a Program ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 57
`
`The MAT READ Statement .................................... ,
`
`A
`
`,
`
`a
`
`,
`
`,
`
`V
`
`,
`
`,
`
`.
`
`A
`
`__ 57
`
`‘‘‘‘‘ 58
`,
`r
`,
`,
`L
`,
`,
`L
`,
`,,
`,
`Printing Matrices ...................................... ._
`The MAT PRINT Statement ............................................... 58
`
`Matrix Arithmetic ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, x ......................... 59
`
`Matrix Addition ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,
`
`b
`
`,
`
`v
`
`,
`
`.
`
`,,
`
`,
`
`i
`
`. 59
`
`Matrix Subtraction ......................................................... 59
`
`Scalar Multiplication ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 59
`
`Copying Matrices ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, .
`
`q
`
`r
`
`,
`
`.
`
`.
`
`1 ....... 60
`
`Matrix Arithmetic Example ............................................... 60
`
`MatrixMultiplication..,M,....,H,.,H.4... ,,,,,,,,,,,
`
`.............. \62
`
`InSummary ...........................62
`
`Page 6 of 100
`
`Page 6 of 100
`
`
`
`V
`,
`V
`V
`Transposition of Matrices .................................. V
`The Constant Matrix .............................................. V
`
`V
`
`The Zero Matrix .................................................. ,
`
`.
`
`,
`.
`
`V
`
`,
`,
`
`,
`
`V
`
`,
`V
`
`V
`.
`
`,
`
`,
`
`V
`
`V 64
`V 65
`
`V 66
`
`V 66
`V
`V
`The Identity Matrix .................................................... V
`Inversion of Matrices ..................................................... 67
`
`Determinants.VVVV.VV.V.VVVV,V ...............................
`
`_______ V,68
`
`Chapter 5: Cross Referencing
`
`The Cross Reference Command ........................................ V
`
`,
`
`V
`
`V 71
`
`Appendix
`
`SyntaxSummaryVVVVVVVVVV..V ..........................
`ASCII Character Codes .................................
`
`V
`
`V
`
`V ,,
`V
`V
`V
`
`V V73
`V 80
`
`Sales and Service Offices
`
`.................................... V
`
`V
`
`V
`
`Subject Index ................................................. V
`
`,
`
`V
`
`,
`
`V
`
`V
`
`,
`
`V
`
`V
`
`,
`
`V
`
`V
`
`,
`
`,
`
`V
`
`V
`
`,
`
`V 82
`
`V 84
`
`V 86
`
`Error Messages VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ,VVVVVVVVVVVVVV V
`
`,
`
`V
`
`V
`
`, VVVV
`
`Figures
`
`ROM Installation V
`
`V
`
`V
`
`,
`
`V
`
`V
`
`.
`
`V VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`9862A Front Panel Controls VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ,,
`
`V
`
`V
`
`9872A Plotter Front Panel Controls VVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`V 1
`
`V 4
`
`V 5
`
`InitializedLocationofP1andP2.VVVVVV.VVVVVVVVVVVVVVVV.V,V VVVVVVV 6
`
`PlotofSin(X)/XVVVVVVVVVVVVVVVVVVVVV..VVVVV.VVVVV.V.VVV.VVVVVVVV,V
`
`VVVVV 14
`
`Sin X and Cox X Plotted with OFFSET VVVVVVVVVVVVVVVVVVVVVVVV V
`
`PlottingCrosseswithIPLOTV..VVVVVVVVV.VV..VVVVVVVVV VVVVVVVV
`
`V
`
`V
`
`V
`
`,
`
`V
`
`V
`
`,
`
`V
`
`V
`
`V
`
`V
`
`V
`
`,
`
`V
`
`,
`
`V
`
`,
`
`V 16
`
`,
`
`V
`
`V,
`
`,
`
`V
`
`,V,V18
`
`V
`
`,
`
`V 23
`
`Lettering FOCUS on the 9862A Plotter VVVVVVVVVVVVVVVVVVVVVVV ,
`
`9862ACharacterSpace .......
`
`______
`
`9872A Character Space, V
`
`V
`
`,
`
`V,
`
`V
`
`V
`
`V VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V
`
`Plot of Sin(X)/X with Labels VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V
`
`V
`
`V
`
`Angle of Rotation PlotV V
`
`. VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V
`
`Plot of Sin(X) with WINDOW VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`V
`
`,
`
`V
`
`V
`
`,
`
`V
`
`,,
`
`V
`
`V
`
`V
`
`,
`
`V
`
`V
`
`V
`
`.
`
`,
`
`V
`
`,
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V
`
`,
`
`VVVVV 24
`
`,
`
`V
`
`V
`
`V
`
`,
`
`V 24
`
`V 26
`
`,
`
`V 28
`
`V 32
`
`44,45
`
`Character Sets VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V
`
`CharacterGrid VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`User Defined Character Example VVVVVVVVVVVVVVVVVVVVVVVVVVVVVV ,
`
`,
`
`V
`
`,
`
`V
`
`V
`
`V
`
`V
`
`,
`
`Symbol Mode Plots V
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV
`
`Tables
`
`Table of 9872A Plotter Instruction Mnemonics VVVVVVVVVVVVVVVVVVVVVV V
`
`V
`
`VVV47
`
`,
`
`,
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V
`
`V 48
`
`V 49
`
`V 41
`
`Default Conditions VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV V
`
`V
`
`V
`
`V
`
`ASCII Character Codes VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV .
`
`V
`
`V
`
`VVVVVVVVV 50
`
`V
`
`V
`
`V,
`
`.
`
`V
`
`V,
`
`V
`
`V
`
`V 82
`
`Page 7 of 100
`
`Page 7 of 100
`
`
`
`Page 8 of 100
`
`Page 8 of 100
`
`
`
`Introduction
`
`Description of ROMS
`
`The 98223A or 98223B Matrix/Plotter plug-in ROM (Read-Only Memory) is supplied
`
`language. The 98223B ROM contains the same matrix instructions, but has 9872A
`Plotter statements.
`
`Inspection and Installation
`
`Either one of the ROMs can be plugged into any of the four ROM slots on the bottom
`
`front of the computer, as shown below.
`
`with the Matrix/Plotter Programming Manual (HP Part No. 09831-90021). The
`98223A ROM adds matrix instructions and 9862A Plotter statements to the HP 983 1A
`
`9862A and 9872A Plotters is also in the System Test Booklet.
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`ROM Installation
`
`Before installing a ROM, switch the computer off. Then, with the label right side up,
`
`slide the ROM through the ROM slot door. Press it in so that the front of the ROM is
`
`even with the front of the computer. Then switch the computer on.
`
`The test procedure for your ROM is in the System Test Booklet (HP Part No. 09831-
`
`90031) which is supplied with your desktop computer. The procedure to test the
`
`Page 9 of 100
`
`
`
`2
`
`Introduction
`
`Syntax Conventions
`
`The following conventions apply to the syntax for all Matrix/Plotter ROM statements
`found in this manual.
`
`
`
`[
`
`]
`
`All items in dot matrix are required, exactly as shown.
`
`All items in square brackets are optional, unless the
`brackets are in dot matrix.
`
`Three dots indicate that the previous item may be dup-
`licated.
`
`All Matrix/Plotter ROM statements can be executed from the keyboard or from a prog-
`
`ram, except where noted. All parameters shown in statements are values (i.e., they
`
`can be numbers, variables, or expressions). The LABEL statement is the only state-
`
`ment which contains a parameter that is not a value.
`
`Error Messages
`
`All error numbers generated by the Matrix/Plotter ROMS are in the 300 series. These
`
`errors are explained inside the back cover of this manual.
`
`NOTE
`
`Before using this manual, you should be familiar with
`
`the BASIC programming language used in the 9831A
`
`Desktop Computer, which is explained in the 9831A
`
`Operating and Programming Manual (HP Part No.
`
`09831-90000).
`
`Page 10 of 100
`
`Page 10 of 100
`
`
`
`9:
`eggs” is .y passable“? a sax
`a
`a as?
`,,
`fit
`Qifiggfigfiifiwmmgg
`
`The operations explained in this chapter apply to both the 9862A and 9872A Plotters.
`
`Those operations which apply only to the 9872A Plotter are explained in Chapter 3.
`
`Plotter Operations
`
`The Matrix/Plotter ROMS enable the 9831A Desktop Computer to control either the
`
`9862A Plotter or the 9872A Plotter. Both plotters provide you with hard copy graphic
`
`solutions to problems solved by the 9831A Desktop Computer.
`
`9862A and 9872A Plotter Operation
`
`instead of with respect to the origin.
`
`The plotter instruction set consists of plotting and printing operations.
`
`Plotting instructions are used to:
`
`0 Scale the units selected by the user and establish the origin point (0,0) anywhere
`
`on or off the plotting area.
`
`. Draw X and Y axes, of any length, anywhere on the plotting area.
`
`. Segment the axes by drawing tic marks at intervals selected by the user.
`
`0 Plot points with respect to a previously established origin.
`
`.Raise or lower the pen either before or after moving the pen to the point to be
`
`plotted.
`
`oOffset the origin point to any position and then plot with respect to that offset
`
`origin.
`
`oPlot in increments — plot each new point with respect to the last point plotted
`
`Page 11 of 100
`
`
`
`4
`
`9862A and 9872A Plotter Operation
`
`Printing instructions are used to:
`
`0 Print letters, digits, and other symbols.
`
`0 Specify character height, width, and printing angle.
`
`:
`
`0 Position the pen, with respect to the point to be labelled, using character spaces
`
`as the plotting units.
`
`0 Reference FORMAT statements to format printing.
`
`0 Establish a typewriter mode to control printing entirely from the keyboard.
`
`The 9862A Plotter
`
`Information concerning the 9862A Plotter is contained in the Peripheral Manual (HP
`
`Part No. 09862-900 12) for the plotter. Refer to that manual for information regarding
`
`plotter installation in the system, initial turn-on procedure and plotter maintenance.
`
`The following plotter set-up information is included here to provide you with informa-
`
`tion regarding the general use of your plotter once you have installed it.
`
`Before plotting, the plotter must be prepared and the physical limits of the plotting
`
`area must be established. The front panel controls on the plotter are used for this
`
`purpose.
`
`LINE CHART
`0mm) HOLD
`
`Luv:
`
`ERROR
`
`[1:13] DIE]
`
`.
`
`GRAPH LIMITS
`men PEN PEN UPPER
`LEFT Dom UP mam
`
`9882A Front Panel Controls
`
`LINE
`ONUN)
`
`0 Switch the plotter on by pressing D so that the white indicator lights up.
`CHART
`HOLD
`0 Press [:1 . Move the pen holder arm all the way to one side of the plotter and
`place a sheet of plotting paper on the surface of the plotter. Smooth out any
`
`irregularities in the paper.
`
`CHART
`HOLD
`
`0 Secure the plotting paper to the platen by pressing C] . Pressing it again
`releases the paper. The plotter cannot plot or letter when the paper is not secured.
`
`Page 12 of 100
`
`Page 12 of 100
`
`
`
`9862A and 9872A Plotter Operation 5
`
`Then set the limits of the plotting area on the paper by pressing the following keys in
`the order shown:
`
`LOWER
`LEFT
`[:1 and turn the two knobs at the left to manually adjust the
`oFirst press
`location of the lower-left limit of the plotting area.
`UPPER
`RIGHT
`
`[:1 and turn the two knobs at the right to manually adjust the
`oThen press
`location of the upper right limit of the plotting area.
`
`If the yellow ERROR light turns on when you’re setting either the lower-left or
`
`upper-right limit, reset the limit within bounds.
`
`Once you have set-up the plotting area limits, the plotting area can be relocated by
`
`moving the position of the lower-left limit. The upper-right limit will automatically be
`
`adjusted by the same direction and amount.
`
`The 9872A Plotter
`
`Information concerning power requirements, grounding, and plotter maintenance
`
`for the 9872A Plotter is contained in the HP 9872A Plotter Operating and Service
`
`Manual (HP Part No. 09872-90000) which is supplied with your plotter. The following
`
`plotter set-up procedure is included here for your convenience.
`
`Plotter Set-Up Procedure
`
`
`[Tun
`
`.
`v
` i223]
`H ”H .1 W w
`_1‘
`
`
`
`
`9872A Plotter Front Panel Controls
`
`Switch on the plotter with the power switch located on the front lower-right corner.
`
`After the plotter initialization is complete (the plotter arm has stopped moving), you
`
`can install the plotter pens.
`
`Page 13 of 100
`
`Page 13 of 100
`
`
`
`6
`
`9862A and 9872A Plotter Operation
`
`Pen Installation
`
` RingfitsintoS°t\\
`
`Select the color of pen that you want in pen storage location 1, remove the cap, and
`
`place it in the pen holder as shown in the picture above. Note that the thick ring
`
`around the middle of the pen fits into the slot in the pen holder. Now press
`and
`pen location button [I] . The plotter arm will put the pen in the first storage location.
`Repeat this procedure with the other pens substituting the appropriate empty pen
`location buttons for each one.
`
`Loading Paper
`To load a sheet of paper, first press I. This releases the paper hold-down
`mechanism and moves the plotter arm to the upper-right corner of the platen. Place a
`
`sheet of paper on the platen surface and smooth out any irregularities. Make sure that
`
`the paper is positioned squarely against the ridge at the bottom of the platen. Now
`
`press
`
`to activate the paper hold-down mechanism.
`
`Setting The Scaling Points
`
`The scaling points, P1 and P2, do not restrict the plotter arm motion, but are used to
`
`establish the scaling area used by the SCALE statement (see page 9 ). These points are
`
`also referenced by other plotter statements that specify such things as character size
`
`and line pattern length.
`
`Page 14 of 100
`
`Page 14 of 100
`
`
`
`9862A and 9872A Plotter Operation 7
`
`The plotter sets P1 and P2 as shown in the following figure when it is initialized.
`
`P2.
`
`Initialized Location of P1 and P2
`
`To relocate either or both of these points, use the following procedures:
`
`0 Position the pen at the new location using the plotter arm controls.
`
`0 When the pen is at the desired location, press
`
`if the point is to be lower-
`
`if the point is to be the upper-right. The coordinates for P1
`left, or press
`must be less than the coordinates of P2 or error 378 will occur when a SCALE
`
`statement is executed.
`
`Specifying The Plotter
`
`If the 9862A Plotter ROM or both the 9862A and 9872A Plotter ROMs are installed,
`
`the default select code is 5 when the 9831A Desktop Computer is first switched on.
`
`When only the 9872A Plotter ROM is installed, the default select code is 705. These
`
`select codes correspond to the factory select code settings on the interface cards. If the
`
`select code on the interface card is changed for any reason, a new select code must be
`
`specified by executing the Standard Plotter Statement. When the Standard Plotter
`Statement ( 3? ) is executed, all subsequent plotting operations take place at the
`
`specified select code.
`
`Syntax:
`
`
`
`[select code]
`
`Select codes 2 thru 15 can be used with the 9862A. Select codes used with the 9872A
`
`use the HP-IB (Hewlett-Packard Interface Bus) select code format:
`
`Page 15 of 100
`
`Page 15 of 100
`
`
`
`8
`
`9862A and 9872A Plotter Operation
`
`Odd
`or
`
`ccdd
`
`c or cc is a one or two digit number from 2 thru 15
`specifying the interface card select code.
`
`dd is a. two digit number from 00 thru 30 which
`specifies the device address of the 9872A Plotter on the
`HP-IB.
`
`When the STDPLT statement is executed without specifying a select code, the approp-
`
`riate default select code is set.
`
`Error 77 results if there is no peripheral at the select code specified. Select codes 0 and
`
`1 are reserved for the computer’s internal use and cannot be used for plotting opera—
`tions.
`
`Example statements:
`
`
`
`User-Units
`
`The user can designate his own units for plotting. The computer automatically scales
`
`(converts) these user-units to plotter-units (absolute units), which it uses to position
`
`the pen on the plotter surface.
`
`Units are specified, indirectly, by means of the SCALE statement (described next).
`
`First adjust the front panel controls on the plotter to establish graph limits which fit
`
`the size of the plotter paper. Next, use the scale statement to specify the values of the
`
`graph limits. Specifying the limits also determines the user-units; all subsequent
`
`plotting commands then use those units so that the user never has to concern himself
`
`with plotter-units. As an example, you might specify that the left edge of the graph
`
`represents — 10 and the right edge 100. This has the effect of dividing the horizontal
`
`axis into (in this case) 1 10 user—units. What the user-units represent is determined by
`
`you — they could be feet, centimeters, hours, or any other unit.
`
`Once the units for a plot have been established, the size of the plot can be changed to
`
`fit a larger or smaller sheet of plotter paper. This is done by resetting the GRAPH
`
`LIMIT controls on the 9862A Plotter or by resetting P1 and P2 on the 9872A Plotter. It
`
`is not necessary to change units because the computer will automatically rescale them
`
`to fit the new plotting area.
`
`Page 16 of 100
`
`Page 16 of 100
`
`
`
`9862A and 9872A Plotter Operation 9
`
`Plotting Operations
`
`The SCALE Statement
`
`The SCALE statement establishes the full-scale values, in user-units, for the plot. Xmin
`
`to Xmsx and Ymin to Ymax correspond exactly to the respective limits of the horizontal and
`
`vertical edges of the plotting area (the area is established mechanically, as previously
`
`described). This also establishes the point, on or off the plotting area, where the origin
`
`(point 0,0) of the coordinate system is located.
`
` Xmin 55 Xmax E5 Ymin 55 Ymax
`
`A SCALE statement must be executed before any plotting can occur. Once established,
`
`the scale remains established until one of the following occurs:
`
`0 A new SCALE statement is executed.
`
`0 The program is initialized.
`
` , or
`
`is executed.
`
`o The computer is switched off.
`
`The parameters in a SCALE statement must be given in the correct sequence. If the
`
`minimum and maximum values are switched, subsequent plotting commands may not
`
`be executed properly.
`
`Example statements:
`
`
`
`Page 17 of 100
`
`Page 17 of 100
`
`
`
`10
`
`9862A and 9872A Plotter Operation
`
`The AXIS Statements
`
`The AXIS statements draw an X-axis or Y-axis according to the parameters given in
`
`the statement. The pen is automatically raised before moving to the start point, and
`
`again after drawing the axis.
`
`Syntax:
`
` Y-offset [ as + or — tic [ as start point as end point]]
`
`X-offset [ 32 + or — tic [ as start point is end point]]
`
`
`
`NOTE
`
`The following describes the X-axis; the same informa—
`
`tion is applicable to the Y-axis if “left” and “right” for
`
`the X-axis are read as “bottom” and “top”, respectively,
`for the Y—axis.
`
`1.
`
`If no optional parameters are given, a straight line is drawn from left to right
`
`across the complete plotting area (from Xmin to Xmax). The line crosses the Y-axis
`
`at the point specified by the value of the Y-offset.
`
`2.
`
`If a tic parameter is included, tic marks are made along the axis as it is drawn;
`
`the value of the tic parameter determines the spacing, in user—units, between
`
`tics. The first tic is drawn at the starting point of the line. The tic parameter is
`
`usually positive (the plus sign is optional), but a negative tic spacing can also be
`
`used - see 4, below.
`
`3.
`
`If the start point and end point parameters are given, then the axis is drawn
`
`only between those points; that is, from the start point to the end point. If the
`
`start point parameter is less than the end point parameter, then the axis is
`
`drawn from left to right. If the start point parameter is greater than the end
`
`point parameter, then the axis is drawn from right to left.
`
`Page 18 of 100
`
`Page 18 of 100
`
`
`
`9862A and 9872A Plotter Operation 1 1
`
`4. A tic parameter which has a positive value results in:
`
`a. Normal tic spacing if the axis is drawn from left to right.
`
`b. A tic only at the right end of the axis if the axis is drawn from right to left.
`
`A negative tic value results in:
`
`a. A tic at the left-end of the axis if the axis is drawn from left to right.
`
`b. Normal tic spacing if the axis is drawn from right to left.
`
`5.
`
`If an OFFSET statement has previously been given, then all of the optional
`
`parameters must be included in any AXIS statement.
`
`A possible problem exists with the 9862A Plotter operation. In the SCALE statement,
`
`the values for Xmin, Xmax, Ymin, and Ymax are defined. If, in the AXIS statement, the value
`
`for the optional parameters, “start point” and “end point” are omitted, the values used
`
`are computed from the values defined in the SCALE statement. A scale factor (SF) and
`
`an adjustment number (A) are computed in the SCALE statement.
`
`SF = [9999 / (Xmax—Xmin)]
`
`A = SF * Xmin
`
`When the AXIS statement is executed, the value of Xmin is recomputed using the for-
`mula:
`
`Xmin : A/SF
`
`If the recomputed value generated by the computer is less than the actual Xmin defined
`
`in the SCALE statement, error 382 will occur. To avoid this possible problem, define
`
`all of the parameters in the AXIS statement.
`
`Example statements:
`
`
`
`Page 19 of 100
`
`Page 19 of 100
`
`
`
`12
`
`9862A and 9872A Plotter Operation
`
`The PEN Statement
`
`Syntax:
`
`
`
`The PEN statement is used to raise the pen without otherwise changing the pen posi-
`
`tion relative to the plotting area. A control parameter to raise or lower the pen, either
`
`before or after pen movement, can also be included in two other statements (see PLOT
`
`and IPLOT).
`
`The PLOT Statement
`
`The PLOT statement moves the pen to the point specified by the X-coordinate and
`
`Y-coordinate parameters.
`
`Syntax:
`
`...
`
`1
`
`
`
`X coordinate 55 Y coordinate [55 Pen CODtI'Ol]
`
`When no optional pen control parameter is given:
`
`0 If the pen was raised, it moves to the point specified and then lowers, marking a
`
`point on the paper.
`
`0 If the pen was lowered, it remains lowered while moving to the point specified,
`
`thus drawing a straight line on the paper.
`
`The value and sign of the pen control parameter in the PLOT statement determines
`
`whether the pen will be raised or lowered before or after it moves to the specified point.
`
`If the parameter is:
`
`An odd, positive integer -
`
`The pen lifts before moving.
`
`An odd, negative integer -
`
`The pen lifts after moving.
`
`An even, positive integer -
`
`The pen lowers before moving.
`
`An even, negative integer -
`
`The pen lowers after moving.
`
`0 -
`
`No change.
`
`No parameter -
`
`The pen remains in its present position (raised or low-
`
`ered), moves to the point specified, and lowers or re-
`mains down.
`
`Page 20 of 100
`
`Page 20 of 100
`
`
`
`9862A and 9872A Plotter Operation 13
`
`The value of the control parameter can be any number in the range + or —32767. If the
`
`value is not an integer, then it is automatically rounded up or down; (rounding is the
`
`same as the standard rounding in the computer).
`
`When plotting a function, it is sometimes useful to use a pen control parameter of zero
`
`in your PLOT statements so that you can make a dummy plot. First, raise the pen by
`
`pressing the PEN UP control on the plotter. Then run the part of the program which
`
`plots the function and watch the course of the pen over the plotter paper. If the pen
`
`movement does not appear to be correct, you can make any necessary changes to your
`
`program. When your program appears to be plotting correctly, stop the program,
`
`press PEN DOWN on the plotter and rerun the program to actually draw the plot.
`
`Plotting a Function
`
`This program plots the function (SIN X)/X. The scale is chosen to fit a sheet of 7 by 10
`
`inch plotter paper. However, the plot can be made on any size of paper, up to the
`
`plotter limits.
`
`Before running this program, be sure that the plotter is set-up for the size of paper
`
`you are using. The figure on the next page shows the plot resulting from this program
`
`— the height to width ratio of your plot may vary from that shown, depending on the
`
`dimensions of your paper.
`
`
`
`Page 21 of 100
`
`Page 21 of 100
`
`
`
`14
`
`9862A and 9872A Plotter Operation
`
`ESZOS-Q—GLS
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Plot of Sin(X)/X
`
`When you run the program, notice that the last point is not plotted. This is not an
`
`error, but results because the user-unit chosen, PI, is not an exact value. In this case
`
`(line 40) the method used to obtain the value of 5*PI for the FOR...NEXT loop (i.e., by
`
`incrementing, in steps of PI/20) results in a value which is slightly larger than the
`
`value obtained by simply multiplying 5 by PI. Thus the last point is assumed to be
`
`outside the range of the FOR...NEXT loop and is not plotted. The last required point
`
`(5*PI) will be plotted if line 40 is changed to:
`
`
`
`Whether or not this type of over-range is required for other plots depends upon the
`
`units used and can be easily ascertained by experimenting.
`
`Another version of this graph is shown later in this chapter in a printing example that
`
`illustrates labelling graphs.
`
`Page 22 of 100
`
`Page 22 of 100
`
`
`
`9862A and 9872A Plotter Operation 15
`
`The OFFSET Statement
`
`The OFFSET statement moves the origin (point 0,0) of the coordinate system to the
`
`point specified by the X-coordinate and Y-coordinate parameters. Subsequent plotting
`
`instructions are then made with respect to the new origin until that origin is changed
`
`by means of , for example, a new OFFSET or a new SCALE statement.
`
`Syntax:
`
` Xcoordinate 55 Ycoordinate
`
`OFFSET statements are not cumulative; that is, a new offset is made with respect to
`
`the original origin and not with respect to the last offset origin.
`
`Offsetting greatly simplifies plotting from the user’s point of view. For example, it
`
`sometimes becomes necessary to divide the plotting area into smaller segments and
`
`make a separate plot in each segment. While plotting in each segment, it is not neces-
`
`sary for the user to correct each point before plotting it. Instead, the OFFSET state-
`
`ment moves the origin to the specified point within that segment. The computer then
`
`automatically makes the necessary corrections for each point to be plotted.
`
`Plotting with Offset
`
`This program illustrates the use of the OFFSET statement. The purpose of this prog-
`
`ram is to make two plots, side-by—side, of different functions over the same range — in
`
`this case, SIN X and COS X over the range of — 180 to 180 degrees (see the next figure).
`
`OFFSET is used in lines 30 and 80 to move the origin (0,0) of the graph. This enables
`
`the same AXIS statements (lines 150 and 160) to be used for both plots. The two
`
`FOR..NEXT loops (starting at lines 50 and 100) also have the same range.
`
`The program is scaled to plot on a sheet of 7 by 10 inch paper; as in the previous
`
`example, other sizes of paper can be used.
`
`Page 23 of 100
`
`Page 23 of 100
`
`
`
`16
`
`9862A and 9872A Plotter Operation
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`BEZOS—E—Gis
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`Sin X and Cos X Plotted with OFFSET
`
`Page 24 of 100
`
`Page 24 of 100
`
`
`
`9862A and 9872A Plotter Operation 17
`
`The IPLOT Statement
`
`The IPLOT (Incremental Plot) statement moves the pen from its current position in the
`
`X and Y direction, by the amounts specified by the X-increment and Y-increment
`
`parameters.
`
` Xincrement 55 Yincrement [ 5E Pen COIltI'Ol]
`
`The pen control parameter is optional and operates exactly as described previously —
`see the PLOT statement.
`
`The IPLOT statement plots a point with respect to the previously plotted point and not
`
`with respect to the origin (0,0) of the graph. The IPLOT statement is very useful when
`
`drawing regular geometric shapes such as a cross. In cases like this, it is easier to plot
`
`each point relative to the current position of the pen than it is to plot each point
`
`relative to the origin of the graph.
`
`Executing the IPLOT statement immediately after the SCALE statement causes plot-
`
`ting to start at P1 on the 9872A or at the lower-left on the 9862A.
`
`When an IPLOT statement is executed immediately after printing a letter or other
`
`character on the plotter, the pen movement is related to the last plotted position and
`
`not to the current position of the pen. “Plotted position” refers to a point plotted either
`
`by a PLOT statement or by an IPLOT statement.
`
`Incremental Plotting
`
`This program illustrates use of the IPLOT statement to plot incrementally. The prog-
`
`ram uses a subroutine to plot crosses at different locations on the paper (see the figure
`
`on the following page). Before each cross is plotted, an OFFSET statement moves the
`
`pen to the desired position. IPLOT statements are then used to plot the coordinates of
`
`each point of the cross relative to the previous plotted point. As can be seen from this
`
`example, plotting a regular shape is much easier to program with incremental plot-
`
`ting than it would be if the coordinates of each point had to be computed with respect
`
`to a fixed origin.
`
`The scale assumes '7 by 10 inch plotter paper. If the height to width ratio of the paper
`
`to be used differs from 7:10, then the crosses will not be square. However, they will be
`
`drawn square if you change the parameters in the S