GPIB Connection to 2340A - Response garbled #photo-notice


Abdul Nizar
 

Baud rate or other port settings do not matter since there is no underlying physical UART in Prologix GPIB-USB.

-----Original Message-----
From: TekScopes@groups.io [mailto:TekScopes@groups.io] On Behalf Of Dave Wright
Sent: Thursday, June 10, 2021 9:54 AM
To: TekScopes@groups.io
Subject: Re: [TekScopes] GPIB Connection to 2340A - Response garbled #photo-notice

Not sure about how USB version of Prologix driver will interpret a baudrate setting, as that is only significant if the USB endpoint is in fact a UART, which it may or may not be (anybody familiar with Prologix USB internals here..?). So, you might try using higher baudrates in your PyVisa initialization to see if transfers go faster...


Dave Wright
 

Not sure about how USB version of Prologix driver will interpret a baudrate setting, as that is only significant if the USB endpoint is in fact a UART, which it may or may not be (anybody familiar with Prologix USB internals here..?). So, you might try using higher baudrates in your PyVisa initialization to see if transfers go faster...


unclebanjoman
 

I have never used Prologix but looking at the screenshot of Prologix GPIB configurator I noticed that there is the EOT (End of Transmission) configuration. Surely if it is set to CR / LF there is a good chance that the Tek will interpret the extra CR as an unknown character.
I suggest experimenting with the various configuration possibilities until you find the most suitable choice.

For your information I use by years the Agilent/Keysight 82357B USB / GPIB interface with the Agilent I/O Suite libraries. So I can use the VISA programming API. Sometimes I use low-level SICL libraries (Standard Interface Control Library) to create test programs.

I don't use NI-VISA because they are very "huge". They force you to install all the software package and the .NET framework when you only need a driver and a DLL or two...

The Agilent IO Suite is much more efficient and streamlined. I have been using it since 2014, on WIndows XP. I currently use Windows 7 and Windows 10 and I have never found serious problems, neither in installation, nor in the use of drivers / DLLs.
By contrast, the National Instruments libraries are plenty of bugs, aside from the fact that they are an "elephant" in every sense of the word.
I think NI is more oriented and suitable toward virtual instrumentation. (LabView docet).
Agilent/Keysight are more suitable for "real" instruments, hardware instrumentation with "real" GPIB hardware (and not an emulated one).

Maybe also that Agilent/Keysight (formerly the Hewlett-Packard) GPIB software/hardware are happier when they discover they are connected to my vintage instruments, Tektronix, HP or Philips, haha

Max


Joerg
 

Thanks - I'll try that. So far, I've only got it to work with the EOI/LF setting. But I can acquire waveforms in binary and ascii so that seems to work for now. It is quite slow though?

What is the maximum baud rate I can expect from a 2430A with a Prologix GPIB to USB adapter? Does anyone have experiences here?


unclebanjoman
 

Are you sure you're transmitting the LF terminator at the end of the command string? If you send CR/LF pair as line break, the scope can get confused.
Your scope is set to use EOI/LF termination. I suggest to set it to EOI only.
Doing so, you can transmit the ASCII commands without any CR/ LF pair. The response from the scope will be with no CR/LF also, in this way you have to count the characters received and eventually append the CR/LF before to show the response string on the screen.

For a long time I have been working on programs written by me in C/C++ that use GPIB, in conjunction with HP/Tek instruments and I always use EOI as end of transmission signaling.
This way, I avoid to worry about how CR and LF are translated by the various operating systems.

I am not familiar with the Mac OS but being a Unix derivative, I assume that any string that is sent to the transmitting device will automatically contain the LF character appended as line break/ terminator. This is, if you uses a stream device configured as "text". If you do not want the LF character to be added to the end of each transmitted (or received) string, you must remember to open the stream in "binary" mode (no CR or LF translation in input / output).
In Windows the line break terminator is a pair of CR/LF. In Linux/Unix LF only. First Mac (Apple Macintosh!) used CR only as a line break!

Max


Joerg
 

Yippie - that was too easy!

'ID TEK/2430A,V81.1,"18-JAN-90 V2.31 /2.5"\r'

Oddly, when I tried again now - the scope actually beeped on the request and said: "Unknown Symbol". I have no idea why that was not the case the first time around. I had expected a sensible error message like that.

Thanks for the quick reply.


 

On Wed, Jun 9, 2021 at 11:38 AM, Joerg wrote:


inst.query("*IDN?")

Any help is greatly appreciated.
The 2430A may not understand *IDN?. Try ID? instead.

/Håkan


 

To increase reference value for posterity, you may consider changing modelno. to 2430A.

Raymond


Joerg
 

Hi all,
I've been trying to use use GPIB interface on my 2340A and had only limited success so far. I've bought a Prologix GPIB-USB adapter for the task. I can connect to the instrument and send commands that show up on the debug screen - see https://groups.io/g/TekScopes/photo/263696/3241684?p=Created,,,20,2,0,0 - here just asking for the instrument to identify. The response, however, is not intelligible. The settings I've used on the scope are here: https://groups.io/g/TekScopes/photo/263696/3241685?p=Created,,,20,2,0,0

And the python code I've used is

import pyvisa
rm = pyvisa.ResourceManager('@py')
inst = rm.open_resource('ASRL/dev/cu.usbserial-PX4QY88I::INSTR')
inst.baud_rate = 9600
inst.read_termination = '\n'
inst.write_termination = '\n'
inst.timeout = 2500
inst.encoding = 'latin-1'
inst.query("*IDN?")

and which returns 'ÿ\r'

setting the instrument encoding in python to 'ascii' (the default) instead of 'latin-1' results in an error as byte 0 cannot be decoded. I'm working a Mac and would like to keep working in python and the http://www.ke5fx.com/gpib/readme.htm toolkit is Windows only.

Any help is greatly appreciated.