agilent E5810 – LAN GPIB / GATEWAY

MANUAL

The E5810 “Backdoor”: How to Instantly Discover GPIB Devices

If you have ever tried to automate a lab full of older equipment using an Agilent (Keysight) E5810 LAN/GPIB Gateway, you know the pain of discovery.

The standard VXI-11 protocol doesn’t have a fast “who is connected?” command. To find instruments, you typically have to loop through every possible GPIB address (0–30), attempting to open a connection. If an address is empty, you have to wait for a timeout. With 30 addresses and a 2-second timeout, a full bus scan can take over a minute per gateway.

However, there is a faster way. The E5810 has a built-in web server with a “Find Devices” button. By mimicking the browser’s request to this hidden internal endpoint, we can force the gateway to scan the bus locally (which it does very quickly) and return the results to us in seconds.

The “Secret” Endpoint

When you click “Find” on the gateway’s webpage, your browser doesn’t scan the network; the gateway does. It sends a request to this specific URL:

http://<GATEWAY_IP>/html/instrumentspage.html?whichbutton=find&timeout=5

The gateway receives this, pings all GPIB addresses on its local backplane, and returns an HTML page where the active devices are populated inside a dropdown menu (<option> tags).

The Python Solution

Instead of brute-forcing VISA connections, we can use Python’s standard urllib library to hit this URL and parse the HTML response using Regular Expressions (Regex).

Here is a standalone script that demonstrates the technique:

 

Python

import urllib.request
import re

def ask_gateway_for_devices(ip_address):
    # 1. Construct the "Backdoor" URL
    # We pass 'whichbutton=find' to trigger the scan
    # We pass 'timeout=5' to give the gateway time to check the bus
    base_url = f"http://{ip_address}/html/instrumentspage.html"
    query = "whichbutton=find&timeout=5"
    full_url = f"{base_url}?{query}"

    print(f"Querying Gateway at {ip_address}...")

    try:
        # 2. Send the HTTP GET request
        with urllib.request.urlopen(full_url, timeout=10) as response:
            html_content = response.read().decode('utf-8', errors='ignore')

            # 3. Parse the HTML using Regex
            # The gateway returns found devices in standard HTML option tags:
            # Example: <option value="gpib0,1">gpib0,1</option>
            # We look for the text inside the option tags.
            
            devices = re.findall(r'<option[^>]*>([\w,]+)', html_content)
            
            # Filter out generic 'COM' ports or empty results if necessary
            valid_devices = [d for d in devices if "gpib" in d.lower()]

            return valid_devices

    except Exception as e:
        print(f"Error contacting gateway: {e}")
        return []

# --- usage ---
gateway_ip = "44.44.44.111"  # Replace with your E5810 IP
inventory = ask_gateway_for_devices(gateway_ip)

if inventory:
    print(f"Success! Found {len(inventory)} devices:")
    for device in inventory:
        print(f" - {device}")
else:
    print("No devices found or gateway unreachable.")

 

Why This Works

  1. Speed: The E5810 checks the hardware lines on the GPIB bus directly. It doesn’t need to negotiate full TCP/IP sessions for every address like your PC does.

  2. Reliability: You avoid the “Phantom Device” issues that sometimes occur when VXI-11 timeouts are set too short in your main application.

  3. Simplicity: You get a clean list of interface strings (e.g., gpib0,15) that you can plug directly into your VISA resource string format: TCPIP::<IP>::<INTERFACE>::INSTR.

By using this web scraping method, you can reduce your fleet inventory time from several minutes down to just a few seconds.