E-8
Example Programs
Controlling the Model 2182 via the RS-232 COM2 port
This example program illustrates the use of the Keithley Model 2182 interfaced to the RS-232
COM2 port. The Model 2182 is set up 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 2182 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 19200"
PRINT "Set no flow control, and CR as Terminator"
' Configure serial port parameters
ComOpen$="COM2:19200,N,8,1,ASC,CD0,CS0,DS0,LF,OP0,RS,TB8192,RB8192"
OPEN ComOpen$ FOR RANDOM AS #1
' Model 2182 setup commands
' Note Serial communications only operate with SCPI mode....
PRINT #1, "*RST"
' Clear registers
PRINT #1, "*CLS"
' Clear Model 2182
PRINT #1, ":INIT:CONT OFF;:ABORT"
' Init off
PRINT #1, ":SENS:FUNC 'VOLT:DC"
' DCV
PRINT #1, ":SENS:CHAN 1"
' Channel 1
PRINT #1, ":SYST:AZER:STAT OFF"
' Auto zero off
PRINT #1, ":SENS:VOLT:CHAN1:LPAS:STAT OFF"
' Analog filter off
PRINT #1, ":SENS:VOLT:CHAN1:DFIL:STAT OFF"
' Digital filter off
PRINT #1, ":SENS:VOLT:DC:NPLC 0.01"
' NPLC = 0.1
PRINT #1, ":SENS:VOLT:CHAN1:RANG 10"
' 10V range
PRINT #1, ":SENS:VOLT:DC:DIG 4"
' 4 digit
PRINT #1, ":FORM:ELEM READ"
' Reading only
PRINT #1, ":TRIG:COUN 1"
' Trig count 1
PRINT #1, ":SAMP:COUN 100"
' Sample count 100
PRINT #1, ":TRIG:DEL 0"
' No trigger delay
PRINT #1, ":TRIG:SOUR IMM"
' Immediate trigger
PRINT #1, ":DISP:ENAB OFF"
' No display
PRINT #1, ":INIT"
' Send init
SLEEP 1
' Wait one second
PRINT #1, ":FETCH?"
' Read query
LINE INPUT #1, RD$
' Get data
PRINT RD$
' Display data
PRINT #1, ":DISP:ENAB ON"
' Turn on display
PRINT #1, ":SYST:AZER:STAT ON"
' Auto zero on
'Clean up and quit.
finish:
CLOSE #1
' Close file
CLEAR
' Interface clear
END
Summary of Contents for 2182
Page 1: ...www tek com keithley Model 2182 2182A Nanovoltmeter User s Manual 2182A 900 01 Rev B May 2017...
Page 18: ......
Page 22: ......
Page 23: ...1 Getting Started Getting Started...
Page 41: ...2 VoltageandTemperature Measurements Voltageand Temperature Measurements...
Page 68: ...2 28 Voltage and Temperature Measurements...
Page 69: ...3 Range Digits Rate andFilter Range Digits Rate andFilter...
Page 82: ...3 14 Range Digits Rate and Filter...
Page 83: ...4 Relative mX b and Percent Relative mX b andPercent...
Page 91: ...5 RatioandDelta Ratioand Delta...
Page 117: ...6 Buffer Buffer...
Page 123: ...7 Triggering Triggering...
Page 140: ...7 18 Triggering...
Page 141: ...8 Limits Limits...
Page 149: ...9 SteppingandScanning Steppingand Scanning...
Page 168: ...9 20 Stepping and Scanning...
Page 169: ...10 AnalogOutput Analog Output...
Page 175: ...11 RemoteOperation Remote Operation...
Page 205: ...12 CommonCommands Common Commands...
Page 221: ...13 SCPISignalOriented Measurement Commands SCPISignalOri entedMeasure ment Commands...
Page 225: ...14 SCPIReferenceTables SCPIRefer enceTables...
Page 239: ...15 AdditionalSCPI Commands Additional SCPICom mands...
Page 260: ...15 22 Additional SCPI Commands...
Page 261: ...A Specifications Specifications...
Page 263: ...B Statusand ErrorMessages StatusandError Messages...
Page 268: ...B 6 Status and Error Messages...
Page 269: ...C Measurement Considerations Measurement Consider ations...
Page 278: ...C 10 Measurement Considerations...
Page 279: ...D Model182Emulation Commands Model182 EmulationCom mands...
Page 284: ...D 6 Model 182 Emulation Commands...
Page 285: ...E Example Programs ExamplePro grams...
Page 293: ...F IEEE 488 BusOverview IEEE 488Bus Overview...
Page 307: ...G IEEE 488andSCPI ConformanceInformation IEEE 488and SCPIConform anceInforma tion...
Page 310: ...G 4 IEEE 488 and SCPI Conformance Information...
Page 311: ...H Measurement Queries Measurement Queries...
Page 316: ...H 6 Measurement Queries...
Page 317: ...I Delta PulseDelta and DifferentialConductance Delta Pulse Deltaand Dif ferentialCon ductance...