6
Command Reference
180 NEXT I
190 END
DINT format
The following program is similar to the preceding program except that it takes 50
readings and transfers them to the computer using the DINT format.
10 OPTION BASE 1 !COMPUTER ARRAY NUMBERING STARTS AT 1
20 INTEGER Num_readings,I,J,K !DECLARE VARIABLES
30 Num_readings=50 !NUMBER OF READINGS = 50
40 ALLOCATE REAL Rdgs(1:Num_readings) !CREATE ARRAY FOR READINGS
50 ASSIGN @Dvm TO 722 !ASSIGN MULTIMETER ADDRESS
60 ASSIGN dBuffer TO BUFFER[4*Num_readings] !ASSIGN BUFFER I/O PATH NAME
70 OUTPUT @Dvm;"PRESET NORM;RANGE 10;OFORMAT DINT;NRDGS";Num_readings
75 !TARM AUTO, TRIG SYN, DCV 10 V RANGE, DINT OUTPUT FORMAT, NRDGS
50,AUTO
80 TRANSFER @Dvm TO @Buffer;WAIT !SYN EVENT,TRANSFER READINGS
90 OUTPUT @Dvm; "ISCALE?" !QUERY SCALE FOR DINT
100 ENTER @Dvm; S !ENTER SCALE FACTOR
110 FOR I=1 TO Num_readings
120 ENTER @Buffer USING "#,W,W";J,K !ENTER ONE 16-BIT 2'S COMPLEMENT
121 !WORD INTO EACH VARIABLE J AND K (# = STATEMENT TERMINATION NOT
125 !REQUIRED; W= ENTER DATA AS 16-BIT 2'S COMPLEMENT INTEGER)
130 Rdgs(I)=(J*65536.+K+65536.*(K<0)) !CONVERT TO REAL NUMBER
140 R=ABS(Rdgs(I)) !USE ABSOLUTE VALUE TO CHECK FOR OVLD
150 IF R>2147483647 THEN PRINT "OVLD" !IF OVERLOAD OCCURRED, PRINT
MESSAGE
160 Rdgs(I)=Rdgs(I)*S !APPLY SCALE FACTOR
170 Rdgs(I)=DROUND(Rdgs(I),8) !ROUND CONVERTED READING
180 PRINT Rdgs(I) !PRINT READINGS
190 NEXT I
200 END
310
Keysight 3458A User's Guide