LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Query GPIB Connection

Solved!
Go to solution

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:
IS.JPG

 

Here is how I mask the bits:

mask.JPG

 

Here is my code:

 

gpib test.JPG

 

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:

 

status.JPG

 

output.JPG

 

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?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 1 of 8
(2,612 Views)
Solution
Accepted by topic author MrHappyAsthma

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 2 of 8
(2,580 Views)

nvm - Mike has it covered.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 8
(2,575 Views)

@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!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 4 of 8
(2,568 Views)

I am sorry you had to read my post before I edited it!  😞

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(2,550 Views)

Don't worry about it 😄  It got worked out!

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 6 of 8
(2,548 Views)

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...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 8
(2,533 Views)

Ill have to look for that.  Good to know!  Thanks again for all the help!  You are a champion.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
0 Kudos
Message 8 of 8
(2,530 Views)