E-6 Example Programs
IF (poll% AND 64)=0 THEN GOTO WaitSRQ
CALL SEND(14, "stat:meas?", status%)
CALL ENTER(S$, length%, 14, status%)
CALL SEND(14, "trac:data?", status%)
CALL ENTER(reading$, length%, 14, status%)
PRINT reading$
NOTE: To repeat buffer storage, send the following command and then repeat the steps fol-
lowing the 'Start everything comment in the above example.
CALL SEND(14, "feed:cont next", status%)
Taking readings using the :READ? command
This programming example demonstrates a simple method for taking and displaying (on the
computer CRT) a specified number of readings. The product of the arm count and trigger count
determines the number of readings to take. The *RST default for both counters is one. Therefore,
READ? will trigger and return one reading (1 × 1 = 1). If, for example, you want to take 10 read-
ings, you can set one of the counters to 10, while keeping the other counter set to one. READ?
will trigger and return 10 readings (10 × 1 = 10).
The following program takes 10 readings on the Volts function and displays them on the com-
puter 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 2182 in idle
CALL SEND(14, "*rst", status%)
CALL SEND(14, "trac:cle", status%)
CALL SEND(14, "trig:coun 10", status%)
CALL SEND(14, "form:elem read", status%)
CALL SEND(14, "read?", status%)
reading$ = SPACE$ (300)
CALL ENTER(reading$, length%, 14, status%)
PRINT reading$