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

Add ability to explicitly query by passing '?' as first argument. #10

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

Conversation

KLimit
Copy link

@KLimit KLimit commented Jan 10, 2023

Tested with dummy instrument that simply prints the compiled SCPI string and whether it is querying or writing.

Some of the instruments that I am working with have the option to or require arguments after the question mark when querying a value. For example, modules used with a Keysight DAQ970 can have specific channels queried. For example, MEAS:VOLT:DC? 10,0.001,(@101, 102, 103) measure the DC voltage w/ 10V range, 1mV resolution, on channels 01, 02, and 03 of module 1.

As mentioned in the commit message, I've only tested this with a "fake" VISA instrument so far:

class FakeInst:
    def write(self, cmd):
        print(f"writing `{cmd}`")
    def query(self, msg):
        return input(f"asking `{msg}` > ")

If you'd prefer tests with an actual VISA instrument, let me know. Also, if you have particular formatting preferences let me know what they are.

Tested with dummy instrument that simply prints the compiled SCPI string
and whether it is querying or writing.
@bicarlsen
Copy link
Owner

Thanks so much for this update. Can you also update the README documentation to include an explanation and example.

@KLimit
Copy link
Author

KLimit commented Feb 22, 2023

Thanks so much for this update. Can you also update the README documentation to include an explanation and example.

Sure thing! I've been busy with some other projects, so I might not be able to add that documentation right away. Just wanted to give an update that I haven't abandoned this PR.

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