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.
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);
}
}