Status Reporting
35
Keysight P9241/42/43A Oscilloscopes SCPI Programmer's Guide
1173
IO_COMPLETE = 1 << IOC_BIT
# 1 leftshift 13 = 8192
# Test for armed.
STATUS_REGISTER = int(KsInfiniiVisionX.query(":OPER?"))
IO_COMPLETE_STATUS = STATUS_REGISTER & IOC_MASK
# Wait indefinitely until armed.
while IO_COMPLETE_STATUS != IO_COMPLETE:
# Check the status again after small delay.
time.sleep(0.1)
# 100 ms delay to prevent excessive queries.
STATUS_REGISTER = int(KsInfiniiVisionX.query(":OPER?"))
IO_COMPLETE_STATUS = STATUS_REGISTER & IOC_MASK
time_in_seconds = str(time.clock() - now)
print "IO Operation Complete (from :OPER? query)."
print "It took %s seconds for IO operation to complete.\n" % \
time_in_seconds
# ====================================================================
# Main
# ====================================================================
# 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
KsInfiniiVisionX = rm.open_resource(VISA_ADDRESS)
# Set the Global Timeout
KsInfiniiVisionX.timeout = GLOBAL_TOUT
# Clear the instrument bus
KsInfiniiVisionX.clear()
# Reset the oscilloscope.
# KsInfiniiVisionX.write("*RST")
# Or comment out to use the current oscilloscope setup.
# Autoscale to set up vertical scale and trigger level on channels 1 and
2.
KsInfiniiVisionX.write(":CHANnel1:DISPlay ON")
KsInfiniiVisionX.write(":CHANnel2:DISPlay ON")
KsInfiniiVisionX.write(":AUToscale:CHANnels DISPlayed")
KsInfiniiVisionX.write(":AUToscale")
# Between :WMEMory<r>:SAVE commands, wait for IO complete.
# --------------------------------------------------------------------
# Clear all status registers before checking for new events.
KsInfiniiVisionX.write("*CLS")
KsInfiniiVisionX.write(":WMEMory1:SAVE CHANnel1")
wait_io_operation()
KsInfiniiVisionX.write(":WMEMory2:SAVE CHANnel2")
wait_io_operation()
Содержание 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...