Skip to content

scpi-pps: Add Siglent SPD3303 series PSU support #77

Open
tjko wants to merge 3 commits intosigrokproject:masterfrom
tjko:siglent-scpi-v3
Open

scpi-pps: Add Siglent SPD3303 series PSU support #77
tjko wants to merge 3 commits intosigrokproject:masterfrom
tjko:siglent-scpi-v3

Conversation

@tjko
Copy link
Contributor

@tjko tjko commented Jun 28, 2020

This adds support to Siglent SPD3303C / SPD3303X / SPD3303X-E programmable DC power supplies.
Functionality was tested both via LAN (tcp-raw) and USB (USBTMC) using sigrok-cli and SmuView.

Siglent SCPI implementation is "problematic" so I implemented "quirks" in SCPI framework to allow supporting
instruments (vendors) that can't seem to follow SCPI/IEEE488.2 specifications...
This way SCPI behavior doesn't need to change for devices that comply with SCPI, but framework still can be used
with devices that require "tweaks": 9cf9a57

(replaces #75)

tjko added 3 commits June 27, 2020 19:29
 - Add quirks field in sr_scpi_dev_inst that is a bitmap.
   That is used to enable various quirks a device may need.
 - Introduce following quirks (workarounds) needes with some
   Siglent instruments:
	SCPI_QUIRK_CMD_OMIT_LF
	SCPI_QUIRK_OPC_UNSUPPORTED
	SCPI_QUIRK_SLOW_CHANNEL_SELECT
        SCPI_QUIRK_DELAY_AFTER_CMD
 - Add support for SPD3303C / SPD3303X / SPD3303X-E PSUs.
 - This requires "quirks" support in scpi layer to function.
 - Add support for multi-channel PSUs where there is no
   SCPI_CMD_SELECT_CHANNEL command (or it cannot be used).
@tjko
Copy link
Contributor Author

tjko commented Jul 14, 2020

Wiki entry created: https://sigrok.org/wiki/Siglent_SPD3303_series

@gsigh gsigh self-assigned this Jul 28, 2020
@LeSpocky
Copy link

@LeSpocky
Copy link

I did a quick test on Debian GNU/Linux 10 (buster) with the SPD3303C. Output of --driver --show is this:

adahl@ada ~/sr % LD_LIBRARY_PATH=${HOME}/sr/lib ./bin/sigrok-cli --driver=scpi-pps --channel-group 1 --config "enabled=on" --show      
Driver functions:
    Power supply
Scan options:
    conn
    serialcomm
scpi-pps - Siglent Technologies SPD3303C 1.02.01.01.03R2 [S/N: SPD3EDCD3R1506] with 6 channels: V1 I1 P1 V2 I2 P2
Channel groups:
    1: channels V1 I1 P1
    2: channels V2 I2 P2
Supported configuration options on channel group 1:
    regulation: CV (current)
    voltage: 23.990000 (current)
    voltage_target: 0.000000, 32.000000, 0.010000
    current: 0.050000 (current)
    current_limit: 0.000000, 3.200000, 0.010000
    enabled: on (current), off

This worked fine:

adahl@ada ~/sr % LD_LIBRARY_PATH=${HOME}/sr/lib ./bin/sigrok-cli --driver=scpi-pps --channel-group 1 --config "enabled=on" --set 

Most things I tried, ended up in the instrument beeping and the console showing an error message repeatedly. See below:

adahl@ada ~/sr % LD_LIBRARY_PATH=${HOME}/sr/lib ./bin/sigrok-cli --scan
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
^C

beep, beep, beep, …


adahl@ada ~/sr % LD_LIBRARY_PATH=${HOME}/sr/lib ./bin/sigrok-cli --driver=scpi-pps --time 3s
V1: 0 mV DC
I1: 0 mA DC
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
^C

beep, beep, beep, …


adahl@ada ~/sr % LD_LIBRARY_PATH=${HOME}/sr/lib ./bin/sigrok-cli --driver=scpi-pps --channel-group 1 --config "enabled=on" --continuous
V1: 23.990 V DC
I1: 50 mA DC
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.

beep, beep, beep, …

@tjko
Copy link
Contributor Author

tjko commented Aug 25, 2020

Looks like this model has same (or similar) buggy firmware with broken USBTMC implementation (as SPD3033X-E).
If you just do "--scan" and not use "-d scpi-pps" it seems unit can stop responding properly. Does it recover if unplug and use only commands with "-d scpi-pps"?

With SPD3033X-E unit worked much more reliably via LAN, but I guess this model does not have LAN port?

@LeSpocky
Copy link

Looks like this model has same (or similar) buggy firmware with broken USBTMC implementation (as SPD3033X-E).

Don't know, did not look into it or even try firmware update. I would try to avoid such an upgrade, my boss would not be happy if anything goes wrong with that.

If you just do "--scan" and not use "-d scpi-pps" it seems unit can stop responding properly. Does it recover if unplug and use only commands with "-d scpi-pps"?

No, it does not recover.

With SPD3033X-E unit worked much more reliably via LAN, but I guess this model does not have LAN port?

Correct. The SPD3303C has no LAN port.

@tjko
Copy link
Contributor Author

tjko commented Sep 30, 2020

Merge conflicts fixed in new branch: https://github.com/tjko/libsigrok/tree/siglent-scpi-v4

@tjko
Copy link
Contributor Author

tjko commented Oct 8, 2020

Updated branch with some cleanup:
https://github.com/tjko/libsigrok/tree/siglent-scpi-v5

Also removed SPD3303C / SPD3303D support, as these units don't seem to work with current scpi_usbtmc support in Sigrok:

sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.
sr: scpi_usbtmc: USBTMC bulk in transfer error: LIBUSB_ERROR_TIMEOUT.

@biot
Copy link
Contributor

biot commented Sep 14, 2024

Sorry this never got reviewed, @tjko. Your siglent-scpi-v5 branch looks good, only some minor style fixes. Could I ask you to rebase it on master, and push it here? I'd like to see this get merged.

tridentsx added a commit to OpenTraceLab/OpenTraceCapture that referenced this pull request Oct 25, 2025
This is a complete port of libsigrok PR #77 which adds support for
device-specific SCPI quirks and the Siglent SPD3303 series power supplies.

Changes include:

1. SCPI Quirks Framework
   - Added enum scpi_quirks with 4 quirk flags for non-compliant devices
   - Added quirks field to otc_scpi_dev_inst structure
   - Implemented quirk handling in SCPI command functions
   - Added Siglent SPD3303 to USB device blacklist

2. udev Rules
   - Added Siglent USBTMC device entries (SPD3303X-E PSU and scopes)
   - Consolidated device list with proper comments

3. Siglent SPD3303 Driver
   - Added SCPI_DIALECT_SIGLENT dialect
   - Added SCPI_CMD_GET/SET_CHANNEL_CONFIG commands
   - Implemented device profiles for SPD3303C/X/X-E models
   - Added status update function for multi-channel monitoring
   - Implemented channel configuration (Independent/Series/Parallel)
   - Added special handling for Siglent's hex status register format

All identifiers renamed from SR_/sr_ to OTC_/otc_ conventions.

Upstream source: sigrokproject/libsigrok#77
Original author: Timo Kokkonen <tjko@iki.fi>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants