Storing Readings In Buffer - Keithley 2182 User Manual

Nanovoltmeter
Hide thumbs Also See for 2182:
Table of Contents

Advertisement

E-6
Example Programs

Storing readings in buffer

The reading buffer in the Model 2182 is flexible and capable. It has three controls, which are
found in the TRACe subsystem. There are commands to control:
The following example program sets up the Model 2182 to take 20 readings as fast as it can
into the buffer, and then reads the data back after the buffer has filled.
'Example program to demonstrate the reading buffer
'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 and put trigger model in IDLE state
CALL SEND(7, "*rst", status%)
'Reset STATus subsystem (not affected by *RST)
CALL SEND(7, "stat:pres;*cls", status%)
CALL SEND(7, "stat:meas:enab 512", status%)
CALL SEND(7, "*sre 1", status%)
CALL SEND(7, "trig:coun 20", status%)
'TRACe subsystem is not affected by *RST
CALL SEND(7, "trac:poin 20", status%)
CALL SEND(7, "trac:feed sens1;feed:cont next", status%)
'Start everything
CALL SEND(7, "init", status%)
'Initialize reading$ while the 2182 is busy taking readings
reading$ = SPACE$(4000)
WaitSRQ:
IF (NOT(srq%)) THEN GOTO WaitSRQ
CALL SPOLL(7, poll%, status%)
IF (poll% AND 64)=0 THEN GOTO WaitSRQ
CALL SEND(7, "stat:meas?", status%)
CALL ENTER(S$, length%, 16, status%)
CALL SEND(7, "form:elem read,unit" status%)
CALL SEND(7, "trac:data?", status%)
CALL ENTER(reading$, length%, 16, status%)
PRINT reading$
NOTE:
The size of the buffer (in readings).
TRACe:POINts <NRf>
Where the data is coming from (before or after the CALCulate1 math post-processing).
TRACe:FEED SENSe1
TRACe:FEED CALCulate1
Select buffer control mode.
TRACe:FEED:CONTrol NEVer
TRACe:FEED:CONTrol NEXT
To repeat buffer storage, send the following command and then repeat the steps
following the "Start everything" comment in the previous example.
CALL SEND(7, "feed:cont next", status%)
store unprocessed readings
store math processed readings
immediately stop storing readings
start now, stop when buffer is full
'enable BFL
'enable MSB

Advertisement

Table of Contents
loading

This manual is also suitable for:

2182a

Table of Contents