06-17-2013 03:02 PM
I am working on a simple VI to test some commands via GPIB (IEEE-448) with an extremely outdated HP 3562a Dynamic Signal Analyzer. My code just wants to unmask some bits in a register, read the register information through a query, and then set the front panel of the analyzer back to Local mode. Everything seems to be working except for the read. I expect 15 bits (about 2 bytes) of information, however I am required to read 15 bytes before reaching the end of the output string with GPIB Read. (I discovered this value through trial and error). I also do not seem to be getting the correct results from my query/read.
First, this is the register I want to read. This information comes from the programming manual.
I am interested in registers 4 and 13:
Here is how I mask the bits:
Here is my code:
It runs fine, however as you can see above, I have to hardcode in "15" in order to reach the end of the output. Additionally, the output shows 0 when it should show 8208 (bits 4 and 13's values added together from the first write).
Here are my results:
As you can see, the "eoi" field (meaning end of output string) is set in the status. And unfortunately the result is 0 (which seems incorrect or meaningless).
Does anyone know how to correct this appropriately read the bytes of the register using GPIB Read?
Solved! Go to Solution.
06-18-2013 09:13 AM
A couple comments:
First, you are talking to an HP instrument so it is all together possible (perhaps even likely) that the instrument has a bug in it.
Second, the reason you have to read 15 bytes is because that is how long a standard data response is. The read is not returning the status result.
Third, the query is "ISM?" but you are sending "IS?" (no "M").
Mike...
06-18-2013 09:23 AM - edited 06-18-2013 09:26 AM
nvm - Mike has it covered. 🙂
06-18-2013 09:27 AM - edited 06-18-2013 09:35 AM
@mikeporter - I am going to try that now. It mentioned "IS?" on an earlier page, but I will give that a try and let you know the results!
@billko - I show the status indicator above, but those bits do not match up with the ones from the Instrument Status Register that I am attempting to query. How can I get back the 1's and 0's from the register query if it isn't in the output string?
EDIT:
Mikeporter's suggestion worked perfectly! "ISM?" was the way to go! It outputs 8208 in the output string as I hoped! Thanks for your help!
Just one last question: How did you know 15 bytes is the minimum read? Could you explain (or link me to) more information on how the read actually gets the results? Thanks again so much!
06-18-2013 09:53 AM
I am sorry you had to read my post before I edited it! 😞
06-18-2013 09:53 AM
Don't worry about it 😄 It got worked out!
06-18-2013 10:36 AM
Ah yes, the 15 bytes... If you look in the manual for the device you will find a place where it describes the default response to a read. The numeric format it uses has 15 characters,
Many HP instruments define a default response so if you are reading measurement results you don't have to send a request every time.
Mike...
06-18-2013 10:45 AM
Ill have to look for that. Good to know! Thanks again for all the help! You are a champion.