Author Topic: Siglent SPD1168X Visa Commands  (Read 1829 times)

0 Members and 1 Guest are viewing this topic.

Offline metrTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Siglent SPD1168X Visa Commands
« on: May 21, 2021, 04:04:13 am »
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 the user 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?
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 29809
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SPD1168X Visa Commands
« Reply #1 on: May 21, 2021, 04:30:34 am »
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/#resources


BTW we have a thread for these PSU's here:
https://www.eevblog.com/forum/testgear/new-spd1168x-siglent-psu/
« Last Edit: May 21, 2021, 04:41:24 am by tautech »
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline metrTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: Siglent SPD1168X Visa Commands
« Reply #2 on: May 21, 2021, 05:18:04 am »
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.
 

Online tautech

  • Super Contributor
  • ***
  • Posts: 29809
  • Country: nz
  • Taupaki Technologies Ltd. Siglent Distributor NZ.
    • Taupaki Technologies Ltd.
Re: Siglent SPD1168X Visa Commands
« Reply #3 on: May 21, 2021, 08:10:17 am »
Maybe this hiding in the SPD3303X webpage might help:
https://siglentna.com/operating-tip/spd-programming-tips/
Avid Rabid Hobbyist.
Some stuff seen @ Siglent HQ cannot be shared.
 

Offline metrTopic starter

  • Newbie
  • Posts: 3
  • Country: us
Re: Siglent SPD1168X Visa Commands
« Reply #4 on: May 21, 2021, 03:24:24 pm »
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!
 

Offline TheDefpom

  • Frequent Contributor
  • **
  • Posts: 798
  • Country: nz
  • YouTuber Nerd - I Fix Stuff
    • The Defpom's Channel
Re: Siglent SPD1168X Visa Commands
« Reply #5 on: January 03, 2022, 12:34:09 am »
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.
« Last Edit: January 03, 2022, 12:39:53 am by TheDefpom »
Cheers Scott

Check out my Electronics Repair, Mailbag, or Review Videos at https://www.youtube.com/TheDefpom
 

Offline peter_mcc

  • Contributor
  • Posts: 40
Re: Siglent SPD1168X Visa Commands
« Reply #6 on: April 25, 2023, 05:57:26 am »
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: [Select]
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 connection
        clientPowerDc = new TcpClient(IpAddressPowerSupplyDc1, DevicePort);
        streamPowerDc = clientPowerDc.GetStream();
        clientPowerDc.ReceiveTimeout = 2000;
        Thread.Sleep(SleepTimePowerDc);

        string message;
        Byte[] dataSend;

        // Set up DC Power Supply
        message = "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 stuff
        Byte[] dataErr = new Byte[256];
        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);
    }
}
« Last Edit: April 25, 2023, 06:08:45 am by peter_mcc »
 
The following users thanked this post: Performa01


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf