      SUBROUTINE NEWPEN(IPENSEL)
C
C	WRITTEN BY CINDY COOPER, JANUARY 4, 1982.
C
C	THIS SUBROUTINE IS USED TO SELECT A PEN
C	FOR THE HP7580A.  IPENSEL IS THE NUMBER OF
C	PEN TO BE SELECTED.  IF IPLTR IS NOT EQUAL
C	TO THE HP7580A, NO ACTION IS TAKEN.
C
      CHARACTER*8 STRING
C
$INCLUDE:'pxz99.cmn'
         COMMON /HPSIZE/ WIDTH,HEIGHT,ICOM
C
C	MAKE SURE PLOT BUFFER IS EMPTY
	CALL HPFORM
	NXYRS=0
C
C	COMMAND THE HP7580 TO PICK UP THE DESIRED PEN,
C	THEN PREPARE AGAIN FOR ABSOLUTE PLOTTING.
	IF (IPLTR .EQ. 6) THEN
		WRITE (STRING,100) IPENSEL
100             FORMAT(' ;SP',I1,';  ')
                IF (ICOM.EQ.0) THEN
                     WRITE(20,'(A)') STRING(1:8)
                ELSE
                     CALL SNDCHR(STRING,8,IER)
                ENDIF
	ENDIF
	RETURN
	END

