Hi all,
I do not own a SPD3303-X but a SPD1305X and I have the same problem as described here. Reading the thread helped me a lot to find a solution for the SPD1305X and may be it will work for you as well.
The important thing is that *some* commands like OUTP (and MODE:SET for the SPD1305X) should be sent *without* \n (linefeed). And some other commands requires to have a delay before sending another one. I do not know if there is an exact delay to use and I am using different one for different commands. Whenever your run your script, if the unit is generating a beep, that means something is wrong: try to locate which command is generating the beep and add a delay and/or try removing the \n at the end of the command string.
Here is a script that is working well on my SPD1305X, no beep at all when running it; it is a golang program and even if your are not using the go language it should be easy to read: please check carrefully how some commands are send using \n at the end and some don't.
package main
import "net"
import "fmt"
import "bufio"
import "log"
import "strings"
import "time"
func send(conn net.Conn, cmd string, waitreply bool, delay time.Duration) {
// Print the command on the console and ensure that a linefeed is printed
// even if the command string does not have one
fmt.Printf("> %v\n", strings.TrimSpace(cmd))
// Send the command string exactly as passed to the function
// do not add a \n here ! this is important
fmt.Fprintf(conn, cmd)
// if a delay is required
time.Sleep(delay)
// if there is a response to read
if waitreply {
response, _ := bufio.NewReader(conn).ReadString('\n')
fmt.Printf("< %v\n", strings.TrimSpace(response))
}
}
func main() {
conn, err := net.Dial("tcp", "spd1305x:5025") // replace spd1305x by your unit IP address
if err != nil {
log.Fatal(err)
}
defer conn.Close()
// Get the identification string
send(conn, "*IDN?\n", true, 0)
// Get the current status of the unit
send(conn, "SYST:STAT?\n", true, 0)
// Unlock the unit (if ever it is needed)
send(conn, "*UNLOCK\n", false, 100*time.Millisecond)
// Set the 4 wire mode, Note: I do not know if this is available on the SPD3305X
send(conn, "MODE:SET 2W", false, 100*time.Millisecond)
// Set out to 5v
send(conn, "VOLT 5.0\n", false, 0)
// Max current to 100mA
send(conn, "CURR 0.1\n", false, 0)
// Enable output (only one output anyway on the SPD1305X)
// this is the important thing: do not send a linefeed at the end of the command string
// and add a delay to let the output settle
send(conn, "OUTP CH1,ON", false, 2000*time.Millisecond)
// Check if the last command generate an error
send(conn, "SYST:ERR?\n", true, 0)
// Check what is the selected voltage
send(conn, "VOLT?\n", true, 0)
// Check the actual output voltage
send(conn, "MEAS:VOLT?\n", true, 0)
// Check the actual output current
send(conn, "MEAS:CURR?\n", true, 0)
// Check the actual output power
send(conn, "MEAS:POWE?\n", true, 0)
// Turn off the output
// again: no \n at the end of the command string
// no delay needed here as the script is ending
send(conn, "OUTP CH1,OFF", false, 0)
// Check if the last command generate an error
send(conn, "SYST:ERR?\n", true, 0)
// Lock the unit and quit
send(conn, "*LOCK\n", false, 0)
}
Here is what should be displayed on your console when running this program:
When trying this on your SPD3305X, you should probably not send the MODE:SET command
> *IDN?
< Siglent Technologies,SPD1305X,XXXXXXXXXX,2.01.01.07R1,V1.0
> SYST:STAT?
< 0x20
> *UNLOCK
> MODE:SET 2W
> VOLT 5.0
> CURR 0.1
> OUTP CH1,ON
> SYST:ERR?
< 0 No Error
> VOLT?
< 5.000
> MEAS:VOLT?
< 5.000
> MEAS:CURR?
< 0.025
> MEAS:POWE?
< 0.125
> OUTP CH1,OFF
> SYST:ERR?
< 0 No Error
> *LOCK
When running it I had a 220 resistor attached so the results are fine.
Please confirm from your side !