IO Modules

hardware_control.gui.controls.IOModule module

../../_images/IOModule.png
class hardware_control.gui.controls.IOModule.AnalogInputChannel(app, instrument_name: str, channel: str, label: str = '', units: str = '', show_ID_labels=True, use_prefix=True)

Bases: QGroupBox

class hardware_control.gui.controls.IOModule.AnalogOutputChannel(app, instrument_name: str, channel: str, label: str = '', units: str = '', show_ID_labels=True)

Bases: QGroupBox

class hardware_control.gui.controls.IOModule.DigitalInputChannel(app, instrument_name: str, channel: str, label: str = '', units: str = '', show_ID_labels=True)

Bases: QGroupBox

hc_update()

Update parameter readout in the channel widget.

class hardware_control.gui.controls.IOModule.DigitalOutputChannel(app, instrument_name: str, channel: str, label: str, units: str, show_ID_labels: bool = True)

Bases: QGroupBox

class hardware_control.gui.controls.IOModule.IOModule(app, instrument_name, channel_data: dict | str, name: str = 'IO Module', num_columns: int = 1, show_ID_labels=False)

Bases: QGroupBox

A GUI for a generic Input/Output (IO) module.

Parameters:
  • app (hardware_control.App) – The main app instance

  • instrument (hardware_control.base.Instrument) – The instrument that will be controlled by the control module

  • channel_data (dict or json-file) – A dictionary that contains data for each channel used (see example below)

  • num_columns (integer) –

  • show_ID_labels (bool) –

Example

channel_data =  {
    "extraction_voltage_out": {
        "DIR": "OUTPUT",
        "TYPE": "ANALOG",
        "ID_STR": "Mod7/ao4",
        "LABEL": "Extraction Voltage (set)",
        "UNITS": "V",
        "OPTIONS": {
            "CHX_V_MAX": "10",
            "CHX_V_MIN": "-10"
        }
    },
}
ensure_all_fields(channel_data_dict: dict, channel_data_key='')

Test for certain fields that need to be present in a channel_data dict item.

read_channel_data(channel_data)

Set the channel parameters from a JSON file or a dictionary.

update_readout() None

Update parameter readouts with values from the instrument.