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

DevXXXX/STATS/PHYSICAL/*v* nodes can't be assign with the new HF2LI driver #31

Closed
ElricF opened this issue Mar 8, 2022 · 0 comments · Fixed by #32
Closed

DevXXXX/STATS/PHYSICAL/*v* nodes can't be assign with the new HF2LI driver #31

ElricF opened this issue Mar 8, 2022 · 0 comments · Fixed by #32
Assignees
Labels
bug Something isn't working

Comments

@ElricF
Copy link

ElricF commented Mar 8, 2022

Hello,

First of all, thank you for providing a new driver for the HF2LI product!
An issue happened to me when I tried it on my machine. I followed the example provided in zhinst-qcodes/examples/hf2.md

from zhinst.qcodes import HF2

device = HF2("DEVXXXX", "localhost")

and I got this error :

Node /DEV847/STATS/PHYSICAL/1V2 could not be added as parameter
 Parameter name must be a valid identifier got 1v2 which is not. Parameter names cannot start with a number and must not contain spaces or special characters
Node /DEV847/STATS/PHYSICAL/1V8 could not be added as parameter
 Parameter name must be a valid identifier got 1v8 which is not. Parameter names cannot start with a number and must not contain spaces or special characters
Node /DEV847/STATS/PHYSICAL/2V5 could not be added as parameter
 Parameter name must be a valid identifier got 2v5 which is not. Parameter names cannot start with a number and must not contain spaces or special characters
Node /DEV847/STATS/PHYSICAL/3V3 could not be added as parameter
 Parameter name must be a valid identifier got 3v3 which is not. Parameter names cannot start with a number and must not contain spaces or special characters
Node /DEV847/STATS/PHYSICAL/5V0 could not be added as parameter
 Parameter name must be a valid identifier got 5v0 which is not. Parameter names cannot start with a number and must not contain spaces or special characters

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Input In [2], in <module>
      1 from zhinst.qcodes import HF2
----> 3 device = HF2("DEV847", "localhost")

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\device_creator.py:109, in ZIDeviceHF2.__new__(self, serial, host, port, interface, name, raw, new_session)
     97 def __new__(
     98     self,
     99     serial: str,
   (...)
    106     new_session: bool = False
    107 ):
    108     session = ZISession(host, port, hf2=True, new_session=new_session)
--> 109     return session.connect_device(serial, interface=interface, name=name, raw=raw)

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\session.py:563, in Session.connect_device(self, serial, interface, name, raw)
    561     self._devices.update_device_properties(serial, name, raw)
    562 self._tk_object.connect_device(serial, interface=interface)
--> 563 return self._devices[serial]

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\session.py:47, in Devices.__getitem__(self, key)
     45         tk_device = self._tk_devices[key]
     46         name, raw = self._default_properties.get(key, (None, False))
---> 47         self._devices[key] = ZIDevices.DEVICE_CLASS_BY_MODEL.get(
     48             tk_device.__class__.__name__, ZIDevices.ZIBaseInstrument
     49         )(tk_device, self._session, name=name, raw=raw)
     50     return self._devices[key]
     51 raise KeyError(key)

File ~\anaconda3\envs\qcodes\lib\site-packages\qcodes\instrument\base.py:508, in AbstractInstrumentMeta.__call__(cls, *args, **kwargs)
    503 def __call__(cls, *args: Any, **kwargs: Any) -> Any:
    504     """
    505     Overloads `type.__call__` to add code that runs only if __init__ completes
    506     successfully.
    507     """
--> 508     new_inst = super().__call__(*args, **kwargs)
    509     is_abstract = new_inst._is_abstract()
    510     if is_abstract:

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\driver\devices\base.py:44, in ZIBaseInstrument.__init__(self, tk_object, session, name, raw)
     42 if not raw:
     43     self._init_additional_nodes()
---> 44 init_nodetree(self, self._tk_object.root, self._snapshot_cache)

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\qcodes_adaptions.py:590, in init_nodetree(layer, nodetree, snapshot_cache, blacklist)
    588 qcodes_list = tk_node_to_qcodes_list(node)
    589 name = qcodes_list[-1]
--> 590 parent = _get_submodule(layer, qcodes_list[:-1], snapshot_cache)
    591 do_snapshot = (
    592     "Stream" not in info.get("Properties")
    593     and "ZIVector" not in info.get("Type")
    594     and "Read" in info.get("Properties")
    595     and not any(x in node.raw_tree for x in snapshot_blacklist)
    596 )
    597 parent.add_parameter(
    598     parameter_class=ZIParameter,
    599     name=name,
   (...)
    613     snapshot_cache=snapshot_cache,
    614 )

File ~\anaconda3\envs\qcodes\lib\site-packages\zhinst\qcodes\qcodes_adaptions.py:557, in _get_submodule(layer, parents, snapshot_cache)
    550         module = ZINode(
    551             current_layer,
    552             node,
    553             zi_node="/".join(parents[:i] + [name, str(number)]),
    554             snapshot_cache=snapshot_cache,
    555         )
    556         current_layer.submodules[name].append(module)
--> 557     current_layer = current_layer.submodules[name][number]
    558 elif node not in current_layer.submodules:
    559     module = ZINode(
    560         current_layer,
    561         node,
    562         zi_node="/".join(parents[: i + 1]),
    563         snapshot_cache=snapshot_cache,
    564     )

File ~\anaconda3\envs\qcodes\lib\site-packages\qcodes\instrument\channel.py:281, in ChannelTuple.__getitem__(self, i)
    272 elif isinstance(i, tuple):
    273     return type(self)(
    274         self._parent,
    275         self._name,
   (...)
    279         snapshotable=self._snapshotable,
    280     )
--> 281 return self._channels[i]

IndexError: list index out of range

I am far from being an expert in this, but it seems clear that it can't go to the DevXXXX/STATS/PHYSICAL/*v* because of their name. I tried to see if i could enter these nodes with PuTTY (as it is recommended in the HF2Li User manual Ch5.2) and it didn't appreciate the format either. It seems like in order to go to the /DEVXXX/STATS/PHYSICAL/V node, one need to enter /DEVXXX/STATS/PHYSICAL/0;1;2;3;4 instead.

Let me know if you need anything more I can give,

Elric

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants