easy-scpi icon indicating copy to clipboard operation
easy-scpi copied to clipboard

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

Open KLimit opened this issue 2 years ago • 2 comments

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.

KLimit avatar Jan 10 '23 23:01 KLimit

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

bicarlsen avatar Jan 14 '23 10:01 bicarlsen

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.

KLimit avatar Feb 22 '23 19:02 KLimit