Synchronizing Acquisitions
36
Keysight P9241/42/43A Oscilloscopes SCPI Programmer's Guide
1191
time.sleep(0.1)
# Pause 100 ms to prevent excessive queries
# This can actually be set a little faster, at 0.045.
The
# point here is that:
#
#
1.
If there are other things being controlled, going too
#
fast can tie up the bus.
#
2.
Going faster does not work on all scopes.
The
#
symptom of this not working is:
#
# The oscilloscope SHOULD trigger, but it sits there with the
# Single hard key on the oscilloscope lit yellow; pressing
# this key causes a trigger.
#
# The pause should be at the end of the loop, so that the
# oscilloscope is immediately asked if it is done.
#
# Loop exits when Acq_State != NOT_DONE, that is, it exits
# the loop when it is DONE or if the max wait time is
# exceeded.
if Acq_State == ACQ_DONE: # Acquisition fully completed
print "Signal acquired."
else: # Acquisition failed for some reason
print "Max wait time exceeded."
print "This happens if there was no trigger event."
print "Adjust settings accordingly.\n"
print "Properly closing oscilloscope connection and exiting " \
"script.\n"
KsInfiniiVisionX.clear() # Clear communications interface
KsInfiniiVisionX.query(":STOP;*OPC?")
# Stop the oscilloscope
KsInfiniiVisionX.close() # Close communications interface
sys.exit("Exiting script.")
# ====================================================================
# Do Something with data... save, export, additional analysis...
# ====================================================================
def do_something_with_data():
# For example, make a peak-peak voltage measurement on channel 1:
Vpp_Ch1 = \
str(KsInfiniiVisionX.query("MEASure:VPP? CHANnel1")).strip("\n")
# The result has a newline, so remove it with .strip("\n")
print "Vpp Ch1 = " + V " V\n"
# ====================================================================
# Main code
# ====================================================================
# Connect and initialize oscilloscope
# --------------------------------------------------------------------
# Define VISA Resource Manager & Install directory
rm = visa.ResourceManager('C:\\Windows\\System32\\agvisa32.dll')
# Define and open the oscilloscope using the VISA address
Содержание P9241
Страница 1: ...Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide...
Страница 6: ...6 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide...
Страница 36: ...36 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 1 What s New...
Страница 41: ...Setting Up 2 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 41...
Страница 44: ...44 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 2 Setting Up...
Страница 222: ...222 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 7 Root Commands...
Страница 244: ...244 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 8 ACQuire Commands...
Страница 256: ...256 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 9 CALibrate Commands...
Страница 278: ...278 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 10 CHANnel n Commands...
Страница 328: ...328 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 15 EXTernal Trigger Commands...
Страница 386: ...386 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 17 FUNCtion m Commands...
Страница 390: ...390 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 18 HCOPY Commands...
Страница 416: ...416 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 20 MARKer Commands...
Страница 498: ...498 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 21 MEASure Commands...
Страница 532: ...532 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 22 MTESt Commands...
Страница 572: ...572 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 24 SAVE Commands...
Страница 596: ...596 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 25 SBUS n Commands SBUS n A429 SOURce on page 588...
Страница 900: ...900 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 28 TIMebase Commands...
Страница 1080: ...1080 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 31 WGEN w Commands...
Страница 1142: ...1142 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 34 Error Messages...
Страница 1204: ...1204 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide 37 More About Oscilloscope Commands...
Страница 1344: ...1344 Keysight P9241 42 43A Oscilloscopes SCPI Programmer s Guide Index...