# devices.oxford:MercuryITC


Driver for Mercury ITC.


Usage

``` python
devices.oxford:MercuryITC(
    interface,
    **kwargs,
)
```


dataDict contains the commands (keys) and also the response from the ITC (values)


## Methods

| Name | Description |
|----|----|
| [extractValueFromDict()](#extractValueFromDict) | Extract a numeric value from a dictionary entry string. |
| [getAutoHTR()](#getAutoHTR) | Get the automatic heater control state. |
| [getAutoPID()](#getAutoPID) | Get the automatic PID control state. |
| [getDictValue()](#getDictValue) | Get a value from the working dictionary. |
| [getHeater()](#getHeater) | Get the current heater output level. |
| [getNV()](#getNV) | Get the needle valve opening. |
| [getPID()](#getPID) | Get the current PID control parameters. |
| [getTVTI()](#getTVTI) | Get the current temperature. |
| [logAllDicts()](#logAllDicts) | Log the contents of all dictionaries for debugging. |
| [queryAllDicts()](#queryAllDicts) | Query all dictionaries to update their values. |
| [queryDict()](#queryDict) | Query all entries in a dictionary. |
| [queryHeaterConf()](#queryHeaterConf) | Query the heater configuration. |
| [queryID()](#queryID) | Query the device ID. |
| [querySysConf()](#querySysConf) | Query the system configuration. |
| [queryTSensConf()](#queryTSensConf) | Query the temperature sensor configuration. |
| [queryTSensLoopConf()](#queryTSensLoopConf) | Query the temperature sensor loop configuration. |
| [queryTSensStatus()](#queryTSensStatus) | Query the temperature sensor status. |
| [queryWorkingDict()](#queryWorkingDict) | Query all entries in the working dictionary. |
| [query_merc()](#query_merc) | Query a value from the device. |
| [setAutoHTR()](#setAutoHTR) | Enable or disable automatic heater control. |
| [setAutoPID()](#setAutoPID) | Enable or disable automatic PID control. |
| [setHeater()](#setHeater) | Set the heater output level. |
| [setNV()](#setNV) | Set the needle valve opening. |
| [setPID()](#setPID) | Set PID control parameters. |
| [setTVTI()](#setTVTI) | Set the temperature setpoint. |
| [setVal()](#setVal) | Set a value on the device. |

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


### extractValueFromDict()


Extract a numeric value from a dictionary entry string.


Usage

``` python
extractValueFromDict(entry)
```


#### Parameters


`entry: str`  
Dictionary entry string containing a value


#### Returns


`float or None`  
Extracted numeric value, or None if conversion fails


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


### getAutoHTR()


Get the automatic heater control state.


Usage

``` python
getAutoHTR()
```


#### Returns


`bool`  
True if auto heater is enabled, False otherwise


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


### getAutoPID()


Get the automatic PID control state.


Usage

``` python
getAutoPID()
```


#### Returns


`bool`  
True if auto PID is enabled, False otherwise


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


### getDictValue()


Get a value from the working dictionary.


Usage

``` python
getDictValue(key)
```


#### Parameters


`key: str`  
Key in the working dictionary


#### Returns


`float or bool`  
Value from the working dictionary


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


### getHeater()


Get the current heater output level.


Usage

``` python
getHeater()
```


#### Returns


`float`  
Heater output level (typically 0-100%)


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


### getNV()


Get the needle valve opening.


Usage

``` python
getNV()
```


#### Returns


`float`  
Needle valve opening percentage (0-100%)


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


### getPID()


Get the current PID control parameters.


Usage

``` python
getPID()
```


#### Returns


`tuple`  
(P, I, D) values


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


### getTVTI()


Get the current temperature.


Usage

``` python
getTVTI(setp=False)
```


#### Parameters


`setp: bool = ``False`  
If True, also return the setpoint, by default False


#### Returns


`float or tuple`  
Current temperature in Kelvin, or (current_temp, setpoint) if setp=True


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


### logAllDicts()


Log the contents of all dictionaries for debugging.


Usage

``` python
logAllDicts()
```


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


### queryAllDicts()


Query all dictionaries to update their values.


Usage

``` python
queryAllDicts()
```


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


### queryDict()


Query all entries in a dictionary.


Usage

``` python
queryDict(
    queryDict,
    address="",
    signal=False,
)
```


#### Parameters


`queryDict: dict`  
Dictionary containing commands as keys

`address: str = ``""`  
Device address, by default ""

`signal: bool = ``False`  
Whether to use the signal variant of the command, by default False


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


### queryHeaterConf()


Query the heater configuration.


Usage

``` python
queryHeaterConf()
```


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


### queryID()


Query the device ID.


Usage

``` python
queryID()
```


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


### querySysConf()


Query the system configuration.


Usage

``` python
querySysConf()
```


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


### queryTSensConf()


Query the temperature sensor configuration.


Usage

``` python
queryTSensConf()
```


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


### queryTSensLoopConf()


Query the temperature sensor loop configuration.


Usage

``` python
queryTSensLoopConf()
```


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


### queryTSensStatus()


Query the temperature sensor status.


Usage

``` python
queryTSensStatus()
```


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


### queryWorkingDict()


Query all entries in the working dictionary.


Usage

``` python
queryWorkingDict()
```


Updates the values in the working dictionary with current device values.


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


### query_merc()


Query a value from the device.


Usage

``` python
query_merc(
    command,
    address="",
    signal=False,
)
```


#### Parameters


`command: str`  
Command to send

`address: str = ``""`  
Device address, by default ""

`signal: bool = ``False`  
Whether to use the signal variant of the command, by default False


#### Returns


`str`  
Response from the device


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


### setAutoHTR()


Enable or disable automatic heater control.


Usage

``` python
setAutoHTR(val=True)
```


#### Parameters


`val: bool = ``True`  
True to enable auto heater, False to disable, by default True


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


### setAutoPID()


Enable or disable automatic PID control.


Usage

``` python
setAutoPID(val=True)
```


#### Parameters


`val: bool = ``True`  
True to enable auto PID, False to disable, by default True


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


### setHeater()


Set the heater output level.


Usage

``` python
setHeater(val)
```


#### Parameters


`val: float`  
Heater output level (typically 0-100%)


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


### setNV()


Set the needle valve opening.


Usage

``` python
setNV(val)
```


#### Parameters


`val: float`  
Needle valve opening percentage (0-100%)


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


### setPID()


Set PID control parameters.


Usage

``` python
setPID(pid)
```


#### Parameters


`pid: tuple or list`  
Three-element sequence containing (P, I, D) values. Negative values will be clamped to 0.


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


### setTVTI()


Set the temperature setpoint.


Usage

``` python
setTVTI(val)
```


#### Parameters


`val: float`  
Temperature setpoint in Kelvin (limited to 0-300K range)


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


### setVal()


Set a value on the device.


Usage

``` python
setVal(
    setpoint,
    command,
    address="",
    signal=False,
    integer=False,
)
```


#### Parameters


`setpoint: float or str`  
Value to set

`command: str`  
Command to use

`address: str = ``""`  
Device address, by default ""

`signal: bool = ``False`  
Whether to use the signal variant of the command, by default False

`integer: bool = ``False`  
Whether to format the setpoint as an integer, by default False


#### Returns


`str`  
Response from the device
