108 Chapter 4 Making Measurements
The following program transfers readings directly to the controller at the
fastest possible rate. This program configures the multimeter to take readings
at its maximum rate of >100k readings per second. Readings are output using
the SINT format. If the bus/controller cannot transfer readings at >200k bytes
per second, the reading rate will be slower.This is because, in the
high-speed mode, the multimeter waits until each reading is removed from
its output buffer before placing the next reading in the output buffer. In the
following program, the SYN trigger arm event is used to trigger the readings
(TRIG SYN could also be used). The SYN event is very important for
high-speed operation since it ensures the controller will be ready to accept
the first reading output by the multimeter. The TRANSFER statement (line
120) satisfies the SYN event and is the fastest way to transfer readings across
the GPIB, especially when used with the direct memory access (DMA) GPIB
interface.
10 OPTION BASE 1 !COMPUTER ARRAY NUMBERING STARTS AT 1
20 INTEGER Num_readings !DECLARE VARIABLE
30 INTEGER Int_rdgs(l:30000) BUFFER !CREATE INTEGER ARRAY FOR BUFFER
40 REAL Rdgs(l:30000) !CREATE REAL ARRAY
50 Num_readings=30000 !NUMBER OF READINGS = 30000
60 ASSIGN @Dvm TO 722 !ASSIGN MULTIMETER ADDRESS
70 ASSIGN Int_rdgs TO BUFFER Int_rdgs(*) !ASSIGN BUFFER I/O PATH NAME
80 OUTPUT @Dvm; "PRESET FAST" !TARM SYN,TRIG AUTO, DCV 10V
90 OUTPUT @Dvm;"APER 1.4E-6" !1.4µs INTEGRATION TIME
100 OUTPUT @Dvm; "OFORMAT SINT" !SINT OUTPUT FORMAT
110 OUTPUT @Dvm; "NRDGS"; Num_readings !30000 READINGS/TRIGGER, AUTO
115 !SAMPLE EVENT (DEFAULT VALUE)
120 TRANSFER @Dvm TO @Int rdgs;WAIT !SYN EVENT, TRANSFER READINGS INTO
121 !INTEGER ARRAY; SINCE THE COMPUTER'S INTEGER FORMAT IS THE SAME AS
125 !SINT,NO DATA CONVERSION IS NECESSARY HERE (INTEGER ARRAY REQUIRED)
130 OUTPUT @Dvm; "ISCALE?" !QUERY SCALE FACTOR FOR SINT FORMAT
140 ENTER @Dvm;S !ENTER SCALE FACTOR
150 FOR I=1 TO Num_readings
160 Rdgs(I)=Int_rdgs(I) !CONVERT EACH INTEGER READING TO REAL
165!FORMAT (NECESSARY TO PREVENT POSSIBLE INTEGER OVERFLOW ON NEXT LINE)
170 R=ABS(Rdgs(I)) !USE ABSOLUTE VALUE TO CHECK FOR OVLD
180 IF R>=32767 THEN PRINT "OVLD" !IF OVLD, PRINT OVERLOAD MESSAGE
190 Rdgs(I)=Rdgs(I)*S !MULTIPLY READING TIMES SCALE FACTOR
200 Rdgs(I)=OROUND(Rdgs(I),4) !ROUND TO 4 DIGITS
210 NEXT I
220 END
High-Speed Transfer
from Memory
Configuring the reading memory format (MFORMAT command) to match
the output format (OFORMAT command) helps to ensure command) to
match the fastest transfer of readings from reading memory to the controller.
This is because no conversion is necessary when the readings are recalled
from memory. For high-speed, low resolution readings (3.5 or 4.5 digits)
made on a fixed range, use the SINT format. (Because the SINT format uses
only 2 bytes per reading, multiple readings can be stored in memory and
transferred across the bus faster using the SINT output format than any other
format.) For the fastest transfer of high resolution readings (5.5 digits or
greater) made on a fixed range, use the DINT format. Whenever autorange
is enabled and transfer speed is critical, use the SREAL format (for readings
of 6.5 digits or less) or the DREAL format (for readings of 7.5 or 8.5 digits).
Disabling the display and any math operations will also ensure the fastest
transfer from reading memory to the controller.