ppscpi
ppscpi is a standalone network server for remote control of a PulsePins device.
The implementation is in c++/ppscpi.cc and the SCPI session/server helpers are in c++/scpi_server.hh.
Transport and startup
ppscpi listens on TCP port 5025.
On startup it:
- configures realtime scheduling and locks memory pages
- resets the FPGA fabric
- creates the shared
HostRuntimeand top-levelFPGAwrapper - reports the measured clocks using the frequency-meter block
- accepts SCPI-style commands over the network
Session model
Each client connection gets its own SCPI session object.
Session state includes:
- one
streamer,readback, andcounterwrapper set bound to the sharedFPGA - the currently loaded
Sequence - whether readback checking is enabled
- whether streaming should use forced triggering
The session does not persist across reconnects.
Supported commands
Standard commands:
*IDN?- identify the instrument*RST- clear loaded sequence and session state*CLS- clear status and error queue*OPC/*OPC?- operation complete flag/query*WAI- compatibility no-op;STREAMitself is synchronous*ESR?- standard event status register*STB?- status byteSYST:ERR?- query and drain the error queue
PulsePins-specific commands:
TEST1- run a built-in short self-test sequenceSEQ <data>- parse and load a sequence from textual representation, includingf,final, and control-flow records supported byparse_sequence_from_stream(...)CHECK <bool>- enable or disable readback checking duringSTREAMCHECK?- query the current check settingSTREAM- send the currently loaded sequence and trigger executionDISCONNECT- close the current client session; theppscpiserver keeps runningTERMINATE- stop theppscpiserver process
Typical flow
- Connect to TCP port
5025 - Send
*RST - Send
SEQ ...with the sequence payload - Optionally send
CHECK ON - Send
STREAM - Query
SYST:ERR?if needed
Notes
STREAMuses the same send/trigger path as the local tools, including optional readback verification.SEQstores the parsed sequence in memory; nothing is transmitted to the streamer untilSTREAMis issued.- Repeated
STREAMcommands reuse the stored sequence exactly as parsed; the cached session sequence is not rewritten by readback checking or final-output preparation. - Before each hardware-touching run (
TEST1andSTREAM),ppscpiresets the streamer core, readback encoder, and counters so repeated commands in the same process/session start from a clean hardware state. - If
TEST1orSTREAMreturnsFAILURE,ppscpialso pushes an execution-error record intoSYST:ERR?with the aggregated PulsePins return-code bits so remote clients can distinguish timeout, readback, CRC, buffer, and overflow failures. - When
CHECK ONis active and no explicit startup-timeoutwas supplied, the shared workflow uses a conservative default readback timeout: 2s for the first readback element and 2s for later idle gaps. Startppscpiwith-timeout 0to disable that protection or-timeout <value>to override it. - Finite
STREAMruns also inherit the internal 10 s streamer-completion timeout from the shared playback path. When that timeout fires, the user-facing message istimed out waiting for streamer completion (10 s internal limit). - Hardware-touching commands are serialized across sessions through the shared FPGA lock, so multiple clients can stay connected without racing each other on streamer/reset state.
- The server is intended for remote orchestration, not for high-throughput binary bulk transfer.
- Command-handler exceptions are converted into SCPI error/status state instead of tearing down the whole server process.
- After
DISCONNECT, clients can reconnect and start a fresh independent session. TERMINATEis the explicit server-shutdown command; it closes the current session and stops the process.
Related pages
pptool.mdcpp.mdreadback.mdbuild.md