DECLARE SUB psdac488savev (ctrl%, v!) DECLARE SUB psdac488setupcv (c%) '**************************************************************************** 'Module PSDAC488 'This module contains I/O subroutines for the IOtech DAC488/4. 'It is primarily intended for the DAC controlling the three main power 'supplies in bldg 26. ' 'Zachary Wolf '7/23/95 '**************************************************************************** SUB psdac488digout (linenum%, lohi%) '**************************************************************************** 'This subroutine has the IOTech DAC488 output a TTL level on digital line 'number linenum% (1 to 8). ' 'Input: ' linenum%, line number 1 to 8 ' lohi%, TTL level 0 or 1 ' 'Zachary Wolf '6/24/94, 7/19/95 '**************************************************************************** END SUB SUB psdac488getcv (c%, v!) '**************************************************************************** 'This subroutine gets the output voltage from the IOTech DAC488 analog output 'channel # c%. ' 'Input: ' c%, the DAC channel to read the voltage from ' 'Output: ' v!, the DAC voltage which is being output ' 'Zachary Wolf '4/19/94, 9/10/94, 7/19/95 '**************************************************************************** 'Get the current value of the DAC voltage CALL psdac488savev(0, v!) END SUB SUB psdac488init '**************************************************************************** 'This subroutine initializes the IOTech DAC488. ' 'Zachary Wolf '6/24/94, 7/19/95 '**************************************************************************** 'Message PRINT PRINT "Resetting the DAC routine..." END SUB SUB psdac488savev (ctrl%, v!) STATIC vsave! IF ctrl% = 0 THEN v! = vsave! ELSEIF ctrl% = 1 THEN vsave! = v! END IF END SUB SUB psdac488setcv (c%, v!) '**************************************************************************** 'This subroutine has the IOTech DAC488 output a voltage v! on channel c%. ' 'Input: ' c%, the DAC488 channel (1 to 4) to output the voltage on ' v!, the voltage to output ' 'Zachary Wolf '9/10/94, 7/19/95 '**************************************************************************** 'Test values dacaddr$ = "dacaddr" IF v! < .05 THEN volt$ = "0" ELSEIF v! >= .05 AND v! < .1 THEN volt$ = ".05" ELSE volt$ = STR$(v!) END IF 'PRINT "output " + dacaddr$ + ";V"; 'PRINT USING "###.#####"; v!; 'PRINT " X" 'Message 'PRINT "V dac = "; v! 'Save the value CALL psdac488savev(1, v!) END SUB SUB psdac488setpar (gpibin%, gpibout%, psdac488addr$) END SUB SUB psdac488setupcv (c%) '**************************************************************************** 'This subroutine sets up the IOTech DAC488 for static DC output. ' 'Input: ' c%, channel number (1 to 4) to set up ' 'Zachary Wolf '9/10/94, 7/19/95 '**************************************************************************** END SUB