Measurement Computing Personal488 rev.3.0 For DOS & Windows 3.Xi User Manual
Page 180
![background image](https://www.manualsdir.com/files/797818/content/doc180.png)
II. SOFTWARE GUIDES - 9. Driver488/SUB
9F. QuickBASIC
Personal488 User’s Manual, Rev. 3.0
II-165
‘ Read the Driver488/SUB revision number
response$ = SPACE$ (256)
rv% = ioHello% (ieee%, response$)
PRINT response%
‘ Set up interrupt pointers
ON PEN GOSUB isr
PEN ON
rv% = ioLightPen% (ieee%, 1)
‘ Enable Driver488/SUB interrupt on Error or Service Request
rv% = ioArm% (ieee%, acSRQ)
‘ Display the Driver488/SUB system status
rv% = ioStatus% (ieee%, substat)
CALL showstat (substat)
‘ Put the ADC488 into remote mode
rv% = ioRemote% (adc%)
‘ Clear the AC488
rv% = io Clear% (adc%)
‘ Enable ADC488 SRQ on command errors
rv% = ioOutput& (adc%, “M8X”)
‘ Send an invalid command to the ADC488
PRINT “Sending invalid ADC command”
rv% = ioOutput & (adc%, “V13X”)
‘ Setup the ADC488:
‘ Differential inputs (a0)
‘ Scan group channel 1 (C1)
‘ Compensated ASCII floating-point output format (G0)
‘ Channel 1 range to +/-10V (R3)
‘ One-shot trigger on talk (T6)
rv% = ioOutput& (adc%, “A0C1G0R3T6X”)
‘ Wait for the ready bit of the ADC488 to be asserted
WHILE ((ioSPoll%(adc%) AND 32) = 0) : WEND
‘ Display a reading
response$ = SPACE$ (256)
rv% = ioEnter& (adc%, response$)
voltage ! = VAL (response$)
PRINT “ADC488 channel #1 reading value is “; voltage!
‘ Display the average of 10 readings
sum ! = 0!
FOR i = 0 TO 9
response$ = SPACE$ (256)
rv% = ioEnter& (adc%, response$)
voltage ! = VAL (response$)
sum ! = sum! + voltage !
NEXT i
PRINT “The average of 10 readings is “; sum! / 10!
‘ Set up the ADC488 :
‘ Compensated binary output format (G10)
‘ 100uSec scan interval (I3)
‘ No pre-trigger scans, 100 post-trigger scans (n100)
‘ Continuous trigger on GET (T1)
rv% = ioOutput& (adc%, “G10I3N100T1X”)