Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:python-ivi:readme [2013/06/23 08:19]
alex [Instrument communication]
en:python-ivi:readme [2014/02/12 20:28] (current)
alex [Usage example]
Line 8: Line 8:
  
   * Oscilloscopes (scope)   * Oscilloscopes (scope)
 +    * Agilent InfiniiVision 2000A/3000A series
 +    * Agilent InfiniiVision 6000A series
     * Agilent InfiniiVision 7000A/B series     * Agilent InfiniiVision 7000A/B series
     * Agilent Infiniium 90000A/​90000X series     * Agilent Infiniium 90000A/​90000X series
Line 13: Line 15:
     * Tektronix AWG2000 series     * Tektronix AWG2000 series
   * DC Power Supplies (dcpwr)   * DC Power Supplies (dcpwr)
-    * Tektronix PS2520G/​PS2521G 
     * Agilent E3600A series     * Agilent E3600A series
 +    * Agilent 603xA series
 +    * Rigol DP800 series
 +    * Rigol DP1000 series
 +    * Tektronix PS2520G/​PS2521G
   * 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
 +  * Other 
 +    * Agilent 8156A optical attenuator 
 +    * Agilent 86140B series optical spectrum analyzer 
 +    * 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 =====
  
Line 30: Line 42:
 The Python IVI library is a Pythonized version of the .NET and COM IVI API specifications,​ with the CamelCase for everything but the class names replaced with lowercase_with_underscores. ​ The library most closely follows the .NET standard, with the calls that would require the .NET helper classes follwing the corresponding COM specifications. ​ There are some major deviations from the specification in order to be consistent with the spirit of the other IVI specifications. ​ The fgen class is the most obvious example of this, using properties instead of the getters and setters as required by the IVI specification.  ​ The Python IVI library is a Pythonized version of the .NET and COM IVI API specifications,​ with the CamelCase for everything but the class names replaced with lowercase_with_underscores. ​ The library most closely follows the .NET standard, with the calls that would require the .NET helper classes follwing the corresponding COM specifications. ​ There are some major deviations from the specification in order to be consistent with the spirit of the other IVI specifications. ​ The fgen class is the most obvious example of this, using properties instead of the getters and setters as required by the IVI specification.  ​
  
 +
 +===== Requirements =====
 +
 +  * Python 2 or Python 3
 +  * One or more communication extensions
  
 ===== Installation ===== ===== Installation =====
Line 38: Line 55:
 # python setup.py install # python setup.py install
 </​code>​ </​code>​
 +
 +==== Instrument Communication Extensions ====
 +
 +Python IVI does not contain any IO drivers itself. ​ In order to communicate with an instrument, you must install one or more of the following drivers:
 +
 +=== Python VXI11 ===
 +
 +Python VXI11 provides a pure python TCP/IP driver for LAN based instruments that support the VXI11 protocol. ​ This includes most LXI instruments and also devices like the Agilent E2050 GPIB to LAN converter.  ​
 +
 +Home page:
 +http://​www.alexforencich.com/​wiki/​en/​python-vxi11/​start
 +
 +GitHub repository:
 +https://​github.com/​alexforencich/​python-vxi11
 +
 +=== Python USBTMC ===
 +
 +Python USBTMC provides a pure python USBTMC driver for instruments that support the USB Test and Measurement Class. ​ Python USBTMC uses PyUSB to connect to the instrument in a platform-independent manner.
 +
 +Home page:
 +http://​alexforencich.com/​wiki/​en/​python-usbtmc/​start
 +
 +GitHub repository:
 +https://​github.com/​alexforencich/​python-usbtmc
 +
 +=== Linux GPIB ===
 +
 +Python IVI provides an interface wrapper for the Linux GPIB driver. ​ If the Linux GPIB driver and its included Python interface available, Python IVI can use it to communicate with instruments via any GPIB interface supported by Linux GPIB.  ​
 +
 +Home page:
 +http://​linux-gpib.sourceforge.net/​
 +
 +=== pySerial ===
 +
 +Python IVI provides an interface wrapper for the pySerial library. ​ If pySerial is installed, Python IVI can use it to communicate with instruments via the serial port.  ​
 +
 +Home page:
 +http://​pyserial.sourceforge.net/​
  
 ===== Usage example ===== ===== Usage example =====
Line 48: Line 103:
 # connect to MSO7104A via LXI # connect to MSO7104A via LXI
 mso = ivi.agilent.agilentMSO7104A("​TCPIP0::​192.168.1.104::​INSTR"​) mso = ivi.agilent.agilentMSO7104A("​TCPIP0::​192.168.1.104::​INSTR"​)
 +# connect to MSO7104A via USBTMC
 +#mso = ivi.agilent.agilentMSO7104A("​USB0::​2391::​5973::​MY********::​INSTR"​)
 # configure timebase # configure timebase
 mso.acquisition.time_per_record = 1e-3 mso.acquisition.time_per_record = 1e-3
Line 69: Line 126:
 # measure phase # measure phase
 phase = mso.channels['​channel1'​].measurement.fetch_waveform_measurement("​phase",​ "​channel2"​) phase = mso.channels['​channel1'​].measurement.fetch_waveform_measurement("​phase",​ "​channel2"​)
 +# save screenshot to file
 +png = mso.display.fetch_screenshot()
 +with open('​screenshot.png',​ '​wb'​) as f:
 +    f.write(png)
 +# save setup to file
 +setup = mso.system.fetch_setup()
 +with open('​setup.dat',​ '​wb'​) as f:
 +    f.write(setup)
 +# restore setup from file
 +with open('​setup.dat',​ '​rb'​) as f:
 +    setup = f.read()
 +mso.system.load_setup(setup)
 </​code>​ </​code>​