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

Using DAQ module with zhinst-qcodes #46

Open
grothe6 opened this issue Jul 27, 2022 · 1 comment
Open

Using DAQ module with zhinst-qcodes #46

grothe6 opened this issue Jul 27, 2022 · 1 comment

Comments

@grothe6
Copy link

grothe6 commented Jul 27, 2022

Using the daq module on a MFLI, I have several questions regarding the workflow:

  1. with zhinst-toolkit I can subscribe to nodes like this:
session = Session("localhost")
device = session.connect_device("devXXXX")
daq = session.modules.daq
daq.subscribe(device.demods[0].sample.x)
daq.subscribe(device.demods[0].sample.y)

With zhinst-qcodes however, daq.subscribe takes a ZIParameter, which I cannot seem to get:

session = ZISession("localhost")
device = session.connect_device("devXXXX")
daq = session.modules.daq

daq.subscribe(device.demods[0].sample.x)
# AttributeError: 'ZIParameter' object has no attribute 'x'

daq.subscribe(device.demods[0].sample.tk_node.x)
# Tries to subscribe to /devXXXX/demods/0/sample.x.tk_node, which ends up not working

daq._tk_object.subscribe(device.demods[0].sample.tk_node.x)
# This works

What is the preferred way of subscribing to those nodes? What is with .avg and the like?

  1. What is the reason, that the daq module does not have execute() and read() functions? Is there a more elegant way than calling daq._tk_object.execute() and daq._tk_object.read()?

Thank you and best regards

@tobiasah
Copy link
Member

Currently our QCoDeS driver does not have a adapted version like the zhinst-toolkit does. Meaning it just is just a ZIBaseModule that works for all LabOne modules. That is why your observations are correct both in terms of subscribing and of the execute and read function.

But technically nothing speaks against implementing it. One challenge would be to integrate the signal selection (.x.avg...) but the ZIParameter class could handle that. The only reason the QCoDeS driver does not support this at the moment is because no one asked for it 😇 and the driver is still in its developing stage.

For now you have two options falling back to toolkit like you describe or use the underlying ziPython module directly:

from zhinst.qcodes import MFLI
device = MFLI("devXXXX", "localhost")
session = device.session 
# or 
# session = ZISession("localhost")
# device = session.connect_device("devXXXX")

daq = session.modules.daq.raw_module
daq.subscribe(device.demods[0].sample.zi_node + ".x")
daq.execute()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants