Direct Sampling Example; Sub-Sampling - Agilent Technologies 3458A User Manual

Hide thumbs Also See for 3458A:
Table of Contents

Advertisement

Direct Sampling
Example
10OPTION BASE 1
20INTEGER Num_samples,I,J,K
30Num_samples = 200
35ASSIGN @Dvm TO 722
40ASSIGN @Buffer TO BUFFER [4*Num_samples]
45 !SAMPLES, (4-BYTES/SAMPLE * 200 SAMPLES = 800 BYTES)
50ALLOCATE REAL Samp(l:Num_samples)
60OUTPUT @Dvm;"PRESET FAST"
70OUTPUT @Dvm; "SWEEP 30E - 6,200"
80OUTPUT @Dvm; "DSDC 10"
90OUTPUT @Dvm;"LEVEL 250, DC"
100OUTPUT @Dvm;TRIG LEVEL"
110OUTPUT @Dvm; "MEM FIFO"
120TRANSFER @Dvm TO @Buffer;WAIT
130OUTPUT @Dvm; "ISCALE?"
140ENTER @Dvm;S
150FOR I=1 TO Num_samples
160 ENTER @Buffer USING "#,W,W";J,K
161 !WORD INTO EACH VARIABLE J AND K (# = STATEMENT TERMINATION NOT
165 !REQUIRED; W = ENTER DATA AS 16-BIT 2'S COMPLEMENT INTEGER)
170 Samp(I)=(J*65536.+K+65536.*(K<0))
180 R=ABS(Samp(I))
190 IF R>2147483647 THEN PRINT "OVLD"
200 Samp(I)=Samp(I)*S
210 Samp(I)=DROUND(Samp(I),8)
220 PRINT Samp(I)
230NEXT I
240END

Sub-Sampling

uses whichever command was specified last. (When using the SWEEP
command, the sample event is automatically set to TIMER.)
When direct-sampling an input signal with a frequency content ³ 1 MHz,
the first sample may be in error because of interpolator settling time. To
ensure the first sample is accurate, insert a 500ns delay before the first
sample (DELAY 500E-9 command).
The following program is an example of DC-couple direct-sampled
digitizing. The SWEEP command specifies an interval of 30µs and 200
samples. Level triggering is set for 250% of the 10V range (250% of 10V =
25V). The samples are sent to reading memory in DINT format. The samples
are then sent to the controller, converted, and printed. By deleting line 110,
samples will be transferred directly to the controller instead of using reading
memory. However, the controller and GPIB must be able to transfer samples
at a rate of at least 134k-bytes/second or the multimeter will generate the
TRIGGER TOO FAST error. Refer to "High-Speed Transfer Across the Bus"
in Chapter 4 for more information.
In sub-sampling (also known as sequential-sampling), the multimeter takes
one or more samples on each period of the input signal. With each successive
period, the beginning sample point is delayed further-and more samples are
taken. After a number of periods have occurred and the specified number of
samples have been taken, the samples can be reconstructed to form a
!COMPUTER ARRAY NUMBERING STARTS AT 1
!CREATE INTEGER VARIABLES
!200 SAMPLES
!DESIGNATE MULTIMETER ADDRESS
!SETUP CONTROLLER BUFFER FOR
!CREATE REAL ARRAY FOR SAMPLES
!DINT FORMATS, TARM SYN, TRIG AUTO
!30ms INTERVAL, 200 SAMPLES
!DIRECT-SAMPLING, 10V RANGE
!LEVEL TRIGGER AT 250% OF RANGE (25V)
!LEVEL TRIGGER EVENT
!ENABLE READING MEMORY, FIFO MODE
!TRANSFER SAMPLES TO CONTROLLER
!QUERY SCALE FACTOR FOR DINT FORMAT
!ENTER SCALE FACTOR
!ENTER ONE 16-BIT 2'S COMPLEMENT
!CONVERT TO REAL NUMBER
!USE ABSOLUTE VALUE TO CHECK FOR OVLD
!IF OVERLOAD OCCURRED, PRINT MESSAGE
!APPLY SCALE FACTOR
!ROUND CONVERTED READING
!PRINT READINGS
Chapter 5 Digitizing
139

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents