Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions qcodes/instrument_drivers/AimTTi/Aim_TTi_QL355_TP.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,53 @@
from ._AimTTi_PL_P import AimTTi
from typing import Any, Callable

from qcodes.parameters import Parameter

from ._AimTTi_PL_P import AimTTi, AimTTiChannel


class AimTTiQL355TP(AimTTi):
"""
This is the QCoDeS driver for the Aim TTi QL355TP series power supply.
"""

pass
def __init__(self, name: str, address: str, **kwargs: Any) -> None:
"""
Args:
name: Name to use internally in QCoDeS.
address: VISA resource address
"""

super().__init__(name, address, **kwargs)

for channel in [self.ch1, self.ch2]:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make it more reusable, use the

        for i in range(1, self.numOfChannels + 1):
            channel = AimTTiChannel(self, f"ch{i}", i)

Instead of fixed channels (See _AimTTI_PL_P.py line 275-276)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@AdamVerner Are you still interested in this work?

@huisman2501 would you be able to create a new pr that takes over this work otherwise?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am currently working on AIM PSUs and have some more properties that I can add. They seem to be more generic among models. I will see what I can do (I have a MX100TP and CPX400DP to test with)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's been more than 2 years now, I work in completly different field now. Feel free to take it over from me 😄

channel.over_voltage_protection = Parameter(
"over_voltage_protection",
get_cmd=self._get_value_reader(channel, "OVP"),
get_parser=float,
set_cmd=f"OVP{channel.channel} {{}}",
label="Over voltage protection",
unit="V",
instrument=channel,
)

channel.over_current_protection = Parameter(
"over_current_protection",
get_cmd=self._get_value_reader(channel, "OCP"),
get_parser=float,
set_cmd=f"OCP{channel.channel} {{}}",
label="Over current protection",
unit="A",
instrument=channel,
)

def _get_value_reader(self, channel: "AimTTiChannel", command: str) -> Callable[[], float]:
def _value_reader() -> float:
channel_id = channel.channel
_value = channel.ask_raw(f"{command}{channel_id}?")
_value_split = _value.split()
return float(_value_split[1])
return _value_reader

def trip_reset(self) -> None:
"""Clear all trip conditions on the device"""
self.write("TRIPRST")