Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:python-ivi:readme [2013/02/17 09:35] – alex | en:python-ivi:readme [2014/02/12 19:28] (current) – [Usage example] alex | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| ===== Included drivers ===== | ===== Included drivers ===== | ||
| - | * DC Power Supplies | + | * Oscilloscopes |
| - | * Tektronix PS2520G/PS2521G | + | * Agilent InfiniiVision 2000A/3000A series |
| - | * Agilent | + | * Agilent |
| + | * Agilent InfiniiVision 7000A/B series | ||
| + | * Agilent Infiniium 90000A/ | ||
| * Function Generators (fgen) | * Function Generators (fgen) | ||
| * Tektronix AWG2000 series | * Tektronix AWG2000 series | ||
| + | * DC Power Supplies (dcpwr) | ||
| + | * Agilent E3600A series | ||
| + | * Agilent 603xA series | ||
| + | * Rigol DP800 series | ||
| + | * Rigol DP1000 series | ||
| + | * Tektronix PS2520G/ | ||
| * RF Power Meters (pwrmeter): | * RF Power Meters (pwrmeter): | ||
| * Agilent 436A | * Agilent 436A | ||
| * RF Signal Generators (rfsiggen) | * RF Signal Generators (rfsiggen) | ||
| * Agilent 8642 A/B | * Agilent 8642 A/B | ||
| - | * Oscilloscopes (scope) | + | * Other |
| - | * Agilent | + | * Agilent |
| + | * Agilent 86140B | ||
| + | * Colby Instruments PDL10A Programmable Delay Line | ||
| + | * DiCon Fiberoptics GP700 Programmable Fiberoptic Instrument | ||
| + | * JDS Uniphase TB9 Series Optical Grating Filter | ||
| + | * Tektronix AM5030 programmable current probe amplifier | ||
| + | * Tektronix OA5000 series optical attenuator | ||
| ===== Instrument communication ===== | ===== Instrument communication ===== | ||
| - | Python IVI can use Python | + | Python IVI can use Python |
| ===== A note on standards compliance ===== | ===== A note on standards compliance ===== | ||
| Line 29: | Line 42: | ||
| The Python IVI library is a Pythonized version of the .NET and COM IVI API specifications, | The Python IVI library is a Pythonized version of the .NET and COM IVI API specifications, | ||
| + | |||
| + | ===== Requirements ===== | ||
| + | |||
| + | * Python 2 or Python 3 | ||
| + | * One or more communication extensions | ||
| ===== Installation ===== | ===== Installation ===== | ||
| Line 37: | Line 55: | ||
| # python setup.py install | # python setup.py install | ||
| </ | </ | ||
| + | |||
| + | ==== Instrument Communication Extensions ==== | ||
| + | |||
| + | Python IVI does not contain any IO drivers itself. | ||
| + | |||
| + | === Python VXI11 === | ||
| + | |||
| + | Python VXI11 provides a pure python TCP/IP driver for LAN based instruments that support the VXI11 protocol. | ||
| + | |||
| + | Home page: | ||
| + | http:// | ||
| + | |||
| + | GitHub repository: | ||
| + | https:// | ||
| + | |||
| + | === Python USBTMC === | ||
| + | |||
| + | Python USBTMC provides a pure python USBTMC driver for instruments that support the USB Test and Measurement Class. | ||
| + | |||
| + | Home page: | ||
| + | http:// | ||
| + | |||
| + | GitHub repository: | ||
| + | https:// | ||
| + | |||
| + | === Linux GPIB === | ||
| + | |||
| + | Python IVI provides an interface wrapper for the Linux GPIB driver. | ||
| + | |||
| + | Home page: | ||
| + | http:// | ||
| + | |||
| + | === pySerial === | ||
| + | |||
| + | Python IVI provides an interface wrapper for the pySerial library. | ||
| + | |||
| + | Home page: | ||
| + | http:// | ||
| ===== Usage example ===== | ===== Usage example ===== | ||
| - | This sample Python code will use Python IVI connect to an Agilent MSO7104A over LXI (VXI11), configure the timebase, trigger, and channel 1, capture a waveform, and read it out of the instrument. | + | This sample Python code will use Python IVI connect to an Agilent MSO7104A over LXI (VXI-11), configure the timebase, trigger, and channel 1, capture a waveform, and read it out of the instrument. |
| <code python> | <code python> | ||
| Line 47: | Line 103: | ||
| # connect to MSO7104A via LXI | # connect to MSO7104A via LXI | ||
| mso = ivi.agilent.agilentMSO7104A(" | mso = ivi.agilent.agilentMSO7104A(" | ||
| + | # connect to MSO7104A via USBTMC | ||
| + | #mso = ivi.agilent.agilentMSO7104A(" | ||
| # configure timebase | # configure timebase | ||
| mso.acquisition.time_per_record = 1e-3 | mso.acquisition.time_per_record = 1e-3 | ||
| Line 64: | Line 122: | ||
| # read out channel 1 waveform data | # read out channel 1 waveform data | ||
| waveform = mso.channels[0].measurement.fetch_waveform() | waveform = mso.channels[0].measurement.fetch_waveform() | ||
| + | # measure peak-to-peak voltage | ||
| + | vpp = mso.channels[0].measurement.fetch_waveform_measurement(" | ||
| + | # measure phase | ||
| + | phase = mso.channels[' | ||
| + | # save screenshot to file | ||
| + | png = mso.display.fetch_screenshot() | ||
| + | with open(' | ||
| + | f.write(png) | ||
| + | # save setup to file | ||
| + | setup = mso.system.fetch_setup() | ||
| + | with open(' | ||
| + | f.write(setup) | ||
| + | # restore setup from file | ||
| + | with open(' | ||
| + | setup = f.read() | ||
| + | mso.system.load_setup(setup) | ||
| </ | </ | ||
| Line 102: | Line 176: | ||
| import ivi | import ivi | ||
| # connect to E3649A via GPIB | # connect to E3649A via GPIB | ||
| - | #awg = ivi.agilent.agilentE3649A(" | + | #psu = ivi.agilent.agilentE3649A(" |
| # connect to E3649A via E2050A GPIB to VXI11 bridge | # connect to E3649A via E2050A GPIB to VXI11 bridge | ||
| psu = ivi.agilent.agilentE3649A(" | psu = ivi.agilent.agilentE3649A(" | ||
| Line 108: | Line 182: | ||
| #psu = ivi.agilent.agilentE3649A(" | #psu = ivi.agilent.agilentE3649A(" | ||
| # configure output | # configure output | ||
| + | psu.outputs[0].configure_range(' | ||
| psu.outputs[0].voltage_level = 12.0 | psu.outputs[0].voltage_level = 12.0 | ||
| psu.outputs[0].current_limit = 1.0 | psu.outputs[0].current_limit = 1.0 | ||