# devices.keithley:Keithley2400


Class for controlling Keithley 2400 SourceMeter.


Usage

``` python
devices.keithley:Keithley2400(
    interface,
    **kwargs,
)
```


Provides methods to configure and control the Keithley 2400 source measurement unit for various sourcing and measurement operations.


## Methods

| Name | Description |
|----|----|
| [__init__()](#__init__) | Initialize the Keithley 2400 SourceMeter. |
| [configure()](#configure) | Configure the Keithley 2400. |
| [getSense()](#getSense) | Get the current sense value from the instrument. |
| [getSource()](#getSource) | Get the current source value from the instrument. |
| [read()](#read) | Read data from the instrument, removing any control characters. |
| [setSource()](#setSource) | Set the source value. |

------------------------------------------------------------------------


### \_\_init\_\_()


Initialize the Keithley 2400 SourceMeter.


Usage

``` python
__init__(
    interface,
    **kwargs,
)
```


#### Parameters


`interface: str`  
VISA resource name for the instrument

`**kwargs: dict`  
Additional arguments to pass to the VISA device initialization


------------------------------------------------------------------------


### configure()


Configure the Keithley 2400.


Usage

``` python
configure(
    sourceMode=None,
    senseMode=None,
    fourWire=None,
    senseAutoRange=None,
    senseRange=None,
    sourceAutoRange=None,
    sourceRange=None,
    senseLimit=None,
    output=None,
    delayAuto=None,
    delay=None,
    reset=False,
)
```


#### Parameters


`sourceMode: str = None`  
"VOLT" or "CURR", physical parameter to source.

`senseMode: str = None`  
"VOLT" or "CURR", parameter to measure.

`fourWire: bool = None`  
Four wire measurement; None uses the current configuration.

`senseAutoRange: bool = None`  
Autodetect the sense range.

`senseRange: float = None`  
Largest expected measurement value; the device picks the next inclusive range.

`sourceAutoRange: bool = None`  
Autodetect the source range.

`sourceRange: float = None`  
Largest expected source current; the device picks the next inclusive range.

`senseLimit: float = None`  
Voltage limit.

`output: bool = None`  
Turn the output on.

`delayAuto: bool = None`  
Automatically choose the delay for stabilizing the output.

`delay: float = None`  
Delay in seconds for stabilizing the output before doing an internal measurement. Does not affect other devices.

`reset: bool = ``False`  
If True, reset the device.


#### Examples

``` python
>>> device.configure(sourceMode="CURR", senseMode="VOLT",
...                 fourWire=True, senseAutoRange=True,
...                 sourceRange=0.001, output=True)
```


#### Notes

The output will initially be turned off during configuration. This will configure the Keithley to be in 4W sense mode, detect the sense range automatically. The range is chosen to include 1mA and the output is turned on.

------------------------------------------------------------------------


### getSense()


Get the current sense value from the instrument.


Usage

``` python
getSense()
```


#### Returns


`float`  
The measured sense value


------------------------------------------------------------------------


### getSource()


Get the current source value from the instrument.


Usage

``` python
getSource()
```


#### Returns


`float`  
The measured source value


------------------------------------------------------------------------


### read()


Read data from the instrument, removing any control characters.


Usage

``` python
read(nbytes=None)
```


#### Parameters


`nbytes: int = None`  
Number of bytes to read


#### Returns


`str`  
Response from the instrument with control characters removed


------------------------------------------------------------------------


### setSource()


Set the source value.


Usage

``` python
setSource(current)
```


#### Parameters


`current: float`  
The value to set for the source, either voltage or current depending on the source mode
