http://<server-ip>:8000
Health check endpoint.
Response:
{
"name": "LabLink Server",
"version": "0.1.0",
"status": "running"
}Detailed health status with connected device count.
Response:
{
"status": "healthy",
"connected_devices": 2
}Discover available VISA devices on the system.
Response:
{
"resources": [
"USB0::0x1AB1::0x04CE::DS2A123456789::INSTR",
"ASRL/dev/ttyUSB0::INSTR"
]
}Connect to a device.
Request Body:
{
"resource_string": "USB0::0x1AB1::0x04CE::DS2A123456789::INSTR",
"equipment_type": "oscilloscope",
"model": "MSO2072A"
}Response:
{
"equipment_id": "scope_abc12345",
"status": "connected"
}Disconnect a device.
Response:
{
"equipment_id": "scope_abc12345",
"status": "disconnected"
}List all connected devices.
Response:
[
{
"id": "scope_abc12345",
"type": "oscilloscope",
"manufacturer": "Rigol",
"model": "MSO2072A",
"serial_number": "DS2A123456789",
"connection_type": "usb",
"resource_string": "USB0::0x1AB1::0x04CE::DS2A123456789::INSTR",
"nickname": null
}
]Get status of a specific device.
Response:
{
"id": "scope_abc12345",
"connected": true,
"error": null,
"firmware_version": "00.01.02.00.00",
"capabilities": {
"num_channels": 2,
"bandwidth": "70MHz",
"sample_rate": "2GSa/s"
}
}Execute a command on a device.
Request Body:
{
"command_id": "cmd_001",
"equipment_id": "scope_abc12345",
"action": "get_measurements",
"parameters": {
"channel": 1
},
"timestamp": "2025-01-01T12:00:00"
}Response:
{
"command_id": "cmd_001",
"success": true,
"data": {
"vpp": 3.2,
"vmax": 1.6,
"vmin": -1.6,
"freq": 1000.0
},
"error": null,
"timestamp": "2025-01-01T12:00:00.123"
}Configure data streaming for a device.
Request Body:
{
"equipment_id": "scope_abc12345",
"stream_type": "measurements",
"interval_ms": 100,
"enabled": true,
"buffer_size": 1000
}Get a single snapshot of data.
Query Parameters:
data_type: Type of data to retrieve (readings, waveform, measurements)
Response: Varies by equipment type and data_type.
Get waveform data from a channel.
Parameters:
channel(int): Channel number (1-2)
Returns: WaveformData object
Get automated measurements.
Parameters:
channel(int): Channel number (1-2)
Returns:
{
"vpp": 3.2,
"vmax": 1.6,
"vmin": -1.6,
"vavg": 0.0,
"vrms": 1.13,
"freq": 1000.0,
"period": 0.001
}Set timebase settings.
Parameters:
scale(float): Time per division (seconds)offset(float): Time offset (seconds)
Configure channel settings.
Parameters:
channel(int): Channel numberenabled(bool): Enable/disable channelscale(float): Volts per divisionoffset(float): Voltage offsetcoupling(str): Coupling mode (DC, AC, GND)
Set trigger to single mode.
Start continuous triggering.
Stop triggering.
Run autoscale.
Set output voltage.
Parameters:
voltage(float): Voltage in voltschannel(int): Channel number (default: 1)
Set current limit.
Parameters:
current(float): Current in ampschannel(int): Channel number (default: 1)
Enable or disable output.
Parameters:
enabled(bool): Enable/disable outputchannel(int): Channel number (default: 1)
Get current readings.
Parameters:
channel(int): Channel number (default: 1)
Returns:
{
"equipment_id": "ps_xyz789",
"channel": 1,
"voltage_set": 12.0,
"current_set": 1.0,
"voltage_actual": 12.01,
"current_actual": 0.523,
"output_enabled": true,
"in_cv_mode": true,
"in_cc_mode": false,
"timestamp": "2025-01-01T12:00:00"
}Set operating mode.
Parameters:
mode(str): Mode (CC, CV, CR, CP)
Set current in CC mode.
Parameters:
current(float): Current in amps
Set voltage in CV mode.
Parameters:
voltage(float): Voltage in volts
Set resistance in CR mode.
Parameters:
resistance(float): Resistance in ohms
Set power in CP mode.
Parameters:
power(float): Power in watts
Enable or disable load.
Parameters:
enabled(bool): Enable/disable load
Get current readings.
Returns:
{
"equipment_id": "load_def456",
"mode": "CC",
"setpoint": 2.0,
"voltage": 12.1,
"current": 2.0,
"power": 24.2,
"load_enabled": true,
"timestamp": "2025-01-01T12:00:00"
}ws://<server-ip>:8000/ws
Send:
{
"type": "start_stream",
"equipment_id": "scope_abc12345",
"stream_type": "measurements",
"interval_ms": 100
}Receive (confirmation):
{
"type": "stream_started",
"equipment_id": "scope_abc12345",
"stream_type": "measurements"
}Receive (data):
{
"type": "stream_data",
"equipment_id": "scope_abc12345",
"stream_type": "measurements",
"data": {
"vpp": 3.2,
"freq": 1000.0,
...
}
}Send:
{
"type": "stop_stream",
"equipment_id": "scope_abc12345",
"stream_type": "measurements"
}Receive:
{
"type": "stream_stopped",
"equipment_id": "scope_abc12345",
"stream_type": "measurements"
}Send:
{
"type": "ping"
}Receive:
{
"type": "pong"
}All error responses follow this format:
{
"detail": "Error message describing what went wrong"
}Common HTTP status codes:
200: Success400: Bad request (invalid parameters)404: Resource not found500: Internal server error
oscilloscopepower_supplyelectronic_loadmultimeterfunction_generator
usbserialethernetgpib
readings: General readings from the devicewaveform: Oscilloscope waveform datameasurements: Automated measurements