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

Interpret first byte as length if command doesn't match expected #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cellularmitosis
Copy link

Multiple "read" commands in a row seem to fail using the existing code.

A work-around seems to be that if the command byte wasn't as expected, to reinterpret the first byte as the message length, which seems to work.

@cellularmitosis
Copy link
Author

Hmm, but this makes my '*IDN?' loop messed up. The first character is missing:

b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'
b'EWLETT-PACKARD,34401A,0,10-5-2'

Perhaps there is an off-by-one error somewhere in the buffer handling of this code?

@sirmo
Copy link

sirmo commented Aug 16, 2018

Hey there @cellularmitosis this is Muxr from eevblog forums. I have a PR that could be of use to you. You can check it out from my fork here: https://github.com/sirmo/ugsimple-usb-gpib/tree/fixes1

Or see it here: #7

I have implemented a new ask() method which resolved all the issues I was having with this lib. In fact I was able to backup the NVRAM contents from my hp 3458a with it.

Maybe the maintainer can take a look and figure out how to fix the read() method which has desyncing issues for me too. I didn't want to overwrite it since I am not 100% sure how it's supposed to work. Instead I just use the new ask() method in that Pull Request (7).

p.s. Anyways, hope that's useful to you, since it beats paying couple of hounded of dollars for another GPIB interface. (better to use that on low tempco resistors :P)

@cellularmitosis
Copy link
Author

@sirmo awesome! 😀

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

Successfully merging this pull request may close these issues.

2 participants