# Keithley 2200 Series Power Supplies

class pymeasure.instruments.keithley.Keithley2200(adapter, name='Keithley2200', **kwargs)

  Bases: `SCPIUnknownMixin`, `Instrument`

  Represents the Keithley 2200 Power Supply.

  ch_1
    Channel:

      `PSChannel`

  ch_2
    Channel:

      `PSChannel`

  ch_3
    Channel:

      `PSChannel`

  class BaseChannelCreator(cls, **kwargs)

    Bases: `object`

    Base class for ChannelCreator and MultiChannelCreator.

    Parameters:

      - cls – Class for all children or tuple/list of classes, one for each child.

      - **kwargs – Keyword arguments for all children.

  class ChannelCreator(cls, id=None, **kwargs)

    Bases: `BaseChannelCreator`

    Add a single channel to the parent class.

    The child will be added to the parent instance at instantiation with `CommonBase.add_child()`. The attribute name that ChannelCreator was assigned to in the Instrument class will be the name of the channel interface.

        class Extreme5000(Instrument):
            # Two output channels, accessible by their property names
            # and both are accessible through the 'channels' collection
            output_A = Instrument.ChannelCreator(Extreme5000Channel, "A")
            output_B = Instrument.ChannelCreator(Extreme5000Channel, "B")
            # A channel without a channel accessible through the 'motor' collection
            motor = Instrument.ChannelCreator(MotorControl)

        inst = SomeInstrument()
        # Set the extreme_temp for channel A of Extreme5000 instrument
        inst.output_A.extreme_temp = 42

    Parameters:

      - cls – Channel class for channel interface

      - id – The id of the channel on the instrument, integer or string.

      - **kwargs – Keyword arguments for all children.

  class MultiChannelCreator(cls, id=None, prefix='ch_', **kwargs)

    Bases: `BaseChannelCreator`

    Add channels to the parent class.

    The children will be added to the parent instance at instantiation with `CommonBase.add_child()`. The attribute name (e.g. `channels`) will be used as the collection of the children. You may define the attribute prefix. If there are no other pressing reasons, use `channels` as the attribute name and leave the prefix at the default `"ch_"`.

        class Extreme5000(Instrument):
            # Three channels of the same type: 'ch_A', 'ch_B', 'ch_C'
            # and add them to the 'channels' collection
            channels = Instrument.MultiChannelCreator(Extreme5000Channel, ["A", "B", "C"])
            # Two channel interfaces of different types: 'fn_power', 'fn_voltage'
            # and add them to the 'functions' collection
            functions = Instrument.MultiChannelCreator((PowerChannel, VoltageChannel),
                                            ["power", "voltage"], prefix="fn_")

    Parameters:

      - cls – Class for all children or tuple/list of classes, one for each child.

      - id – tuple/list of ids of the channels on the instrument.

      - prefix – Collection prefix for the attributes, e.g. “ch_” creates attribute self.ch_A. If prefix evaluates False, the child will be added directly under the variable name. Required if id is tuple/list.

      - **kwargs – Keyword arguments for all children.

  add_child(cls, id=None, collection='channels', prefix='ch_', attr_name='', **kwargs)

    Add a child to this instance and return its index in the children list.

    The newly created child may be accessed either by the id in the children dictionary or by the created attribute, e.g. the fifth channel of instrument with id “F” has two access options: `instrument.channels["F"] == instrument.ch_F`

    Note

    Do not change the default collection or prefix parameter, unless you have to distinguish several collections of different children, e.g. different channel types (analog and digital).

    Parameters:

      - cls – Class of the channel.

      - id – Child id how it is used in communication, e.g. “A”.

      - collection – Name of the collection of children, used for dictionary access to the channel interfaces.

      - prefix – For creating multiple channel interfaces, the prefix e.g. “ch_” is prepended to the attribute name of the channel interface self.ch_A. If prefix evaluates False, the child will be added directly under the collection name.

      - attr_name – For creating a single channel interface, the attr_name argument is used when setting the attribute name of the channel interface.

      - **kwargs – Keyword arguments for the channel creator.

    Returns:

      Instance of the created child.

  binary_values(command, query_delay=None, **kwargs)

    Write a command to the instrument and return a numpy array of the binary data.

    Parameters:

      - command – Command to be sent to the instrument.

      - query_delay – Delay between writing and reading in seconds.

      - kwargs – Arguments for `read_binary_values()`.

    Returns:

      NumPy array of values.

  check_errors()

    Read all errors from the instrument.

    Returns:

      List of error entries.

  check_get_errors()

    Check for errors after having gotten a property and log them.

    Called if `check_get_errors=True` is set for that property.

    If you override this method, you may choose to raise an Exception for certain errors.

    Returns:

      List of error entries.

  check_set_errors()

    Check for errors after having set a property and log them.

    Called if `check_set_errors=True` is set for that property.

    If you override this method, you may choose to raise an Exception for certain errors.

    Returns:

      List of error entries.

  property complete

    Get the synchronization bit.

    This property allows synchronization between a controller and a device. The Operation Complete query places an ASCII character 1 into the device’s Output Queue when all pending selected device operations have been finished.

  property display_enabled

    Control whether the display is enabled.

  property display_text_data

    Control text to be displayed(32 characters).

  static get_channel_pairs(cls)

    Return a list of all the Instrument’s channel pairs

  static get_channels(cls)

    Return a list of all the Instrument’s ChannelCreator and MultiChannelCreator instances

  property id

    Get the identification of the instrument.

  property next_error

    Get the next error in the queue. If you want to read and log all errors, use `check_errors()` instead.

  property options

    Get the device options installed.

  read_binary_values(**kwargs)

    Read binary values from the device.

  read_bytes(count, **kwargs)

    Read a certain number of bytes from the instrument.

    Parameters:

      - count (int) – Number of bytes to read. A value of -1 indicates to read the whole read buffer.

      - kwargs – Keyword arguments for the adapter.

    Returns bytes:

      Bytes response of the instrument (including termination).

  remove_child(child)

    Remove the child from the instrument and the corresponding collection.

    Parameters:

      child – Instance of the child to delete.

  reset()

    Reset the instrument.

  shutdown()

    Brings the instrument to a safe and stable state

  property status

    Get the status byte and Master Summary Status bit.

  wait_for(query_delay=None)

    Wait for some time. Used by ‘ask’ to wait before reading.

    Parameters:

      query_delay – Delay between writing and reading in seconds. None is default delay.

  write_binary_values(command, values, *args, **kwargs)

    Write binary values to the device.

    Parameters:

      - command – Command to send.

      - values – The values to transmit.

      - **kwargs (*args,) – Further arguments to hand to the Adapter.

  write_bytes(content, **kwargs)

    Write the bytes content to the instrument.

class pymeasure.instruments.keithley.keithley2200.PSChannel(parent, id)

  Bases: `Channel`

  Implementation of a Keithley 2200 channel.

  property current

    Measure the current in Amps.

  property current_limit

    Control output current in Amps.

  insert_id(command)

    Insert the channel id in a command replacing placeholder.

    Subclass this method if you want to do something else, like always prepending the channel id.

  property output_enabled

    Control the output state.

  property power

    Measure the power in watts.

  property voltage

    Measure the voltage in Volts.

  property voltage_limit

    Control the maximum voltage that can be set.

  property voltage_limit_enabled

    Control whether the maximum voltage limit is enabled.

  property voltage_setpoint

    Control output voltage in Volts.