1366
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
38
Synchronizing Acquisitions
do_something_with_data()
# Done - cleanup
KsInfiniiVisionX.clear() # Clear communications interface
KsInfiniiVisionX.close() # Close communications interface
except KeyboardInterrupt:
KsInfiniiVisionX.clear()
KsInfiniiVisionX.query(":STOP;*OPC?")
KsInfiniiVisionX.write(":SYSTem:LOCK OFF")
KsInfiniiVisionX.clear()
KsInfiniiVisionX.close()
sys.exit("User Interupt.
Properly closing oscilloscope and "
"aborting script.")
except Exception:
KsInfiniiVisionX.clear()
KsInfiniiVisionX.query(":STOP;*OPC?")
KsInfiniiVisionX.write(":SYSTem:LOCK OFF")
KsInfiniiVisionX.clear()
KsInfiniiVisionX.close()
sys.exit("Something went wrong.
Properly closing oscilloscope "
"and aborting script.")
# End of Script
# --------------------------------------------------------------------
print "Done."