Posted Tue, 03 Sep 2024 19:23:53 GMT by Cook, John
Hello,
My co-worker and I are using TEK MSO5000 and TEK MSO56 type scopes and trying to automate taking measurements.

We're doing pretty good, got the scope to respond to commands to setup measurement and also to give us a response.

Commands to setup a measurement look like this:

MEASUrement:MEAS3:TYPE AMPLITUDE; ACQUIRE:STATE ON

And to get a response, we'd send this:

MEASUrement:MEAS3:VALue?

Now the not-so-nice part.  Sometimes the response is just the value:  "2.453" and sometimes the result is a string that echos the command and also the response:  ":MEASUREMENT:IMMED:VALUE 2.453"

What I'd like is just the value, so I can use a python cast and make it a nice floating point value and I'm good to go.  The manual says that the response is the second one, with all that text.

My co-worker and I are using two different scopes, in two different labs and found that sometimes we get just the value, and sometimes the command and value, and we can't figure out why its one sometimes, and sometimes the other.  We think its a bug in the 'scope firmware.  Anybody got some feedback?  Thanks.
Posted Thu, 05 Sep 2024 07:35:13 GMT by PANDA, SARADA
Hello , I am also having that issue as well . I was seeing this problem in between USB and LAN . Although i have not done anything to firmware , but i modified my code , so that when i am on USB , it will come direct value and when i am on LAN , it will come string , so i will strip the string and use the value .
For this i used :- (here query command).strip(" ")[1]

If you are ok with this approach you can go ahead , otherwise if you found any other method , please comment here , i will also learn .

Thank you , have a nice day man.
Posted Thu, 05 Sep 2024 12:20:22 GMT by Cook, John
What I am seeing is that the scope sends just the value the first time, or sometimes the second time you take a measurement, and every time after it sends the full string.  I have written some Python to parse the value from the string and to detect when it is sending just the value or the string so I am good to go now, but this is an annoying "feature".
 

You must be signed in to post in this forum.