SCPI Interface

For communication betten the server and the client an SCPI interface with custom commands is used. In the following tables an overview of the available commands and their behaviour is given. The Julia Client library encapsulates these commands into function calls, abstracting their communication details and also combining commands to manage a cluster of RedPitayas at the same time.

As a safe guard the server has different communcation modes and certain commands are only available in certain modes. To give an example, during an acquisition changing the sampling rate would result in unclear behaviour. To stop such a scenario the decimation can only be set in the CONFIGURATION mode and an acquisition can only be triggered in the ACQUISITION mode. The available modes are CONFIGURATION, ACQUISITION and TRANSMISSION (C, A, T, 😺). The former two are set by the client and the latter is set by the server during sample transmission.

After each SCPI command the server replies with true or false on the command socket depending on whether the given command was successfully excecuted. The exception to this rule are the commands which themselves just query values from the server.

ADC Configuration

CommandArgumentsDescriptionModeExample
RP:ADC:DECimationdecimation value [8, ..., n]Set the decimation factor of the base sampling rateCRP:ADC:DEC 8
RP:ADC:DECimation?Return the decimation factorAnyRP:ADC:DEC?
RP:TRIGger:MODetrigger mode (EXTERNAL, INTERNAL)Set the trigger mode, which trigger the RedPitaya listens toCRP:TRIG:MOD INTERNAL
RP:TRIGger:MODe?Return the trigger modeAnyRP:TRIG:MOD?

DAC Configuration

CommandArgumentsDescriptionModeExample
RP:DAC:CHannel#:COMPonent#:SIGnaltypechannel (0, 1), (0, 1, 2, 3), signal type (SINE, TRIANGLE, SAWTOOTH)Set signal type of first component for given channelAnyRP:DAC:CH0:SIG SINE
RP:DAC:CHannel#:COMPonent#:SIGnaltype?channel (0, 1), component (0, 1, 2, 3)Return signal type of first component of given channelAnyRP:DAC:CH1:SIG?
RP:DAC:CHannel#:OFFsetchannel (0, 1), offset [-1, ..., 1]Set offset for given channelAnyRP:DAC:CH1:OFF 0.1
RP:DAC:CHannel#:OFFset?channel (0, 1)Return offset of given channelAnyRP:DAC:CH0:OFF?
RP:DAC:CHannel#:COMPonent#:AMPlitudechannel (0, 1), component (0, 1, 2, 3), amplitude[0, ..., 1]Set amplitude of given channel and componentAny
RP:DAC:CHannel#:COMPonent#:AMPlitude?channel (0, 1), component (0, 1, 2, 3)Return amplitude of given channel and componentAny
RP:DAC:CHannel#:COMPonent#:FREQuencychannel (0, 1), component (0, 1, 2, 3), frequencySet frequency of given channel and componentAny
RP:DAC:CHannel#:COMPonent#:FREQuency?channel (0, 1), component (0, 1, 2, 3)Return frequency of given channel and componentAny
RP:DAC:CHannel#:COMPonent#:PHAsechannel (0, 1), component (0, 1, 2, 3), phaseSet phase of given channel and componentAny
RP:DAC:CHannel#:COMPonent#:PHAse?channel (0, 1), component (0, 1, 2, 3)Return phase of given channel and componentAny
RP:DAC:CHannel#:RAMPingchannel (0, 1), ramping periodSet length of ramping periodC
RP:DAC:CHannel#:RAMPing?channel (0, 1)Get length of ramping periodAny
RP:DAC:CHannel#:RAMPing:ENablechannel (0, 1) ramping status (OFF, ON)Enable/disable ramping factor on given channelC
RP:DAC:CHannel#:RAMPing:ENable?channel (0, 1)Return enable ramping status of given channelAny
RP:DAC:CHannel#:RAMPing:DoWNchannel (0, 1), ramp down status (OFF, ON)Enable/disable ramp down flag for given channelA, T
RP:DAC:CHannel#:RAMPing:DoWN?channel (0, 1)Get ramp down flag for given channelAny
RP:DAC:RAMPing:STATus?Return the ramping statusAny

Sequence Configuration

The server maintains three acquisition sequences. When the server is in theCONFIGURATION mode a client can configure a set of three sequences. If the current configured sequences fits the desired signal, a client can intstruct the server to set the sequences. This moves the configuration sequences to the acquisition sequences and writes the first values to the FPGA buffer.

During an active trigger the buffer is periodically updated by the server. If the server recognizes the end of a sequence, it sets the amplitudes of the waveform components to 0.

CommandArgumentsDescriptionModeExample
RP:DAC:SEQ:CLocKdividerdividerSet the clock divider with which the sequence advancesC
RP:DAC:SEQ:CLocKdivider?Return the clock dividerAny
RP:DAC:SEQ:SAMPlesperstepsamples per stepSet the clock divider such that the sequence advances every given number of samples.C
RP:DAC:SEQ:SAMPlesperstep?Return the number of samples per stepAny
RP:DAC:SEQ:CHannumChan (1, 2, 3, 4)Set the number of sequence channelC
RP:DAC:SEQ:CHan?Return the number of sequence channel
RP:DAC:SEQ:LUTsteps, repetitionsInstruct the server to receive a LUT over the data socketCRP:DAC:SEQ:LUT 10,2
RP:DAC:SEQ:LUT:ENaBleInstruct the server to receive an enable LUT over the data socket of the same shape as the regular LUTC
RP:DAC:SEQ:LUT:UPsteps, repetitionsInstruct the server to receive a ramp up LUT over the data socketC
RP:DAC:SEQ:LUT:DOWNsteps, repetitionsInstruct the server to receive a ramp down LUT over the data socketC
RP:DAC:SEQ:CLEARClear the set sequence values from the FPGA bufferC
RP:DAC:SEQ:SETSet the current configured sequence as the acquisition sequenceC

Acquisition and Transmission

CommandArgumentsDescriptionModeExample
RP:TRIGgertrigger status (OFF, ON)Set the internal trigger statusARP:TRIG ON
RP:TRIGger?Return the trigger statusAnyRP:TRIG?
RP:TRIGger:ALiVekeep alive status (OFF, ON)Set the keep alive bypassARP:TRIG:ALV OFF
RP:TRIGger:ALiVe?Return the keep alive statusAnyRP:TRIG:ALV?
RP:ADC:WP:CURRent?Return the current writepointerA, TRP:ADC:WP?
RP:ADC:DATa?readpointer, number of samplesTransmit number of samples from the buffer component of the readpointer over the data socket. Return true on the command socket if transmission is started.ARP:ADC:DATa? 400,1024
RP:ADC:DATa:PIPElined?readpointer, number of samples, chunksizeTransmit number of samples from the readpointer on in chunks of chunksize over the data socket. After every chunk status and performance data is transmitted over the data socket. Return true if pipeline was started.ARP:ADC:DAT:PIPE? 400,1024,128
RP:STATus?Transmit status as one byte with flags from lower bits: overwritten, corrupted, lost steps, master trigger, sequence activeAnyRP:STAT?
RP:STATus:OVERwritten?Transmit overwritten flagAnyRP:STAT:OVER?
RP:STATus:CORRupted?Transmit corrupted flagAnyRP:STAT:CORR?
RP:STATus:LOSTSteps?Transmit lost steps flagAnyRP:STAT:LOSTS?
RP:PERF?Transmit ADC and DAC performance dataAnyRP:PERF?

Calibration

CommandArgumentsDescriptionModeExample
RP:CALib:ADC:CHannel#:OFFsetchannel (0, 1), offsetStore the ADC offset value for given channel in EEPROMCRP:CAL:ADC:CH0:OFF 0.2
RP:CALib:ADC:CHannel#:OFFset?channel (0, 1)Return the ADC offset value for given channel from EEPROMAnyRP:CAL:ADC:CH1:OFF?
RP:CALib:ADC:CHannel#:SCAlechannel (0, 1), scaleStore the ADC scale value for given channel in EEPROMCRP:CAL:ADC:CH1:SCA 1.0
RP:CALib:ADC:CHannel#:SCAle?channel (0, 1)Return the ADC scale value for given channel from EEPROMAnyRP:CAL:ADC:CH1:SCA?
RP:CALib:DAC:CHannel#:OFFsetchannel (0, 1), offsetStore the DAC offset value for given channel in EEPROMCRP:CAL:DAC:CH0:OFF 0.2
RP:CALib:DAC:CHannel#:OFFset?channel (0, 1)Return the DAC offset value for given channel from EEPROMAnyRP:CAL:DAC:CH1:OFF?
RP:CALib:DAC:CHannel#:SCAlechannel (0, 1), scaleStore the DAC scale value for given channel in EEPROMCRP:CAL:DAC:CH1:SCA 1.0
RP:CALib:DAC:CHannel#:SCAle?channel (0, 1)Return the DAC scale value for given channel from EEPROMAnyRP:CAL:DAC:CH1:SCA?

DIO

CommandArgumentsDescriptionExample
RP:DIO:DIRidentifier of pin, direction (IN/OUT)Set the direction of the DIORP:DIO:DIR DIO7_P,IN
RP:DIOidentifier of pin, value (0/1)Set the output of the DIORP:DIO DIO7_P,1
RP:DIO?identifier of pinGet the input of the DIORP:DIO? DIO7_P