Programming Basics
Getting Started
To Read Sweep Measurement Data
For the sweep measurements, the measurement data will be put into the data output
buffer after every step measurement. You can read the data as shown below. The
examples use the VISA COM library and Microsoft Visual Basic .NET language.
For the data output format, see
•
To read data after sweep measurement
This way waits for the measurement completion by using the *OPC? command
after the XE command, and reads the sweep data (all step measurement data) at
once after the sweep measurement is completed. For the specific example, see
Table 3-5 on page
3-19.
Example:
E5270.WriteString("FMT 5,0" & vbLf)
E5270.WriteString("XE" & vbLf)
E5270.WriteString("*OPC?" & vbLf)
rep = E5270.ReadString(1 + 2)
ret_val = E5270.ReadString(16 * nop)
For i = 0 To nop - 1
head = Mid(ret_val, 16 * i + 1, 3)
mdata = Val(Mid(ret_val, 16 * i + 4, 12))
ddata = "Data = " & mdata & ", Header = " & head
Console.WriteLine(ddata)
Next i
•
To read data after every step measurement
This way starts to read the data after the XE command. You do not need to wait
for the sweep measurement completion. So you can check the result data before
the sweep measurement is completed. For the specific example, see
page
3-22.
Example:
E5270.WriteString("FMT 5,0" & vbLf)
E5270.TerminationCharacter = Chr(44)
E5270.TerminationCharacterEnabled = True 'enables comma
E5270.WriteString("XE" & vbLf)
For i = 0 To nop - 1
ret_val = E5270.ReadString(3 + 12 + 1)
head = Left(ret_val, 3)
mdata = Val(Mid(ret_val, 4, 12))
ddata = "Data = " & mdata & ", Header = " & head
Console.WriteLine(ddata)
Next i
1- 16
Keysight E5260/E5270 Programming Guide, Edition 4
"Data Output Format" on page
'nop=number of sweep steps
'nop=number of sweep steps
1-22.
'terminator=comma
'Response+CRLF
Table 3-6 on
'terminator=comma
'Chr(44)=comma