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

timeout bug in gpib server #334

Open
ypzhong opened this issue Mar 14, 2016 · 2 comments
Open

timeout bug in gpib server #334

ypzhong opened this issue Mar 14, 2016 · 2 comments

Comments

@ypzhong
Copy link

ypzhong commented Mar 14, 2016

Hi,

I tried to use the new labRAD but encountered GPIB timeout frequently. Finally I found that there is a possible bug in the gpib server, it seems that all the upper level configuration of the instrument finally configures the timeout via this function in gpib_server.py:

@setting(2, time='v[s]', returns='v[s]')
    def timeout(self, c, time=None):
        """Get or set the GPIB timeout."""
        if time is not None:
            c['timeout'] = time
        return c['timeout']

However it only updates the context timeout, but never sends out the update to the instrument in reality. This is not a problem when the communication is short because the pyvisa itself has a default timeout already set there. But when we need to wait for half a minute, then it becomes a serious problem.

The solution should be simple, I changed it in my computer like:

@setting(2, time='v[s]', returns='v[s]')
def timeout(self, c, time=None):
    """Get or set the GPIB timeout."""
    if time is not None:
        c['timeout'] = time
        instr = self.getDevice(c)
        instr.timeout = time['ms'] #added by Youpeng. Note that for pyvisa>1.5, timeout is in unit of millisecond. March 14, 2016.
        print c['addr']+' timeout is',time
    return c['timeout']

and it works now.

@DanielSank
Copy link
Member

@ypzhong Thank you for this information. Please note that the whole point of having this code repository public is so that people can submit changes. Could you please submit your change using a github pull request?

@ypzhong
Copy link
Author

ypzhong commented Dec 16, 2016

@DanielSank OK. Actually I don't use github much and I haven't learned how to use github pull request yet...... But I will figure it out and get accustomed to it. Thanks.

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