Siglent SPD1168X Visa Commands - Page 1
Forum section: electronics / testgear

author: metr
author_rank: Newbie
timestamp: May 21, 2021, 04:04:13 am
content: Just got a Siglent SPD1168X partly based off several of the threads here. Mostly good experience so far! Seems solid and no weird voltage spikes or anything.I've been trying to use it with pyvisa/pyvisa-py over USB and I've been having some issues with some of the commands listed in theuser manual. I'm able to "*IDN?" and set/get the voltage and current setpoints, but enabling/disabling the output with "OUTPut CH1,ON" (and any variant of that I could think of) yields an error. I reached out to Siglent but haven't heard back. Has anyone gotten this working over USB? All of the examples I've seen use ethernet so I'm wondering if this is a USB-only issue?

author: tautech
author_rank: Super Contributor
timestamp: May 21, 2021, 04:30:34 am
content: Welcome to the forum.Have you checked out the Operating Tips and App Notes here:https://siglentna.com/power-supplies/spd1000x-series-programmable-dc-power-supply/#resourcesBTW we have a thread for these PSU's here:https://www.eevblog.com/forum/testgear/new-spd1168x-siglent-psu/

author: metr
author_rank: Newbie
timestamp: May 21, 2021, 05:18:04 am
content: Thanks for the welcome!Yeah I looked through those, I'm able to run the basic commands and get responses from the instrument, but the output control and measurement commands return instrument errors for me. I don't see any examples using anything but "*IDN?" over USB, so I hope that's not a limitation on this interface.

author: tautech
author_rank: Super Contributor
timestamp: May 21, 2021, 08:10:17 am
content: Maybe this hiding in the SPD3303X webpage might help:https://siglentna.com/operating-tip/spd-programming-tips/

author: metr
author_rank: Newbie
timestamp: May 21, 2021, 03:24:24 pm
content: Yeah that programming guide is really handy! It's nice to know that they require time between commands.I ended up figuring it out, it was an issue with pyvisa unexpectedly appending an extra termination character, so the commands were ending with '\n\n'. Odd that the power supply only had an issue with that on some commands but an easy fix.Thanks for the help!

author: TheDefpom
author_rank: Frequent Contributor
timestamp: January 03, 2022, 12:34:09 am
content: I have a similar issue at the moment, I am trying to write a definition file for TestController but I cannot get the on/off and 2w/4w commands to work, see attached photos that show the commands being sent to the unit (from test controller on Mac) which shows there being just a single termination char.I then sniffed the EasyPower software on PC to see what command it is sending as that works fine, its the exact same command, but has a difference preamble, probably cause it is using port 9009 so it seems to be using a different backend for communications due to it being able to do firmware updates etc.

author: peter_mcc
author_rank: Contributor
timestamp: April 25, 2023, 05:57:26 am
content: I know this is an old topic but it was the most helpful one I found when searching around.I've been playing with a C# program sending raw packets to my SPD1168X - I found that some commands worked and some didn't (the power supply just beeped). I also found it locked up sometimes.The solution to commands working was to add or delete "\n" at the end of the line. Some commands (eg Output) only work without it. Some don't seem to care (eg CH1:VOLT will work with or without \n).The SDM3055 meter is different - it needs the "\n" for commands to work (at least the ones I've tried). My suggestion if you're trying to talk with a Siglent device and it isn't working is to add or delete "\n" terminators and see if that works.The solution to it locking up seems to be to add a small delay between sending commands.Talking to the SDM3055 meters I also have I found that if you open/close the connection too often it causes the meter to lock up as well. Now I open the connection and keep reusing it.In case it helps someone else my evil C# code is below. I don't really care that it isn't best practice - it's for a test system so as long as it works I'm happy with it.Code:TcpClient clientPowerDc;NetworkStream streamPowerDc;const string IpAddressPowerSupplyDc1 = "192.168.130.41";const int DevicePort = 5025;const int SleepTimePowerDc = 200;private void PowerDc1_Setup(){try{// Set up DC Power supply network connectionclientPowerDc = new TcpClient(IpAddressPowerSupplyDc1, DevicePort);streamPowerDc = clientPowerDc.GetStream();clientPowerDc.ReceiveTimeout = 2000;Thread.Sleep(SleepTimePowerDc);string message;Byte[] dataSend;// Set up DC Power Supplymessage = "CH1:VOLT 10";dataSend = System.Text.Encoding.ASCII.GetBytes(message);streamPowerDc.Write(dataSend, 0, dataSend.Length);Console.WriteLine("DC Power supply - set Voltage to 0V- Sent: {0}", message);Thread.Sleep(SleepTimePowerDc);message = "CH1:CURRENT 0.025";dataSend = System.Text.Encoding.ASCII.GetBytes(message);streamPowerDc.Write(dataSend, 0, dataSend.Length);Console.WriteLine("DC Power supply - set Current to max 25mA - Sent: {0}", message);Thread.Sleep(SleepTimePowerDc);message = "OUTPUT CH1,ON";dataSend = System.Text.Encoding.ASCII.GetBytes(message);streamPowerDc.Write(dataSend, 0, dataSend.Length);Console.WriteLine("DC Power supply - turn on output - Sent: {0}", message);Thread.Sleep(SleepTimePowerDc);message = "*IDN?";//message = "SYSTem: ERRor?\n";dataSend = System.Text.Encoding.ASCII.GetBytes(message);streamPowerDc.Write(dataSend, 0, dataSend.Length);Console.WriteLine("DC Power supply - Identify - Sent: {0}", message);// Response stuffByte[] dataErr = new Byte;String responseDataErr = String.Empty;// Read the first batch of the TcpServer response bytes.Int32 bytesErr = streamPowerDc.Read(dataErr, 0, dataErr.Length);responseDataErr = System.Text.Encoding.ASCII.GetString(dataErr, 0, bytesErr);Console.WriteLine("Secondary - Received: {0}", responseDataErr);}catch (Exception eeee){Console.WriteLine("PowerDc1_Setup() - something went wrong: {0}", eeee.Message);}}