Created
June 4, 2014 06:50
-
-
Save ktemkin/521d2cf1b214f0b6b393 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# | |
# Quick script which "captures" a single waveform from the Agilent scopes in the LNG 709/711 labs. | |
import ivi | |
import plac | |
def main(channel: ("The channel to sample on", 'option', 'c') = 1): | |
""" A simple tool for reading data from the LNG709/711 oscilloscopes.""" | |
#Convert the channel number to zero-indexed: | |
channel = int(channel) | |
channel -= 1 | |
#Connect to the Agilent DSO-X 2014A oscilloscope. | |
dso = ivi.agilent.agilentDSOX2014A("USB::0x0957::0x1798::INSTR") | |
#Capture data from the oscilloscope. | |
dso.measurement.initiate() | |
waveform = dso.channels[channel].measurement.fetch_waveform() | |
#Output the data in a matlab-friendly format. | |
for time, value in waveform: | |
print("{0} {1}".format(time, value)) | |
# If this application was called directly, use it! | |
if __name__ == '__main__': | |
plac.call(main) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment