Other topics about Reading-Writing Measurement Data
Markers allow you to retrieve measurement results at your specified points only. Internal data arrays allow you to retrieve all measurement results throughout a particular trace.
In using markers to retrieve measurement results at specified points, you can use up to ten markers for each measurement graph, and you can move them to any point on the trace. You can also set any as a reference marker.
To show or hide each marker, use the following command (“xx” specifies any one of the measurements (AM,BB,PN,PS,SP,FP,TR,USER) while “y” specifies the number of the trace if the measurement has multiple traces.
• :CALC:xx[1-1]:TRAC[1-y]:MARK[1-10]:STAT
Turning on Reference Marker Mode sets the specified marker number as the reference marker and makes other markers relative with respect to it. To specify the reference marker and turn on or off Reference Marker mode, use the following command:
• :CALC:xx[1-1]:ALLT:MARK:REF:NUMB
• :CALC:xx[1-1]:ALLT:MARK:REF:STAT
To change along the frequency axis or retrieve the reference marker position, use the following command:
• :CALC:xx[1-1]:TRAC[1-y]:MARK[1-10]:X
When Reference Marker Mode is on, the x value at a regular marker is a relative value obtained by deducting its x value from the reference marker’s x value.
To retrieve the measurement results (response values) at a particular marker or the reference marker, use the following command:
• :CALC:xx[1-1]:TRAC[1-y]:MARK[1-10]:Y?
You can chose between the ASCII and binary data transfer formats when you retrieve internal data arrays. For more information, refer to Data Types for Data Transfer.
Using ASCII Transfer Format to Retrieve Internal Data Arrays and Using Binary Transfer Format to Retrieve Internal Data Arrays show sample programs that demonstrate how to retrieve formatted data arrays. The sample program in Using ASCII Transfer Format to Retrieve Internal Data Arrays uses the ASCII transfer format while the sample in Using Binary Transfer Format to Retrieve Internal Data Arrays uses the binary transfer format.
These sample programs show how to retrieve the formatted data arrays of measured phase noise.
Using ASCII Transfer Format to Retrieve Internal Data Arrays
110 REAL Fdata(1:1601),Freq(1:1601)
120 DIM Img$[30]
130 INTEGER Nop,I
140 ASSIGN @Agte5052 TO 717
150 OUTPUT @Agte5052;":SENS:PN:SWE:POIN?"
160 ENTER @Agte5052;Nop
170 PRINT "Number of Frequency points = ";Nop
180 REDIM Fdata(1:Nop),Freq(1:Nop)
190 OUTPUT @Agte5052;":FORM:DATA ASC"
200 OUTPUT @Agte5052;":CALC:PN1:TRAC1:DATA:FDAT?"
210 ENTER @Agte5052;Fdata(*)
220 OUTPUT @Agte5052;":CALC:PN1:DATA:XDAT?"
230 ENTER @Agte5052;Freq(*)
240 Img$="MD.4DE,2X,MD.6DE"
250 PRINT "Frequency Data"
260 FOR I=1 TO Nop
270 PRINT USING Img$;Freq(I),Fdata(I)
280 NEXT I
290 END
Using Binary Transfer Format to Retrieve Internal Data Arrays
110 REAL Fdata(1:1601),Freq(1:1601)
120 DIM Img$[30],Buff$[9]
130 INTEGER Nop,I
140 ASSIGN @Agte5052 TO 717
150 ASSIGN @Binary TO 717;FORMAT OFF
160 OUTPUT @Agte5052;":SENS:PN:SWE:POIN?"
170 ENTER @Agte5052;Nop
180 PRINT "Number of Frequency points = ";Nop
190 REDIM Fdata(1:Nop),Freq(1:Nop)
200 OUTPUT @Agte5052;":FORM:DATA REAL64"
210 OUTPUT @Agte5052;":CALC:PN1:TRAC1:DATA:FDAT?"
220 ENTER @Agte5052 USING "#,8A";Buff$
230 ENTER @Binary;Fdata(*)
240 ENTER @Agte5052 USING "#,1A";Buff$
250 OUTPUT @Agte5052;":CALC:PN1:DATA:XDAT?"
260 ENTER @Agte5052 USING "#,8A";Buff$
270 ENTER @Binary;Freq(*)
280 ENTER @Agte5052 USING "#,1A";Buff$
290 Img$="MD.4DE,2X,MD.6DE"
300 PRINT "Frequency Data"
310 FOR I=1 TO Nop
320 PRINT USING Img$;Freq(I),Fdata(I)
330 NEXT I
340 END