Firmware V1.7.2611272028: count read for instruments that can't wait, an event log, and text fields in Benches

Two plots of the time between bytes on the GPIB bus during a 200,000 byte read over USBTMC. With a normal read the bus stops 48 times for 0.2 to 1.7 ms. In count read mode the longest pause is 5.3 microseconds.
The same 200,000 bytes read twice, measured on the GPIB bus with a logic analyzer.

Firmware V1.7.2611272028 is out today on the Firmware Updates page. It brings three new things, and the biggest one started with a question from a user.

Count read mode, for instruments that cannot wait

A user wanted to capture AC waveforms with an HP 3458A. At 100,000 readings per second, with its reading memory switched off, the 3458A produces a new reading every 10 µs and puts it straight onto the GPIB bus. If the previous reading has not been picked up by then, the meter gives up with TRIGGER TOO FAST. So the controller on the other end has to keep up with every single reading, for the whole capture.

A normal USBTMC read cannot promise that, and the reason is in the USBTMC protocol itself. Every block of data the adapter sends to the PC starts with a header that states how many bytes follow, so that number has to be known before the first byte goes out. But the adapter cannot know in advance how much an instrument will send. On GPIB a transfer simply ends when the instrument sets EOI or sends its terminator, and that can be after 10 bytes or after 10 megabytes.

So GPIBEE collects the incoming bytes in a buffer, and when the buffer is full it sends it to the PC together with the header. Then it has to wait until the PC asks for the next block, and while it waits it holds the GPIB handshake, which makes the instrument wait as well. How long that takes depends on the PC: its USB driver, the VISA library and whatever else the operating system is busy with at that moment.

The plot above shows what that looks like on the bus. During a 200,000 byte read the handshake stops 48 times, once every 4,084 bytes, for 0.2 to 1.7 ms. The 4,084 bytes are the buffer: together with the 12 byte header they make 4 KB. Most instruments do not care about those pauses. An instrument that has a new reading every 10 µs does: a 1 ms pause leaves about a hundred readings with nowhere to go.

Count read mode takes the PC out of that loop. One control request tells the adapter how many bytes are coming. With that number known up front, the header can go out straight away, and the next read returns exactly that many bytes in a single USB transfer, passed on to the PC as they arrive from the bus. EOI is ignored, and GPIBEE keeps the GPIB handshake running on its own instead of waiting for the PC. Measured the same way, the longest gap between two bytes dropped to 5.3 µs, comfortably inside the 3458A's 10 µs. That gap comes from the adapter itself, which reads the bus in blocks of 512 bytes. The read got faster as well, 1,005 kB/s instead of 867 kB/s, and on a high speed USB port the mode keeps up with about 930 kB/s from a fast instrument. The 3458A at 100 kS/s needs 200 kB/s.

Using it takes two calls in PyVISA: one control request to arm the mode, then a single read of exactly the number of bytes you expect, with chunk_size set to the same number. Section 8.3 of the manual has the complete example and the fine print, such as setting the VISA timeout longer than the whole acquisition. Many thanks to the user who asked for it. Continuous capture at full speed from an instrument like the 3458A is the kind of job I had hoped this adapter would be good at, and now it is.

An event log that explains what happened

Some problems in a measurement setup leave no trace. A read times out once every few hours, a script reports a lost link, and by the time you look, everything works again. The new Event log page in the web interface keeps a record of those moments.

The Event log page of the GPIBee web interface, listing instruments that did not respond, a session refused because another session held a lock, and a client that disconnected during a transfer, each with time, explanation, protocol and client IP address
The Event log page, here after two scripts competed for the same instrument.

It lists instruments that did not answer in time, sessions that used an instrument while another session was busy with it, and clients that disconnected in the middle of a transfer. Each entry says when it happened, which protocol and which IP address it came from, and what the likely reason is. In the screenshot a second session was refused because the first one held a lock on the instrument, and a client gave up on a transfer after 536 ms, most likely because its own timeout was shorter than the instrument needed.

An entry is a hint. Most of what ends up there is ordinary: an instrument that was still busy, a VISA discovery service sending *IDN? from another PC, a script that closed its session early. The log is there so you can see why something happened and fix the setup with some confidence. It pairs well with the Connections page and with exclusive locks, which a FAQ entry explains. If you write to me about a problem, the copy button puts the whole log on the clipboard, and scripts can read it as JSON. It is kept in memory and cleared on restart, and section 8.1 of the manual covers it in detail.

Text fields in Benches

Benches can now have text fields. Type a string, edit it, send it again, and pick CR, LF and EOI separately for each send. That is handy for printers, plotters and older instruments that want plain text with particular terminators. Bench commands also understand escapes such as \e for ESC and \x0C for a form feed, and a value can go inside a quoted string in a command, as in W TEXT "{v}".

Also in this release

VXI-11 instrument discovery over UDP, the "Find resources" in a VISA library, could stop answering. That is fixed.

Raw transfer rates in the latency article

The latency article from October has grown a new section. Its throughput numbers were all measured with a real instrument, a CMU200, so they show the adapter and the instrument together. The update adds the other half: the raw transfer rate of GPIBEE alone, measured against a low-latency GPIB device that answers the handshake as fast as the bus allows. That is how data sheet numbers are usually measured. Over USBTMC GPIBEE reaches up to 961 kB/s writing and 943 kB/s reading, and over Ethernet VXI-11 621 and 565 kB/s.

Getting it

Download it from the Firmware Updates page. The manual and release notes for this build have the details. If you already run V1.7, the Update firmware via web UI button on the Home page of the web interface does the rest.

← All news