Chapter 5 Digitizing 137
10OPTION BASE 1 !COMPUTER ARRAY NUMBERING STARTS AT 1
20Num_samples=256 !SPECIFY NUMBER OF SAMPLES
30INTEGER Int_samp(l:256) BUFFER !CREATE INTEGER BUFFER
40ALLOCATE REAL Samp(l:Num_samples) !CREATE REAL ARRAY FOR SAMPLES
50ASSIGN @Dvm TO 722 !ASSIGN MULTIMETER ADDRESS
60ASSIGN @Int_samp TO BUFFER Int_samp(*) !ASSIGN I/O PATH NAME TO BUFFER
70OUTPUT @Dvm;"PRESET DIG" !TARM HOLD, DCV, 10V RANGE, 256 SAMPLES
71 !PER TRIGGER, TIMER SAMPLE EVENT, TIMER INTERVAL = 20µs, TRIG
75 !LEVEL (0%, AC-COUPLED), 3µs INTEGRATION TIME, SINT FORMATS
80OUTPUT @Dvm;"TIMER 10E-6" !10µs INTERVAL BETWEEN SAMPLES
90OUTPUT @Dvm;"APER 1.4E-6" !MAXIMUM APERTURE FOR 100kHZ SAMP. RATE
100OUTPUT @Dvm;"MEM FIFO" !ENABLE READING MEMORY, FIFO MODE
110OUTPUT @Dvm; "TARM SYN" !SYNCHRONOUS TRIGGER ARM EVENT
120TRANSFER @Dvm TO @Int_samp;WAIT !SYN EVENT,TRANSFER READINGS INTO
121!READING MEMORY AND THEN INTO AN INTEGER ARRAY IN THE COMPUTER;
122!SINCE THE COMPUTER’S INTEGER FORMAT IS THE SAME AS SINT, NO DATA
123!CONVERSION IS NECESSARY HERE (INTEGER ARRAY REQUIRED)
130OUTPUT @Dvm; "ISCALE?" !QUERY SCALE FACTOR FOR SINT FORMAT
140ENTER @Dvm;S !ENTER SCALE FACTOR
150FOR I=1 TO Num_samples
160 Samp(I)=Int_samp(I) !CONVERT EACH INTEGER READING TO REAL
165 !FORMAT (NECESSARY TO PREVENT POSSIBLE INTEGER OVERFLOW ON NEXT LINE)
170 R=ABS(Samp(I)) !USE ABSOLUTE VALUE TO CHECK FOR OVLD
180 IF R>=32767 THEN PRINT "OVLD" !IF OVLD, PRINT OVERLOAD MESSAGE
190 Samp(I)=Samp(I)*S !MULTIPLY READING TIMES SCALE FACTOR
200 Samp(I)=DROUND(Samp(I),4) !ROUND TO 4 DIGITS
210NEXT I
220END
Direct-Sampling
Direct-sampling is similar to DCV digitizing in that samples are taken in
real-time with each successive sample spaced a specified time interval from
the preceding sample. The difference between the two is that direct sampling
uses the multimeter’s track-and-hold circuit and has a wider bandwidth input
path (12 MHz bandwidth). In addition, direct sampling has less trigger jitter
but greater measurement noise than DCV digitizing (see the Specifications
in Appendix A).
The track-and-hold circuit takes a very fast sample of the input signal and
then holds the value while the A/D converter integrates it. By using the track
and hold circuit, the width of each sample is reduced from a minimum of 500
nanoseconds for DCV to
2 nanoseconds for direct-sampling. This makes direct sampling idea1 for
applications such as capturing the peak amplitude of a narrow pulse. The
disadvantage of direct-sampling is a slower maximum sampling rate of
50,000 samples per second versus 100,000 for DC voltage.
You specify direct sampling using the DSAC or DSDC command. The
DSAC command selects AC-coupling, which measures only the AC
component of the input signal. The DSDC command selects DC-coupling,
which measures the combined AC and DC components of the input signal.
Figure 30 shows 20 samples made using direct sampling on a sine wave input
(the numbers indicate the order in which the samples were taken). With direct