Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding a function to qdac2 driver #215

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,21 @@ def load_voltage_list(
print(
f"Set-up QDAC2 channel {channel} to step voltages from a list of {len(voltage_list)} items on trigger events from the {trigger_port} port with a {qdac.query(f'sour{channel}:dc:list:dwell?')} s dwell time."
)


# set the QDAC voltage to a specific value
def set_QDAC_voltage(
qdac,
channel: int,
voltage: float,
):
"""
Configure a QDAC2 channel to play a specicif voltage, using pyvisa commands.

:param qdac: the QDAC2 object.
:param channel: the QDAC2 channel that will output the voltage from the voltage list.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The voltage doesn't come from the voltage list here, but from the specified value

:param voltage: the desired voltage to output from the QDAC channel.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Specify the unit as well

:return:
"""
qdac.write(f"sour{channel}:dc:mode FIX")
qdac.write(f"sour{channel}:volt {voltage}")
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,21 @@ def load_voltage_list(
print(
f"Set-up QDAC2 channel {channel} to step voltages from a list of {len(voltage_list)} items on trigger events from the {trigger_port} port with a {qdac.query(f'sour{channel}:dc:list:dwell?')} s dwell time."
)


# set the QDAC voltage to a specific value
def set_QDAC_voltage(
qdac,
channel: int,
voltage: float,
):
"""
Configure a QDAC2 channel to play a specicif voltage, using pyvisa commands.

:param qdac: the QDAC2 object.
:param channel: the QDAC2 channel that will output the voltage from the voltage list.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The voltage doesn't come from the voltage list here, but from the specified value

:param voltage: the desired voltage to output from the QDAC channel.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Specify the unit as well

:return:
"""
qdac.write(f"sour{channel}:dc:mode FIX")
qdac.write(f"sour{channel}:volt {voltage}")
Loading
Loading