Well what a weekend of frustration!
Getting the 'scope's IP address and port for sending SCPI commands was quite straightforward thanks to it's Zeroconf interface. What was frustrating was that I could send commands, but much of the time they failed, or at least the query commands did. It seems to be fairly arbitrary, and might be to do with timing, but putting in various delays between commands only made it fail slightly less often. I have put in a support ticket to Rigol, but as I know this board is frequented by people far cleverer than me, any one out there have idea what I'm doing wrong?
For instance, if I send the following command sequence:
*RST
<sleep for a few seconds>
*CLS;*SRE 0;*ESE 0;*OPC?
<wait for data to be received>
:WAV:MODE NORM
:WAV:PRE?
<wait for data to be received>
The scope returns "command error", and querying the error with:
:SYST:ERR?
Sometimes gives me "command error" or sometimes a -410,"Query INTERRUPTED"
Putting a
*OPC? command after
:WAV:MODE NORM (either in-line or as a separate command) makes no difference.
A -410 error implies there is a previous response waiting for me to consume before querying again, or that I am issuing a second query before the first has been completed. But I wait with a nice big buffer after every query, and I still get the "command error" response.
I have tried it with TCP_NODELAY enabled and disabled, big receive buffers, and all manner of futzing about to get at least a consistent response. Sending the same command sequence over USB caused no problems, so I'm assuming it's something to do with the 'scope's interface between its internal command queue and its TCP/IP stack, or a PEBKAC.