
Keysight M8070A Programming Guide
83
Programming Examples
3
M8070A Jitter Tolerance Measurement CSV Output
The following python script generates the results from all open jitter
tolerance measurements to different CSV files. This script can be easily
modified to generate the output of the highest-passing point at each jitter
modulation frequency value measured. This script can be run from the
M8070A Script Editor or can also be run externally.
# M8020A jtol CSV output
#
# Run from the M8070A script editor
def WaitForCompletion():
res = M8000.Scpi.Query(":syst:err?")
if (res != '0,"No error"'):
print res
WaitForCompletion()
M8000.Scpi.Timeout = 120000
# loop through all jitter tolerance measurements
for id in M8000.Scpi.Query(":PLUG:JTOL:CAT?").Split(','):
print "Measurement: " + id + ":"
results = M8000.Scpi.Query(":PLUG:JTOL:FETC:DATA? " + id).Trim('(',')').Split('
#print results
# size of results
print " " + str(len(results)) + " data items, " + str(int(len(results)/6)) + " rows;",
# if there are any rows (and not just a blank measurement), then
# use the name of the jtol measurement as the filename
# this will overwrite the file if it already exists!
# the file will be located in \Program Files (x86)\Agilent\M8070A\bin\, maybe
if (int(len(results)/6) == 0):
# nothing to write to file
print "no file created"
else:
with open(id.Trim('"').Replace(' ','_') + ".csv", 'w') as f:
# output header to file
f.write("Modulation Frequency (GHz),Sinusoidal Jitter (UI),Number of B
Ratio,Measurement results\n")