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

Allow writes with no expected response #15

Closed
famish99 opened this issue Mar 2, 2015 · 3 comments
Closed

Allow writes with no expected response #15

famish99 opened this issue Mar 2, 2015 · 3 comments

Comments

@famish99
Copy link
Contributor

famish99 commented Mar 2, 2015

Most of the SCPI based equipment I use (Agilent DMM, DAQ, etc.) if the command is write-only, will not allow you to do a read afterwards. The mocks must be queried (write+read) in order to flush the newline response. There should be some way to make the writes work without having to do a read.

Current workaround is overwriting my write() function with query() for the unittests, but I'd like a way to do this more cleanly.

@hgrecco
Copy link
Member

hgrecco commented Mar 3, 2015

Yes. This is an unintended behavior. Would you like to submit a patch? It could be along the following lines.

If there is not r field in the dialogue, store a particular sentinel object (maybe called MISSING). You will need to change at least the parser and to_bytes)
Then in Device.write, if the matched response is this MISSING value then do not write the eom.

@famish99
Copy link
Contributor Author

famish99 commented Mar 3, 2015

I can look into it because I'm running into it quite a bit. Thanks for the pointers

@hgrecco
Copy link
Member

hgrecco commented Mar 6, 2015

I think this can be closed now.

@hgrecco hgrecco closed this as completed Mar 6, 2015
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