microlab instruments documentation - read the docs · 2021. 1. 30. · microlab instruments...

26
Microlab Instruments Documentation Release 0.1.0 Kristofer Monisit May 19, 2016

Upload: others

Post on 14-Mar-2021

15 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments DocumentationRelease 0.1.0

Kristofer Monisit

May 19, 2016

Page 2: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response
Page 3: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Contents

1 Quick start 1

2 Contents 32.1 Microlab Instruments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.1.1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3 Usage and Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

2.3.1 Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.3.2 Types of Instruments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.4 Reference Manual . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4.1 base_classes module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4.2 microlab_instruments module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.5 Contributing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5.1 Types of Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5.2 Get Started! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5.3 Pull Request Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.5.4 Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.6 Credits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.6.1 Development Lead . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.6.2 Contributors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2.7 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.7.1 0.1.0 (2014-01-27) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3 Indices and tables 17

Python Module Index 19

i

Page 4: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

ii

Page 5: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

CHAPTER 1

Quick start

$ pip install git+https://github.com/kitmonisit/microlab-instruments.git$ python

import microlab_instruments as mi

giratina = mi.Giratina()giratina.write('*IDN?')print giratina.read_ascii()

1

Page 6: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

2 Chapter 1. Quick start

Page 7: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

CHAPTER 2

Contents

2.1 Microlab Instruments

Microlab Instruments is an abstraction layer for all the GPIB/Ethernet/USB/Serial instruments in the Microlab. Allyou have to do is instantiate an instrument class. With the help of each instrument’s SCPI command reference, justask(), write(), or read() commands. No need to worry about hardware and protocol settings.

• Free software: BSD license

• Documentation: http://microlab-instruments.rtfd.org.

2.1.1 Features

• TODO

2.2 Installation

To install:

$ pip install git+https://github.com/kitmonisit/microlab-instruments

To uninstall:

$ pip uninstall microlab-instruments

To upgrade, you need to uninstall then reinstall the package. No provisions have yet been made for pip install--upgrade ....

2.3 Usage and Tutorial

2.3.1 Basics

1. Start using microlab-instruments

import microlab_instruments as mi

2. Turn on the instrument nicknamed Giratina.

3

Page 8: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

3. Initialize Giratina in the software environment

giratina = mi.Giratina()

4. Query Giratina for its identification string.

giratina.write('*IDN?')

5. Read Giratina‘s ASCII response

print giratina.read_ascii()

6. Putting them all together, you can write a script that asks Giratina for its identification string:

import microlab_instruments as mi

giratina = mi.Giratina()giratina.write('*IDN?')print giratina.read_ascii()

2.3.2 Types of Instruments

Two types of instruments are modeled in this Python package.

1. SCPI instruments communicate via GPIB or TCP/IP. They can receive string commands and respond in eitherASCII, binary, or IEEE-754 floating point formats.

2. I2C instruments communicate via the Aardvark adapter. They are more limited in terms of commands andresponse formats.

SCPI Instruments

The most important commands for SCPI instruments are:

• write()

• read_ascii()

• read_binary()

• read_ieee754()

The read... commands return the following data types:

• read_ascii returns human-readable str.

• read_binary technically returns str but it is not guaranteed to be human-readable. Printing the output of thisfunction will only result in gibberish in your terminal.

• read_ieee754 returns a list of numbers which are the result of a measurement SCPI query.

WARNING If you consecutively send write several commands that for which you expect a response without readingtheir respective responses in turn, you may no longer be able to segregate the data in the response buffer. For example:

import microlab_instruments as mi

giratina = mi.Giratina()giratina.write('*IDN?')giratina.write(':fetch:arr:volt?')

# The following line of code reads too much. The response to '*IDN?' is

4 Chapter 2. Contents

Page 9: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

# not necessarily 4096 bytes long. The beginning of the response to# ':fetch:arr:volt' is read prematurely and this library does not provide# functions to reconstruct the data when it is read this way.giratina.read_ascii(bufsize=4096)

Convenience functions are provided such that write and read commands are done consecutively.

• ask_ascii()

• ask_binary()

• ask_ieee754()

SCPI Instruments Example

The following code takes a screenshot of the present display on Giratina and saves it in screenshot.jpg in thecurrent directory.

giratina.write(':DISP:ENAB ON')giratina.write(':DISP:VIEW GRAPH')giratina.write(':HCOP:SDUM:FORM JPG')giratina.write('*OPC')giratina.write(':HCOP:SDUM:DATA?')d = giratina.read_binary()

fd = open('screenshot.jpg', 'wb')fd.write(d)fd.close()

For the following code, connect a 1kΩ resistor between the positive and negative probes. We will sweep the voltagefrom 0 to 5 and measure the current. Voltage sweep values and the corresponding current values are retrieved.

import microlab_instruments as miimport numpy as np

giratina = mi.Giratina()giratina.write('*IDN?')

giratina.write(':source:function:mode voltage')giratina.write(':source:sweep:direction up')giratina.write(':source:sweep:stair double')giratina.write(':source:sweep:spacing linear')giratina.write(':source:voltage:mode sweep')giratina.write(':source:voltage:start 0')giratina.write(':source:voltage:stop 5')giratina.write(':source:voltage:points 201')giratina.write(':sens:curr:prot 0.120')giratina.write(':trigger:source aint')giratina.write(':trigger:count 201')giratina.write(':format:data real,64')giratina.write(':outp on')giratina.write(':init (@1)')giratina.ask_ascii('*OPC?')giratina.write(':output off')giratina.write(':fetch:arr:volt? (@1)')volt = np.array(giratina.read_ieee754())giratina.write(':fetch:arr:curr? (@1)')curr = np.array(giratina.read_ieee754())

2.3. Usage and Tutorial 5

Page 10: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

res = volt / currfor m, n, o in zip(volt, curr, res):

a = '0:>20.3e'.format(m)b = '0:>17.1fmA'.format(n*1e3)c = '0:>20.3e'.format(o)print ''.join([a, b, c])

I2C Instruments

The I2C instruments are more specialized and thus we will discuss them here. The four I2C instruments are listedbelow, but you will actively use only the first three.

1. Kerrigan, an FPGA

2. Traxex, a temperature sensor

3. Xin, another temperature sensor identical to Traxex

4. Chen, an I2C multiplexer used to coordinate the Traxex and Xin

These I2C instruments communicate via the Aardvark adapter, which must be initialized first.

I2C Instruments Example

Kerrigan has only two commands, write() and read()

import microlab_instruments as mi

aa = mi.Aardvark()kerrigan = mi.Kerrigan()REGISTER = 0x11PAYLOAD = 0xAAkerrigan.write(REGISTER, PAYLOAD)print kerrigan.read(REGISTER) # This should output 0xAAprint kerrigan.read(0x12) # This should output 0x00

To use Traxex and Xin, we also need to initialize Chen. The temperature sensors have only one command,read_temp(), which returns the temperature in Celsius degrees.

import microlab_instruments as mi

aa = mi.Aardvark()chen = mi.Chen(aa)traxex = mi.Traxex(aa, chen)xin = mi.Xin(aa, chen)

print traxex.read_temp()print xin.read_temp()

2.4 Reference Manual

2.4.1 base_classes module

class microlab_instruments.base_classes.AardvarkInstrumentBases: object

6 Chapter 2. Contents

Page 11: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

Initialize an Aardvark.

Raises Exception – Upon instantiation, SPI communication is tested. A 25-long array of bytes issent twice to the Aardvark (and subsequently to the FPGA). After the second attempt, a responseidentical to the array must be received. If not, an Exception is raised. In this case, it may belikely that the FPGA did not respond properly.

I2C_STATUS_CODES = 1: ‘AA_I2C_STATUS_BUS_ERROR’, 2: ‘AA_I2C_STATUS_SLA_ACK’, 3: ‘AA_I2C_STATUS_SLA_NACK’, 4: ‘AA_I2C_STATUS_DATA_NACK’, 5: ‘AA_I2C_STATUS_ARB_LOST’, 6: ‘AA_I2C_STATUS_BUS_LOCKED’, 7: ‘AA_I2C_STATUS_LAST_DATA_ACK’These are the status codes used by i2c_write(), i2c_read(), and i2c_write_read() whenraising Exceptions.

i2c_read(address, bufsize)Read bufsize number of bytes from the I2C slave with address.

Parameters

• address (int) – Slave address from which to receive response.

• bufsize (int) – Size in bytes of expected response from slave.

Returns out Response from slave. A bufsize-length list of ints.

Return type list

Raises Exception – if the status response is not 0. See I2C_STATUS_CODES.

i2c_write(address, bytecode)Write bytecode to the Aardvark output to be received by I2C slave with address.

Parameters

• address (int) – Slave address to receive bytecode. Limited to 8 bits.

• bytecode (int) – Raw bytecode to send. Limited to 8 bits.

Returns out Number of bytes sent.

Return type int

Raises Exception – if the status response is not 0. See I2C_STATUS_CODES.

i2c_write_read(address, bytecode, bufsize)Write bytecode to, and read bufsize bytes from, I2C slave with address in one fell swoop!

Parameters

• address (int) – Slave address to receive bytecode. Limited to 8 bits.

• bytecode (int) – Raw bytecode to send. Limited to 8 bits.

• bufsize (int) – Size in bytes of expected response from slave.

Returns out Response from slave. A bufsize-length list of ints.

Return type list

Raises Exception – if the status response is not 0. See I2C_STATUS_CODES.

spi_write(bytecode)Write bytecode to, and read 25 bytes from, the SPI channel in one fell swoop!

Parameters bytecode (list) – Raw bytecodes to send. Must be exactly 25-long list of bytes.

Returns out Response bytes. A 25-length list of ints.

Return type list

Raises Exception – if bytecode does not have exactly 25 8-bit elements.

2.4. Reference Manual 7

Page 12: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

class microlab_instruments.base_classes.FPGAInstrument(aardvark)Bases: object

An abstraction layer for the FPGA.

read(register)Read the contents of register.

Parameters register (int) – The register address to read. Limited to 1 byte long.

write(register, payload)Write a 1-byte-long payload to a register address.

Parameters

• payload (int) – The data to write. Limited to 1 byte long.

• register (int) – The register address to write to. Limited to 1 byte long.

class microlab_instruments.base_classes.GPIBInstrument(nickname, reset=True)Bases: microlab_instruments.base_classes.SCPIInstrument

Initialize a GPIB instrument

Parameters nickname (str) – A nickname associated with a GPIB primary address and definedin /etc/gpib.conf.

read(bufsize=4096)Read bufsize bytes from instrument. Using this low-level function, there is no way to ensure that allthe response data has been retrieved, or to make sense of binary data. It is strongly recommended to useread_ascii(), read_binary(), or read_ieee754().

Parameters bufsize (int) – Defaults to 4096 bytes. Expected size in bytes of the responsefrom the instrument.

Returns out Response from the instrument.

Return type str

reset()Reset the GPIB instrument.

write(scpi_string)Write SCPI command to the instrument. The end-of-string character (for example, \n) is automaticallyappended.

Parameters scpi_string (str) – A valid SCPI command. See the instrument’s SCPI com-mand reference.

class microlab_instruments.base_classes.I2CMuxInstrument(aardvark)Bases: object

An abstraction layer for the I2C multiplexer chip.

switch_to(mux_slave_address)Setup the multiplexer to relay I2C commands to the device having mux_slave_address

Parameters slave_address (int) – The device to which the multiplexer will relay I2Ccommands.

class microlab_instruments.base_classes.SCPIInstrumentBases: object

8 Chapter 2. Contents

Page 13: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

ask_ascii(scpi_string)A convenience function for calling write() and read_ascii() consecutively. Up to 4096 bytes areread from the ASCII response buffer.

Parameters scpi_string (str) – A valid SCPI query command. See the instrument’s SCPIcommand reference.

Raises Exception – If the SCPI command does not end with a ‘?’ (i.e. not a query command)

ask_binary(scpi_string)A convenience function for calling write() and read_binary() consecutively.

Parameters scpi_string (str) – A valid SCPI query command. See the instrument’s SCPIcommand reference.

Raises Exception – If the SCPI command does not end with a ‘?’ (i.e. not a query command)

ask_ieee754(scpi_string)A convenience function for calling write() and read_ieee754() consecutively.

Parameters scpi_string (str) – A valid SCPI query command. See the instrument’s SCPIcommand reference.

Raises Exception – If the SCPI command does not end with a ‘?’ (i.e. not a query command)

configure(config_file)Reads from a text file containing valid SCPI commands separated by newlines to configure the instrument.Only program commands are allowed. Configures the instrument by sending those commands consecu-tively. Automatically sends an *OPC? command to await pending operations. Prints out those commandsto standard output.

Text written after a ‘#’ character are considered comments.

Commands in the configuration file are assumed to be valid for the instrument.

Parameters config_file (str) – The filename of the configuration file.

Raises Exception – If any of the SCPI commands contain a ‘?’ (i.e. are query commands)

read_ascii(bufsize=4096)Read ASCII response from instrument in chunks of bufsize bytes until a \n is encountered.

Parameters bufsize (int) – Defaults to 4096 bytes. Size of consecutive chunks of data tobe read.

Returns out Response from the instrument.

Return type str

read_binary()Read raw binary data from instrument. It is the developer’s responsiblity to make sense of it.

Returns out Response from the instrument. This is just a string of binary code.

Return type str

A typical use case is obtaining a screenshot of the instrument panel. The following code is for the AgilentB2902A Precision Source Measure Unit, nicknamed ‘Yveltal’.

import microlab_instruments as mi

yveltal = mi.Yveltal()yveltal.write(':DISP:ENAB ON')yveltal.write(':DISP:VIEW GRAP')yveltal.write(':HCOP:SDUM:FORM JPG')

2.4. Reference Manual 9

Page 14: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

yveltal.ask_ascii('*OPC?')yveltal.write(':HCOP:SDUM:DATA?')image_data = yveltal.read_binary()

file_handle = open('screendump.jpg', 'wb')file_handle.write(image_data)file_handle.close()

read_ieee754()A convenience function to read binary data known to be formatted in IEEE-754 floating-point. Internallycalls read_binary() and automatically determines half-, single-, or double-precision based on theinstrument’s settings.

Returns out A list of floating-point numbers.

Return type list

class microlab_instruments.base_classes.SerialInstrument(device_port)Bases: object

Initialize an RS-232 instrument.

class microlab_instruments.base_classes.TCPIPInstrument(socket_pair, reset=True)Bases: microlab_instruments.base_classes.SCPIInstrument

Initialize TCP/IP instrument.

Parameters socket_pair (tuple) – A 2-tuple of the form (’192.168.1.2’, 5025).

read(bufsize=4096)Read bufsize bytes from instrument. Using this low-level function, there is no way to ensure that allthe response data has been retrieved, or to make sense of binary data. It is strongly recommended to useread_ascii(), read_binary(), or read_ieee754().

Parameters bufsize (int) – Defaults to 4096 bytes. Expected size in bytes of the responsefrom the instrument.

Returns out Response from the instrument.

Return type str

reset()Reset the instrument.

write(scpi_string)Write SCPI command to the instrument. The end-of-string character (for example, \n) is automaticallyappended.

Parameters scpi_string (str) – A valid SCPI command. See the instrument’s SCPI com-mand reference.

class microlab_instruments.base_classes.TempSensorInstrument(aardvark, mux)Bases: object

An abstraction layer for the Sensirion STS21 temperature sensor with an I2C communication interface.

Initialize a Sensirion STS21 temperature sensor.

Parameters

• aardvark (Aardvark) – An Aardvark object through which I2C commands are relayed.

• mux (I2CMuxInstrument) – The I2C multiplexer through which I2C commands arerelayed.

10 Chapter 2. Contents

Page 15: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

read_temp()Read measured temperature data.

Returns out Temperature in degress Celsius

Return type float

2.4.2 microlab_instruments module

class microlab_instruments.microlab_instruments.ArceusBases: microlab_instruments.base_classes.GPIBInstrument

class microlab_instruments.microlab_instruments.Chen(aardvark)Bases: microlab_instruments.base_classes.I2CMuxInstrument

Initialize the I2C multiplexer.

Parameters aardvark (Aardvark) – An Aardvark object through which I2C commands arerelayed.

import microlab_instruments as mi

aa = mi.Aardvark()chen = mi.Chen(aa)

class microlab_instruments.microlab_instruments.DarkraiBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.DeoxysBases: microlab_instruments.base_classes.TCPIPInstrument

ask_waveform_data()A convenience function to query the waveform preamble and waveform data in one call. Additionally, italso composes the (x,y) data list.

Returns out A 2-column list. The first column holds the x values and the second column holdsthe y values.

Return type list

compose_waveform_xy(waveform_y, waveform_preamble)Compose the (x,y) data list according to the y data and preamble obtained from the instrument.

Returns out A 2-column list. The first column holds the x values and the second column holdsthe y values.

Return type list

read_preamble()Read the waveform preamble from Deoxys. It contains the following metadata about the waveform data:

Returns out

Return type dict

class microlab_instruments.microlab_instruments.GenesectBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.GiratinaBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.HeatranBases: microlab_instruments.base_classes.TCPIPInstrument

2.4. Reference Manual 11

Page 16: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

class microlab_instruments.microlab_instruments.Ho_ohBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.Kerrigan(aardvark)Bases: microlab_instruments.base_classes.FPGAInstrument

Initialize the FPGA.

Parameters aardvark (Aardvark) – An Aardvark object through which I2C commands arerelayed.

import microlab_instruments as mi

aa = mi.Aardvark()kerrigan = mi.Kerrigan(aa)

class microlab_instruments.microlab_instruments.KyuremBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.MeloettaBases: microlab_instruments.base_classes.GPIBInstrument

class microlab_instruments.microlab_instruments.RayquazaBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.Traxex(aardvark, mux)Bases: microlab_instruments.base_classes.TempSensorInstrument

Initialize a Sensirion STS21 temperature sensor.

Parameters aardvark (Aardvark) – An Aardvark object through which I2C commands arerelayed.

import microlab_instruments as mi

aa = mi.Aardvark()traxex = mi.Traxex(aa)print traxex.read_temp()

class microlab_instruments.microlab_instruments.XerneasBases: microlab_instruments.base_classes.GPIBInstrument

class microlab_instruments.microlab_instruments.Xin(aardvark, mux)Bases: microlab_instruments.base_classes.TempSensorInstrument

Initialize a Sensirion STS21 temperature sensor.

Parameters aardvark (Aardvark) – An Aardvark object through which I2C commands arerelayed.

import microlab_instruments as mi

aa = mi.Aardvark()xin = mi.Xin(aa)print xin.read_temp()

class microlab_instruments.microlab_instruments.YveltalBases: microlab_instruments.base_classes.TCPIPInstrument

class microlab_instruments.microlab_instruments.ZygardeBases: microlab_instruments.base_classes.TCPIPInstrument

12 Chapter 2. Contents

Page 17: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

2.5 Contributing

Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given.

You can contribute in many ways:

2.5.1 Types of Contributions

Report Bugs

Report bugs at https://github.com/kitmonisit/microlab-instruments/issues.

If you are reporting a bug, please include:

• Your operating system name and version.

• Any details about your local setup that might be helpful in troubleshooting.

• Detailed steps to reproduce the bug.

Fix Bugs

Look through the GitHub issues for bugs. Anything tagged with “bug” is open to whoever wants to implement it.

Implement Features

Look through the GitHub issues for features. Anything tagged with “feature” is open to whoever wants to implementit.

Write Documentation

Microlab Instruments could always use more documentation, whether as part of the official Microlab Instruments docs,in docstrings, or even on the web in blog posts, articles, and such.

Submit Feedback

The best way to send feedback is to file an issue at https://github.com/kitmonisit/microlab-instruments/issues.

If you are proposing a feature:

• Explain in detail how it would work.

• Keep the scope as narrow as possible, to make it easier to implement.

• Remember that this is a volunteer-driven project, and that contributions are welcome :)

2.5.2 Get Started!

Ready to contribute? Here’s how to set up microlab-instruments for local development.

1. Fork the microlab-instruments repo on GitHub.

2. Clone your fork locally:

2.5. Contributing 13

Page 18: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

$ git clone [email protected]:your_name_here/microlab-instruments.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set upyour fork for local development:

$ mkvirtualenv microlab-instruments$ cd microlab-instruments/$ python setup.py develop

4. Create a branch for local development:

$ git checkout -b name-of-your-bugfix-or-feature

Now you can make your changes locally.

5. When you’re done making changes, check that your changes pass flake8 and the tests, including testing otherPython versions with tox:

$ flake8 microlab-instruments tests$ python setup.py test$ tox

To get flake8 and tox, just pip install them into your virtualenv.

6. Commit your changes and push your branch to GitHub:

$ git add .$ git commit -m "Your detailed description of your changes."$ git push origin name-of-your-bugfix-or-feature

7. Submit a pull request through the GitHub website.

2.5.3 Pull Request Guidelines

Before you submit a pull request, check that it meets these guidelines:

1. The pull request should include tests.

2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a functionwith a docstring, and add the feature to the list in README.rst.

3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check https://travis-ci.org/kitmonisit/microlab-instruments/pull_requests and make sure that the tests pass for all supported Pythonversions.

2.5.4 Tips

To run a subset of tests:

$ python -m unittest tests.test_microlab-instruments

2.6 Credits

2.6.1 Development Lead

• Kristofer Monisit <[email protected]>

14 Chapter 2. Contents

Page 19: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

2.6.2 Contributors

None yet. Why not be the first?

2.7 History

2.7.1 0.1.0 (2014-01-27)

• First release on PyPI.

2.7. History 15

Page 20: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

16 Chapter 2. Contents

Page 21: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

CHAPTER 3

Indices and tables

• genindex

• modindex

• search

17

Page 22: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

18 Chapter 3. Indices and tables

Page 23: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Python Module Index

bbase_classes, 6

mmicrolab_instruments.base_classes, 6microlab_instruments.microlab_instruments,

11

19

Page 24: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

20 Python Module Index

Page 25: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Index

AAardvarkInstrument (class in micro-

lab_instruments.base_classes), 6Arceus (class in micro-

lab_instruments.microlab_instruments), 11ask_ascii() (microlab_instruments.base_classes.SCPIInstrument

method), 8ask_binary() (microlab_instruments.base_classes.SCPIInstrument

method), 9ask_ieee754() (microlab_instruments.base_classes.SCPIInstrument

method), 9ask_waveform_data() (micro-

lab_instruments.microlab_instruments.Deoxysmethod), 11

Bbase_classes (module), 6

CChen (class in micro-

lab_instruments.microlab_instruments), 11compose_waveform_xy() (micro-

lab_instruments.microlab_instruments.Deoxysmethod), 11

configure() (microlab_instruments.base_classes.SCPIInstrumentmethod), 9

DDarkrai (class in micro-

lab_instruments.microlab_instruments), 11Deoxys (class in micro-

lab_instruments.microlab_instruments), 11

FFPGAInstrument (class in micro-

lab_instruments.base_classes), 7

GGenesect (class in micro-

lab_instruments.microlab_instruments), 11

Giratina (class in micro-lab_instruments.microlab_instruments), 11

GPIBInstrument (class in micro-lab_instruments.base_classes), 8

HHeatran (class in micro-

lab_instruments.microlab_instruments), 11Ho_oh (class in micro-

lab_instruments.microlab_instruments), 11

Ii2c_read() (microlab_instruments.base_classes.AardvarkInstrument

method), 7I2C_STATUS_CODES (micro-

lab_instruments.base_classes.AardvarkInstrumentattribute), 7

i2c_write() (microlab_instruments.base_classes.AardvarkInstrumentmethod), 7

i2c_write_read() (micro-lab_instruments.base_classes.AardvarkInstrumentmethod), 7

I2CMuxInstrument (class in micro-lab_instruments.base_classes), 8

KKerrigan (class in micro-

lab_instruments.microlab_instruments), 12Kyurem (class in micro-

lab_instruments.microlab_instruments), 12

MMeloetta (class in micro-

lab_instruments.microlab_instruments), 12microlab_instruments.base_classes (module), 6microlab_instruments.microlab_instruments (module),

11

RRayquaza (class in micro-

lab_instruments.microlab_instruments), 12

21

Page 26: Microlab Instruments Documentation - Read the Docs · 2021. 1. 30. · Microlab Instruments Documentation, Release 0.1.0 # not necessarily 4096 bytes long. The beginning of the response

Microlab Instruments Documentation, Release 0.1.0

read() (microlab_instruments.base_classes.FPGAInstrumentmethod), 8

read() (microlab_instruments.base_classes.GPIBInstrumentmethod), 8

read() (microlab_instruments.base_classes.TCPIPInstrumentmethod), 10

read_ascii() (microlab_instruments.base_classes.SCPIInstrumentmethod), 9

read_binary() (microlab_instruments.base_classes.SCPIInstrumentmethod), 9

read_ieee754() (microlab_instruments.base_classes.SCPIInstrumentmethod), 10

read_preamble() (micro-lab_instruments.microlab_instruments.Deoxysmethod), 11

read_temp() (microlab_instruments.base_classes.TempSensorInstrumentmethod), 10

reset() (microlab_instruments.base_classes.GPIBInstrumentmethod), 8

reset() (microlab_instruments.base_classes.TCPIPInstrumentmethod), 10

SSCPIInstrument (class in micro-

lab_instruments.base_classes), 8SerialInstrument (class in micro-

lab_instruments.base_classes), 10spi_write() (microlab_instruments.base_classes.AardvarkInstrument

method), 7switch_to() (microlab_instruments.base_classes.I2CMuxInstrument

method), 8

TTCPIPInstrument (class in micro-

lab_instruments.base_classes), 10TempSensorInstrument (class in micro-

lab_instruments.base_classes), 10Traxex (class in micro-

lab_instruments.microlab_instruments), 12

Wwrite() (microlab_instruments.base_classes.FPGAInstrument

method), 8write() (microlab_instruments.base_classes.GPIBInstrument

method), 8write() (microlab_instruments.base_classes.TCPIPInstrument

method), 10

XXerneas (class in micro-

lab_instruments.microlab_instruments), 12Xin (class in microlab_instruments.microlab_instruments),

12

YYveltal (class in micro-

lab_instruments.microlab_instruments), 12

ZZygarde (class in micro-

lab_instruments.microlab_instruments), 12

22 Index