	SUBROUTINE SAOCONVLT(IVAL)
C
C  Note:  This is the UNIX version.
C
C       This subroutine sends a packet to SAOimage via the Imtool protocol
C  to load a requested built-in video lookup table.
C  Custom lookup tables are loaded with SAO_LOAD_VLT.
C
C			Donald H. Gudehus, September 8, 1993
C			Version 2U, D. Gudehus, September, 1994
C			Converted code to work under UNIX
C			Version 3, D. Gudehus, July 25, 2006
C			Incorporated new saofacts.for
C
C	IVAL	(C)	The color lookup table code.  The following currently
C			exist:
C			'100'X  Black and white, single cycle
C			'200'X  Blackbody 
C			'300'X  High energy physics
C			'400'X  Eight colors with no overlap
C			'500'X  Table A
C			'600'X  Table B 
C			'700'X  Table C 
C			'800'X  Table D
C			'900'X  High constrast spectrum with rollover
C			'A00'X  Spectrum with white and rollover
C			'B00'X  Black and white with rollover
C
C  Custom lookup tables are loaded with SAO_LOAD_VLT
C
	INCLUDE 'saofacts.for'
C
	INTEGER*2 I2VAL
C
	I2VAL=IVAL
	IBUFFER_SAO(1)=256  ! imhead.tid,  no name
	IBUFFER_SAO(2)=-3  ! imhead.thingct = 3 words
	IBUFFER_SAO(3)=2  ! imhead.subunit = LUT
	IBUFFER_SAO(4)=0  ! imhead.checksum;  initially set to zero
	IBUFFER_SAO(5)=0  ! imhead.x
	IBUFFER_SAO(6)=0  ! imhead.y
	IBUFFER_SAO(7)=I2VAL  ! imhead.z
	IBUFFER_SAO(8)=0  ! imhead.t
	CALL IMTOOLCHECKSUM(IBUFFER_SAO)
	NBYTES=16
        CALL SI_WRITE(BUFFER_SAO,NBYTES)
	IBUFFER_SAO(1)=0
	IBUFFER_SAO(2)=0
	IBUFFER_SAO(3)=0
	NBYTES=6
        CALL SI_WRITE(BUFFER_SAO,NBYTES)
C
	RETURN
	END
