Friday, May 29, 2015

Should I use RS-232 or GPIB to communicate with my instrument?

Hi everyone,

I am writing this as I am preparing to go to the beach for a week.  My topic today will be short but hopefully useful.    We are going to talk about a subject that has been near and dear to my heart for the past 15 years, serial versus GPIB communication on our instruments.

Back in the days before LAN and USB became instrument standard interfaces, many of our products were designed with RS-232 serial ports in addition to GPIB.  RS-232 is standard on the 681xB AC Source/Analyzers, the E36xxA bench power supplies, the N330xA Electronic loads, as well as a few other products.

RS-232 is an interesting option for communication because it is free, most people have them standard on their computers, and you really only need to buy a reasonably priced cable.  The main drawbacks are the fact that you need to put it in remote mode yourself using the "SYST:REM" command, that reasonably priced cable has to be properly configured, and it is slower than GPIB.  The main drawbacks of GPIB is that it costs more and you need to purchase hardware.

I did some benchmarking this morning using my trusty 6811B AC Source/Analyzer.  I used the proper RS-232 cable and my Keysight 82357B USB to GPIB converter to connect to the 6811B.  I wrote a small program that measures the time to send a "*IDN?" command and receive a response.  The program looped 100 times and calculated the average time.  With GPIB, the average time to send and read back took about 7 ms.  With RS-232, the same send command and read back the response took about 50 ms.

So to answer my titular question, "Should I use RS-232 or GPIB to communicate with my instrument?", my answer in every instance would be to use GPIB.  I know that it is more expensive but you really get what you pay for in this instance.  GPIB is a much faster, more reliable way to communicate with your instruments.

Thanks for reading.  Let us know if you have any questions.

1 comment:

  1. Does the 34401A show up as a COM device when I use the Keysight 82357B USB to GPIB converter? I am wondering if I can read the COM, with a simple serial read library, or will it show up as 'USB Test and Measurement Device.'?

    ReplyDelete

Note: Only a member of this blog may post a comment.