Open-socket LAN control with Python (port 5025)
No drivers, no libraries — control your instrument with nothing but Python's built-in socket module and raw SCPI over TCP port 5025.
Most Siglent instruments expose a raw TCP socket on port 5025. You send SCPI text commands, terminated with a newline, and read text back. No VISA layer, no vendor drivers — ideal for lean production scripts, Linux servers and embedded controllers.
A minimal SCPI socket client
import socket
HOST = '192.168.1.121' # your instrument's IP
PORT = 5025 # Siglent raw-SCPI socket
def scpi(sock, cmd):
sock.sendall((cmd + '\n').encode())
if cmd.endswith('?'):
return sock.recv(4096).decode().strip()
return None
with socket.create_connection((HOST, PORT), timeout=3) as s:
print(scpi(s, '*IDN?'))
scpi(s, 'C1:BSWV FRQ,1000') # example: set CH1 frequency (SDG)
print(scpi(s, 'C1:BSWV?'))Siglent Technologies,SDG2042X,SDG2XCAD1R0001,2.01.01.35R3 C1:BSWV WVTP,SINE,FRQ,1000HZ,AMP,4V,OFST,0V,PHSE,0
Every query ends in ? and returns one line. Write commands return nothing — add *OPC? after slow operations to wait for completion.
Which models have the 5025 socket?
Most current instruments do, but it is not universal and the pattern is not the one people expect. Siglent publishes the definitive list; these are the groups as of this writing.
| Services | Models |
|---|---|
| Socket 5025 and Telnet 5024 | SDS5000X, SDS2000X Plus, SDS2000X-E, SDS1000X-E, SDS1104X-U, SDG6000X, SDG2000X, SDG1000X, SSA3000X, SSA3000X Plus, SSA3000X-R, SVA1000X, SDM3045X, SDM3055, SDM3065X, SSG3000X, SSG5000X, SNA5000A |
| Socket 5025 only — no Telnet | SPD3303X, SPD3303X-E, SPD1000X, SPS5000X, SDL1000X |
| Neither — use VXI-11 or USB | SDS2000X, SDS1000X, SDS1000CML+, SDS1000DL+, SDG800, SPD3303C, SHS800, SHS1000 |
Note the middle row. The SPD3303X and SPD3303X-E do support the raw socket on port 5025 — as do the SPD1000X, SPS5000X and SDL1000X. What they do not have is the Telnet service on 5024. If you have read anywhere (including, until recently, on this site) that these models lack an open socket, that was wrong.
Which services a given model offers is published by Siglent in Instrument Socket and Telnet Port Information. Check it before assuming — the pattern is not uniform across the range, and the power supplies in particular offer the socket but not Telnet.
For the models in the bottom row, use the VXI-11 method — same Python, different transport; see the related note.
Where to find the SCPI commands
Every instrument family has a programming guide PDF in its Downloads section on this site, listing all commands with examples. The pattern above works unchanged for oscilloscopes, generators, spectrum analyzers, power supplies and loads.
Instruments used in this note
Related application notes
Our engineers use these instruments daily — ask us anything.