Programming Examples - Keithley 2001 Operator's Manual

Multimeter
Hide thumbs Also See for 2001:
Table of Contents

Advertisement

When this message is sent, the path pointer moves down one
command level for the DELAY and TCONFIGURE
commands. The colon after the TCONFIGURE command
then moves the pointer down to the next command level and
enables PROTOCOL.
A few important points:
1. The path pointer can only move down. It cannot be
moved up a level. (Note: It can be reset to the root mode
by a preceding colon. For example, :ARM:LAY2:
SOUR MAN; :TRIG:SOUR MAN.)
2. Each new message (line) must begin with the root
command.
3. The colon at the beginning of a program message is
optional.
4. The end of a program message moves the path pointer
back to the root; so does a leading colon.
5. Any time one or more query commands are included in
a program message, the Model 2001 must be addressed
to talk to send the response message to the computer.
2.6.8

Programming examples

The following programming examples are written in the
Hewlett-Packard BASIC 4.0 programming language. The
programs assume that the Model 2001 is set to primary
address 16.
Programming example #1  Default DC voltage
reading
The following code fragment resets the Model 2001 to a
default configuration and gets a DC voltage reading:
100 OUTPUT 716;":syst:pres"
110 OUTPUT 716;":fetch?"
120 ENTER 716;A$
130 PRINT A$
Line 100 Return Model 2001 to :SYSTem:PRESet default
configuration (DC volts, autorange, 1 PLC, filter
enabled, 6.5 digits).
Line 110 Request new reading.
Line 120 Address to talk.
Line 130 Display reading, status, units, time-stamp,
reading number, and channel.
Programming example #2  High accuracy DC
voltage reading
The following code fragment configures the Model 2001 for
high accuracy DC voltage readings and gets one reading:
100 OUTPUT 716;":syst:pres"
2001-900-01 Rev. K/ August 2010
110 OUTPUT 716;":volt:dc:nplc 10"
120 OUTPUT 716;":fetch?"
130 ENTER 716;A$
140 PRINT A$
Line 100 Return Model 2001 to default configuration.
Line 110 Change integration time to 10 PLC (and
resolution to 7.5d).
Line 120 Request new reading.
Line 130 Address to talk.
Line 140 Display reading status, units, time-stamp,
reading number, and channel.
Programming example #3  High speed DC voltage
readings
The following code fragment configures the Model 2001 for
high speed DC voltage readings, stores 100 readings, and
sends the readings over the bus:
100 OUTPUT 716;":syst:pres"
110 OUTPUT 716;":volt:dc:nplc 0.01"
120 OUTPUT 716;":trac:clear"
130 OUTPUT 716;":trac:feed calc"
140 OUTPUT 716;":trac:egr full"
150 OUTPUT 716;":trac:poin 100"
160 OUTPUT 716;":trac:feed:cont next"
170 OUTPUT 716;":trac:data?"
180 ENTER 716;A$
190 PRINT A$
Line 100 Return Model 2001 to default configuration.
Line 110 Change integration time to 0.01 PLC.
Line 120 Clear all stored readings.
Line 130 Perform any math before storing readings.
Line 140 Store full data group (reading, reading number,
units, timestamp, status, and channel).
Line 150 Set buffer count to 100 readings.
Line 160 Start storing, stop when done.
Line 170 Request readings (default is reading only, ASCII
format).
Line 180 Address to talk.
Line 190 Display readings, status, units, time-stamps,
reading numbers, and channels.
Programming example #4  Burst speed DC voltage
readings
The following code fragment configures the Model 2001 for
burst speed DC voltage readings, stores 100 readings, and
sends the readings over the bus:
100 OUTPUT 716;":syst:pres"
110 OUTPUT 716;":syst:amet burs"
120 OUTPUT 716; "form:elem
stat"
Getting Started
read, rnum, unit,
2-17

Advertisement

Table of Contents
loading

Table of Contents