Connection Setup¶
This guide provides detailed instructions for connecting to your Siglent oscilloscope over the network, including network configuration, troubleshooting, and advanced connection options.
Overview¶
The Siglent Oscilloscope Control library communicates with oscilloscopes using the SCPI (Standard Commands for Programmable Instruments) protocol over TCP/IP. This allows:
- Remote Control: Send commands from your computer
- Data Retrieval: Download waveforms and screenshots
- Automation: Script complex measurement sequences
- GUI Control: Use the PyQt6 GUI interface
- Multi-Scope Access: Control multiple oscilloscopes
Connection Methods¶
LAN (Ethernet) - Recommended
- Fast and reliable
- Best performance for live view
- No special drivers needed
- Works across platforms
USB - Not directly supported
- Requires USBTMC drivers
- Platform-specific limitations
- Use LAN for best results
GPIB - Not supported
- Legacy interface
- Requires GPIB adapter
- Use LAN instead
Prerequisites¶
Hardware Requirements¶
Oscilloscope:
- Siglent SDS1000X-E, SDS2000X-E, or SDS5000X series
- Ethernet port
- Network connectivity enabled
Computer:
- Network interface (Ethernet or WiFi)
- Python 3.8 or later installed
- Siglent library installed:
pip install SCPI-Instrument-Control
Network:
- Ethernet cable (for direct connection)
- Network switch/router (for network connection)
- Same subnet for oscilloscope and computer
Software Requirements¶
Python Packages:
Optional for GUI:
Network Tools (for troubleshooting):
ping- Test connectivitynmap- Scan for devicestelnetornc- Test port access
Finding Your Oscilloscope¶
From the Oscilloscope¶
Method 1: Utility Menu
- Press Utility button on oscilloscope
- Navigate to IO Setting → LAN Config
- Note the IP address shown
Method 2: System Info
- Press Utility button
- Select System → System Info
- IP address displayed in network section
Typical Display:
Network Scanning¶
Using nmap (Linux/Mac):
# Scan your local network
nmap -p 5024 192.168.1.0/24
# Example output:
# Nmap scan report for 192.168.1.100
# PORT STATE SERVICE
# 5024/tcp open scpi-raw
Using Siglent Discovery Tool:
from scpi_control.discovery import find_oscilloscopes
# Scan network for Siglent devices
scopes = find_oscilloscopes()
for scope in scopes:
print(f"Found: {scope.model} at {scope.ip_address}")
Manual Check:
Network Configuration¶
Direct Connection (PC to Scope)¶
Easiest for single oscilloscope:
- Connect Ethernet Cable
- Connect PC network port to oscilloscope
-
Use standard Ethernet cable (Cat5e or better)
-
Configure Oscilloscope
- Utility → IO Setting → LAN Config
- Set IP:
192.168.1.100 - Subnet:
255.255.255.0 - Gateway:
192.168.1.1 -
Apply settings
-
Configure PC
Windows:
- Control Panel → Network and Sharing Center
- Change adapter settings
- Right-click Ethernet → Properties
- Internet Protocol Version 4 (TCP/IPv4)
- Set IP: 192.168.1.10
- Subnet: 255.255.255.0
Linux:
macOS:
- System Preferences → Network
- Select Ethernet
- Configure IPv4: Manually
- IP: 192.168.1.10
- Subnet: 255.255.255.0
- Test Connection
Network Connection (via Router/Switch)¶
Best for multiple devices:
- Connect to Network
- Connect oscilloscope to network switch/router
-
Connect PC to same network
-
Configure Oscilloscope
Option A: DHCP (Automatic) - Utility → IO Setting → LAN Config - Enable DHCP - Note assigned IP address - Recommended for most users
Option B: Static IP
- Disable DHCP
- Set IP: 192.168.1.100 (or available address)
- Subnet: 255.255.255.0 (match your network)
- Gateway: 192.168.1.1 (your router IP)
- DNS: 192.168.1.1 or 8.8.8.8
- Verify Connection
Firewall Configuration¶
Windows Firewall:
# Allow Python through firewall
netsh advfirewall firewall add rule name="Python SCPI" dir=in action=allow program="C:\Python39\python.exe" enable=yes
# Or allow port 5024
netsh advfirewall firewall add rule name="SCPI Port" dir=in action=allow protocol=TCP localport=5024
Linux (ufw):
macOS:
- System Preferences → Security & Privacy → Firewall
- Firewall Options
- Add Python application
- Allow incoming connections
Making Your First Connection¶
Using Python API¶
Basic Connection:
from scpi_control import Oscilloscope
# Connect to oscilloscope
scope = Oscilloscope('192.168.1.100')
# Get identification
print(scope.idn)
# Output: SIGLENT TECHNOLOGIES,SDS2104X Plus,...
# Close connection
scope.close()
Using Context Manager (Recommended):
from scpi_control import Oscilloscope
with Oscilloscope('192.168.1.100') as scope:
print(f"Connected to {scope.model}")
print(f"Serial: {scope.serial_number}")
# Connection automatically closed
With Custom Timeout:
Custom Port:
Using GUI Application¶
Launch GUI:
Connection Steps:
- Click Connect button or press
Ctrl+O - Enter oscilloscope IP address
- (Optional) Set timeout and port
- Click Connect
- Connection status shown in status bar
Save Connection Profile:
- After entering IP address
- Enter a name (e.g., "Lab Scope")
- Click Save Profile
- Quick access from File → Recent Connections
Testing Your Connection¶
Verify Connectivity¶
Ping Test:
Port Test:
# Using telnet
telnet 192.168.1.100 5024
# Using netcat
nc -zv 192.168.1.100 5024
# Should show "succeeded" or "open"
Python Test:
from scpi_control import Oscilloscope
try:
with Oscilloscope('192.168.1.100', timeout=5) as scope:
print(f"✓ Connected to {scope.model}")
print(f"✓ Firmware: {scope.firmware_version}")
print(f"✓ Serial: {scope.serial_number}")
print("Connection successful!")
except TimeoutError:
print("✗ Connection timeout - check IP and network")
except ConnectionRefusedError:
print("✗ Connection refused - check oscilloscope LAN enabled")
except Exception as e:
print(f"✗ Error: {e}")
Performance Test¶
Measure Latency:
from scpi_control import Oscilloscope
import time
with Oscilloscope('192.168.1.100') as scope:
start = time.time()
for i in range(10):
_ = scope.idn
elapsed = time.time() - start
latency = elapsed / 10 * 1000 # ms per command
print(f"Average latency: {latency:.1f} ms")
Expected Latency:
- Direct/LAN: 5-20 ms
- WiFi: 10-50 ms
- Remote/VPN: 50-200 ms
Transfer Speed:
from scpi_control import Oscilloscope
import time
with Oscilloscope('192.168.1.100') as scope:
scope.channel1.enabled = True
start = time.time()
waveform = scope.get_waveform(1)
elapsed = time.time() - start
samples = len(waveform.data)
speed = samples / elapsed / 1000 # kSa/s
print(f"Transfer speed: {speed:.1f} kSa/s")
Expected Speed:
- Gigabit LAN: 500-2000 kSa/s
- 100 Mbps LAN: 100-500 kSa/s
- WiFi: 50-300 kSa/s
Advanced Connection Options¶
Connection Profiles¶
Save Multiple Scopes:
from scpi_control import ConnectionManager
# Create connection manager
manager = ConnectionManager()
# Add profiles
manager.add_profile('lab_scope', '192.168.1.100')
manager.add_profile('bench_scope', '192.168.1.101', port=5025)
# Connect to a profile
scope = manager.connect('lab_scope')
# List profiles
for name, config in manager.profiles.items():
print(f"{name}: {config['ip']}")
Configuration File (~/.siglent/connections.json):
{
"lab_scope": {
"ip": "192.168.1.100",
"port": 5024,
"timeout": 5.0
},
"bench_scope": {
"ip": "192.168.1.101",
"port": 5024,
"timeout": 5.0
}
}
Multiple Oscilloscopes¶
Connect to Multiple Scopes:
from scpi_control import Oscilloscope
# Connect to two oscilloscopes
scope1 = Oscilloscope('192.168.1.100')
scope2 = Oscilloscope('192.168.1.101')
print(f"Scope 1: {scope1.model}")
print(f"Scope 2: {scope2.model}")
# Use both
waveform1 = scope1.get_waveform(1)
waveform2 = scope2.get_waveform(1)
# Close connections
scope1.close()
scope2.close()
Using Context Managers:
from scpi_control import Oscilloscope
with Oscilloscope('192.168.1.100') as scope1, \
Oscilloscope('192.168.1.101') as scope2:
# Synchronized capture
scope1.trigger.single()
scope2.trigger.single()
# Get waveforms
data1 = scope1.get_waveform(1)
data2 = scope2.get_waveform(1)
Hostname/DNS¶
Use Hostname Instead of IP:
# If DNS/mDNS is configured
scope = Oscilloscope('scope.local')
scope = Oscilloscope('lab-scope.example.com')
Configure mDNS on Oscilloscope:
- Utility → IO Setting → LAN Config
- Set hostname:
lab-scope - Enable mDNS (if available)
- Connect using:
lab-scope.local
Add to /etc/hosts (Linux/Mac):
Windows hosts file:
VNC Access¶
Enable VNC Server on Oscilloscope:
- Utility → IO Setting → VNC Config
- Enable VNC Server
- Set password (optional but recommended)
- Note VNC port (default: 5900)
Using GUI VNC Viewer:
Standalone VNC Client:
Python VNC Access:
from scpi_control import Oscilloscope
with Oscilloscope('192.168.1.100') as scope:
# Capture oscilloscope screen via VNC
screenshot = scope.vnc.capture_screen()
screenshot.save('scope_screen.png')
Security Considerations¶
Network Security¶
!!! warning "Security Best Practices" - Use isolated network for lab equipment - Don't expose oscilloscope to internet - Use VPN for remote access - Change default passwords - Disable unused services
Isolated Network:
- Dedicated VLAN for test equipment
- Separate from corporate network
- Firewall rules to control access
VPN Access:
Better than direct internet exposure
Authentication¶
SCPI Protocol:
- No built-in authentication
- Anyone on network can connect
- Use network security for protection
VNC Server:
- Set strong password
- Change from default
- Use encrypted VNC if possible
Best Practices:
- Physical network security
- Firewall rules
- Access control lists
- Regular firmware updates
Troubleshooting¶
Cannot Find Oscilloscope¶
Problem: Can't locate oscilloscope on network
Solutions:
- Verify Physical Connection
- Ethernet cable plugged in both ends
- Link lights on both ports
-
Try different cable
-
Check Oscilloscope LAN Settings
- Utility → IO Setting → LAN Config
- LAN enabled
- Valid IP address
-
Correct subnet mask
-
Check Same Subnet
- Try DHCP
- Enable DHCP on oscilloscope
- Check router's DHCP client list
-
Note assigned IP
-
Scan Network
Connection Timeout¶
Problem: "Connection timeout" error
Solutions:
- Verify Connectivity
If ping fails, network issue
- Check Port 5024
Should connect immediately
- Check Firewall
- Temporarily disable firewall to test
- Add exception for Python/port 5024
-
Re-enable firewall
-
Increase Timeout
- Check Oscilloscope
- Reboot oscilloscope
- Verify SCPI service running
- Check for firmware issues
Connection Refused¶
Problem: "Connection refused" error
Solutions:
- Check SCPI Server
- Oscilloscope may not have SCPI server running
- Reboot oscilloscope
-
Check IO settings
-
Verify Port Number
# Try default ports
scope = Oscilloscope('192.168.1.100', port=5024) # SCPI
scope = Oscilloscope('192.168.1.100', port=5025) # Alternative
- Check for Other Connections
- Only one active connection allowed (some models)
- Close other SCPI applications
- Disconnect web interface
Slow Performance¶
Problem: Commands are slow or timeouts occur
Solutions:
- Check Network Speed
- Use Wired Connection
- WiFi has higher latency
-
Use Ethernet for best performance
-
Reduce Waveform Size
- Check Network Load
- Other traffic on network
- Large file transfers
-
Video streaming
-
Optimize Code
# Bad: Many small commands
for i in range(100):
scope.write(f"C1:VDIV {i/100}")
# Good: Batch operations
scope.channel1.voltage_scale = 1.0
Intermittent Disconnections¶
Problem: Connection drops randomly
Solutions:
- Check Cable
- Replace Ethernet cable
- Check for damage
-
Ensure secure connections
-
Check Network Switch
- Switch may be dropping link
- Try different port
-
Update switch firmware
-
Power Management
- Disable network adapter power saving
-
Windows: Device Manager → Network Adapter → Power Management → Uncheck "Allow computer to turn off"
-
Update Firmware
- Check for oscilloscope firmware updates
-
Update to latest stable version
-
Increase Keepalive
Wrong Oscilloscope Model¶
Problem: Connected to wrong scope
Solutions:
- Verify IP Address
with Oscilloscope('192.168.1.100') as scope:
print(f"Connected to: {scope.model}")
print(f"Serial: {scope.serial_number}")
- Use Connection Profiles
- Name profiles clearly
- Include location/purpose
-
"Lab Bench 1", "Production Test", etc.
-
Check Physical Labels
- Label oscilloscopes with IP addresses
- Update labels when IP changes
Remote Access¶
SSH Tunnel¶
Access oscilloscope remotely via SSH:
# On remote machine with SSH access
ssh -L 5024:192.168.1.100:5024 user@lab-server.com
# On your local machine
python3
>>> from scpi_control import Oscilloscope
>>> scope = Oscilloscope('localhost') # Connects through tunnel
VPN Connection¶
Setup:
- Configure VPN to lab network
- Connect to VPN
- Access oscilloscope using lab IP
- Works like local connection
Example:
# After VPN connected
from scpi_control import Oscilloscope
# Use oscilloscope's IP on lab network
scope = Oscilloscope('10.0.50.100')
Port Forwarding (Not Recommended)¶
Security Risk
Exposing oscilloscope directly to internet is a security risk. Use VPN instead.
If you must:
Router: Forward external:5024 → 192.168.1.100:5024
Access: scope = Oscilloscope('your-public-ip', timeout=30)
Best Practices¶
Connection Management¶
Use Context Managers
Always use with statements to ensure connections are closed properly:
python
with Oscilloscope('192.168.1.100') as scope:
# Your code here
pass
# Connection automatically closed
Error Handling¶
Handle Connection Errors
from scpi_control import Oscilloscope
import time
def connect_with_retry(ip, max_retries=3):
for attempt in range(max_retries):
try:
scope = Oscilloscope(ip, timeout=5)
print(f"Connected to {scope.model}")
return scope
except (TimeoutError, ConnectionError) as e:
print(f"Attempt {attempt+1} failed: {e}")
if attempt < max_retries - 1:
time.sleep(2)
else:
raise
scope = connect_with_retry('192.168.1.100')
```
### Network Configuration
!!! tip "Static IP for Lab Equipment" - Use static IP addresses for oscilloscopes - Document IP addresses - Keep list of equipment and IPs - Use consistent IP scheme (e.g., .100-.199 for scopes)
### Performance Optimization
!!! tip "Optimize for Your Use Case" - **Live View**: Use Gigabit Ethernet, minimize latency - **Batch Capture**: Wired connection, optimize data transfer - **Automation**: Increase timeout for long operations - **Remote**: Use VPN, increase timeout, reduce data size
## Example Configurations
### Home Lab Setup
**Equipment:**
- 1 oscilloscope
- 1 PC
- Direct Ethernet connection
**Configuration:**
PC: IP: 192.168.1.10 Subnet: 255.255.255.0
Connection: Direct Ethernet cable No router needed
### University Lab
**Equipment:**
- Multiple oscilloscopes
- Multiple PCs
- Network switch
**Configuration:**
Scopes (Static IPs): Bench 1: 192.168.50.101 Bench 2: 192.168.50.102 Bench 3: 192.168.50.103
PCs (DHCP): Auto-assigned: 192.168.50.10-50.99
### Industrial Test Station
**Equipment:**
- Production oscilloscope
- Test PC
- Isolated network
**Configuration:**
Oscilloscope: IP: 10.50.0.100 Subnet: 255.255.255.0 Gateway: 10.50.0.1
Test PC: IP: 10.50.0.10 Subnet: 255.255.255.0
Firewall: Allow: 10.50.0.0/24 → 10.50.0.100:5024 Block: All other traffic
## Quick Reference
### Common IP Addresses
| Device | Typical IP | Port |
| ------------------- | ------------- | ---- |
| Oscilloscope (SCPI) | 192.168.1.100 | 5024 |
| Oscilloscope (VNC) | 192.168.1.100 | 5900 |
| Oscilloscope (Web) | 192.168.1.100 | 80 |
### Default Settings
| Parameter | Default Value |
| ----------- | ------------- |
| Port | 5024 (SCPI) |
| Timeout | 5.0 seconds |
| Subnet Mask | 255.255.255.0 |
| VNC Port | 5900 |
### Network Commands
```bash
# Ping test
ping 192.168.1.100
# Port scan
nmap -p 5024 192.168.1.100
# Port test
nc -zv 192.168.1.100 5024
# Trace route
traceroute 192.168.1.100
Python Connection Examples¶
# Basic connection
from scpi_control import Oscilloscope
scope = Oscilloscope('192.168.1.100')
# With timeout
scope = Oscilloscope('192.168.1.100', timeout=10)
# Custom port
scope = Oscilloscope('192.168.1.100', port=5025)
# Context manager (recommended)
with Oscilloscope('192.168.1.100') as scope:
print(scope.idn)
Next Steps¶
Now that you have a working connection:
- Quick Start Guide - Basic usage examples
- User Guide: Basic Usage - Learn core functionality
- GUI Overview - Use the graphical interface
- API Reference - Complete API documentation
Additional Resources¶
Siglent Resources:
- Siglent Official Website
- Oscilloscope User Manual
- Programming Manual (SCPI commands)
Network Tools:
Support:
- GitHub Issues: Report problems
- Documentation: This guide
- Community Forums: Ask questions