Keithley 2000 User Manual page 244

Hide thumbs Also See for 2000:
Table of Contents

Advertisement

C-12
Example Programs
Taking readings using the :READ? command
This programming example demonstrates a simple method to take and display (on the com-
puter CRT) a specified number of readings. The number of readings are specified by the :SAM-
Ple: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 com-
puter CRT.
Controlling the Model 2000 via the RS-232 COM2 port
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.
' 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$
' Example program controlling the Model 2000 via the RS-232 COM2 port
' For QuickBASIC 4.5 and CEC PC488 interface card
RD$=SPACE$(1500)
CLS
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"
' Set string space
' CLear screen
' Clear registers

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents