Skip to content

Instrument server timeout check causes unnecessary errors  #136

@AdriaanRol

Description

@AdriaanRol

When setting a dac voltage or acquiring data the time between a function call and the response getting back is typically larger than the default timeout (digging around in the code tells me this is 2s but I could not find where this is set).

I have had the error below when 1 setting a voltage on the IVVI (directly related to the delay in setting it slowly over a large range) and 2 when acquiring data with the CBox (homebuilt FPGA). Now that I think of it, this may also be the error I am seeing in #119 when loading in sequences in the AWG (typically takes somewhere between 3s and 1min depending on the sequence).

I understand the need for a timeout on a server call, however currently it is raising exceptions where it should not. I am again reverting back to using server_name=None to circumvent the error.

Solutions I can think of, 1. longer default timeout, pro easy to implement, con not general to say a measurement that takes very long (several mins is not uncommon when averaging a lot). 2, have no timeout and rely on the underlying VISA timeouts.

Both are not very good but to me this is a serious issue as it breaks the way I work. I also think that whatever solution we implement should not be something I do when instantiating the instrument but something general that the user (other than me) does not have to think about.

---------------------------------------------------------------------------
Empty                                     Traceback (most recent call last)
<ipython-input-30-3a8352c28258> in <module>()
----> 1 IVVI.dac1.set(-40)

d:\githubrepos\qcodes\qcodes\instrument\remote.py in set(self, value)
    128         # to 'write' below. how do we decide, and how do we let the user
    129         # do it?
--> 130         self._instrument.connection.ask('set', self.name, value)
    131 
    132     # manually copy over validate and __getitem__ so they execute locally

d:\githubrepos\qcodes\qcodes\instrument\server.py in ask(self, func_name, *args, **kwargs)
    134         Query the server copy of this instrument, expecting a response
    135         '''
--> 136         return self.manager.ask('ask', self.id, func_name, args, kwargs)
    137 
    138     def write(self, func_name, *args, **kwargs):

d:\githubrepos\qcodes\qcodes\utils\multiprocessing.py in ask(self, timeout, *query)
    332                 if self._error_queue.empty():
    333                     # only raise if we're not about to find a deeper error
--> 334                     raise e
    335             self._check_for_errors(self._expect_error)
    336 

d:\githubrepos\qcodes\qcodes\utils\multiprocessing.py in ask(self, timeout, *query)
    324 
    325             try:
--> 326                 res = self._check_response(timeout)
    327 
    328                 while not self._response_queue.empty():

d:\githubrepos\qcodes\qcodes\utils\multiprocessing.py in _check_response(self, timeout)
    301 
    302     def _check_response(self, timeout):
--> 303         res = self._response_queue.get(timeout=timeout)
    304         if res == SERVER_ERR:
    305             self._expect_error = True

C:\Anaconda3\lib\multiprocessing\queues.py in get(self, block, timeout)
    103                     timeout = deadline - time.time()
    104                     if timeout < 0 or not self._poll(timeout):
--> 105                         raise Empty
    106                 elif not self._poll():
    107                     raise Empty

Empty: 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions