Jump to content

GPIB problem with Agilent 8504

Recommended Posts

I have a strange problem with an Agilent 8504B instrument.

Here is what I do:

  • Open VISA resource
  • Clear VISA buffers
  • Write two commands in one message (Data Format, and Send Plot Data)
  • Read until all plot data has been received
  • Clear VISA buffers
  • Close VISA resource

This works perfectly the first time I execute this.

Sometimes it even works multiple times.

Mostly though it hangs the second time I execute it. Specifically it hangs in the VISA Write command. On the instrument I can see that it is stuck in listening mode. I can wait forever and nothing happens The VISA write does not time out. When I try to close my program LV hangs. If instead I power cycle the instrument, the VISA write function exits with an error. Once I power cycle the everything works again for one time.

I replaced the VISA API with the GPIB API and got the same results.

Any ideas what could be happening here?

Link to comment

This most likely has nothing to do with VISA and the PC/GPIB controller side and everything to do with the state the instrument is left in after the last command - it's not really ready to accept another command string. I'm assuming this is a SCPI instrument (I really know nothing of this specific instrument but all of the Agilent stuff I worked with has been SCPI). If so, after you read the data, can you send an error query (:SYST:ERR? or something like that). If that doesn't work, then maybe you have to handle errors by reading the status byte and finding out if anything in the error or event queue is set. This stuff is all very specific to the instrument, so you'll have to dig through the documentation to find out exactly how the 8504B operates. That or just call a *RST command and start your entire routine from a known state every time (this would be the nuclear option :rolleyes: )


Link to comment

Well, I made it work. Brute force style.

I noticed that it worked every time that I ran through it in execution highlighting. So I added a 500ms delay after each VISA command and now it works fine.

I am glad that this is not a time critical application though :-)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.