User manual
This programming example demonstrates a simple method to take and display (on the
computer CRT) a specified number of readings. The number of readings are specified by the
:SAMPle:COUNt command. When :READ? is asserted, the specified number of readings
are taken. After all the readings are taken, they are sent to the computer. Note that these
readings are also stored in the buffer.
The following program takes 10 readings on the DCV function and displays then on the
computer CRT.
‘ For QuickBASIC 4.5 and CEC PC488 interface card
‘ edit the following line to where the QuickBASIC libraries are
‘ on your computer
‘ $INCLUDE: ‘c:\qb45\ieeeqb.bi
‘ Initialize the CEC interface as address 21
CALL initialize(21, 0)
‘ Reset controls, clear buffer and place 2000 in idle
CALL SEND(16, “*rst”, status%)
CALL SEND(16, “trac:cle”, status%)
CALL SEND(16, “sample:coun 10”, status%)
CALL SEND(16, “form:elem read,unit”, status%)
CALL SEND(16, “read?”, status%)
reading$ = SPACE$ (300)
CALL ENTER(reading$, length%, 16, status%)
PRINT reading$
This example program illustrates the use of the Keithley Model 2000 DMM interfaced to
the RS-232 COM2 port. The Model 2000 is setup to take 100 readings at the fastest possible
rate (2000 per second). The readings are taken, sent across the serial port, and displayed
on the screen.
‘ Example program controlling the Model 2000 via the RS-232 COM2 port
‘ For QuickBASIC 4.5 and CEC PC488 interface card
RD$=SPACE$(1500) ‘ Set string space
CLS ‘ CLear screen
PRINT “Set COM2 baud rate to 9600”
PRINT “Set no flow control, and CR as Terminator”
‘ Configure serial port parameters
ComOpen$=”COM2:9600,8,1,ASC,CD0,CS0,DS0,LF,OP0,RS,TB8192,RB8192”
OPEN ComOpen$ FOR RANDOM AS #1
‘ Model 2000 setup commands
‘ Note Serial communications only operate with SCPI mode....
PRINT #1, “*RST” ‘ Clear registers
PRINT #1, “*CLS” ‘ Clear Model 2000
2000-900 (J - Aug 2010) BOOK.fm Page 12 Wednesday, October 12, 2011 12:29 PM