Simple wrapper for the Prologix GPIB-to-Ethernet adapter.
Go to file
2021-03-07 10:04:14 +01:00
examples Update example/sr760_device.py 2020-11-22 20:37:11 +01:00
plx_gpib_ethernet Add blank line 2021-03-07 10:03:51 +01:00
requirements Update python versions for ci tests (#4) 2020-12-05 16:20:04 +01:00
tests Add minimal tests for PrologixGPIBEthernet.set_timeout 2021-03-07 10:04:14 +01:00
.gitignore Add pytest-local.py to .gitignore 2016-08-30 19:17:37 +02:00
.travis.yml Update python versions for ci tests (#4) 2020-12-05 16:20:04 +01:00
appveyor.yml Update python versions for ci tests (#4) 2020-12-05 16:20:04 +01:00
CHANGELOG Update CHANGELOG 2020-12-05 15:20:21 +01:00
LICENSE Add LICENSE 2020-12-05 16:21:08 +01:00
README.md Add license to README.md 2020-12-05 16:22:10 +01:00
requirements.txt initial commit 2016-08-19 16:08:37 +02:00
setup.py Remove setuptools-scm and use hard coded version 2017-09-29 20:23:10 +02:00

Prologix GPIB-to-Ethernet Python wrapper Build Status Build status

Simple wrapper for the Prologix GPIB-to-Ethernet adapter. Also includes a simple device wrapper class.

Currently only supports the CONTROLLER mode of the Prologix GPIB-to-Ethernet adapter.

Requirements

Make sure you can reach/ping the adapter before you start using this library.

Install

Install with pip

pip install git+git://github.com/nelsond/prologix-gpib-ethernet.git

Example usage

Using the adapter directly

from plx_gpib_ethernet import PrologixGPIBEthernet

gpib = PrologixGPIBEthernet('192.168.1.14')

# open connection to Prologix GPIB-to-Ethernet adapter
gpib.connect()

# select gpib device at address 10
gpib.select(10)

# send a query
gpib.query('*IDN?')
# => 'Stanford_Research_Systems,SR760,s/n41456,ver139\n'

# write without reading
gpib.write('*RST')

# close connection
gpib.close()

Using the device wrapper

Also see examples/.

from plx_gpib_ethernet import PrologixGPIBEthernetDevice

class ExampleDevice(PrologixGPIBEthernetDevice):
  def start(self):
    self.write('STRT')

  def get_span(self):
    return float( self.query('SPAN?') )

my_device = ExampleDevice(host='192.168.1.14', address=10)

# open connection
my_device.connect()

# run predefined commands
my_device.idn()
# => 'Stanford_Research_Systems,SR760,s/n41456,ver139\n'
my_device.reset()

# run custom commands
my_device.start()
my_device.get_span() # => 0.191

# close connection
mydevice.close()

Development

Install requirements for development environment

$ pip install -r requirements/dev.txt

Run tests

$ py.test tests/

Generate coverage report

$ py.test --cov=plx_gpib_ethernet tests/

License

MIT License, see file LICENSE.