This query returns the instrument identification string.
The response consists of 4 comma-separated fields:
`manufacturer,model,serialnr,version`.
### `RESET`
Command: `RESET`
This command restores most non-persistent settings to power-on defaults.
It resets all settings, except for the following:
- saved calibration;
- active network configuration;
- saved network configuration.
The active calibration is restored to match the saved calibration.
Other settings are restored to fixed power-on defaults.
Any ongoing analog acquisition is stopped.
### `TIMESTAMP?`
Query: `TIMESTAMP?`<br>
Response: decimal integer, representing the current timestamp in units of 8 ns.
### `AIN:CHANNELS:COUNT?`
Query: `AIN:CHANNELS:COUNT?`<br>
Response: number of supported analog input channels.
The response is `2` for a standard Red Pitaya, or `4` for a 4-input Red Pitaya.
### `AIN:CHANNELS:ACTIVE`
Command: `AIN:CHANNELS:ACTIVE n`<br>
Parameter _n_: number of active channels, either `2` or `4`.
This command is only supported on a 4-input Red Pitaya.
When 2 channels are active, only analog input channels 1 and 2 are included in analog acquisition data.
Query: `AIN:CHANNELS:ACTIVE?`<br>
Response: number of active channels, either `2` or `4`.
### `AIN:CHn:RANGE`
Command: `AIN:CHn:RANGE range`<br>
Field _n_: channel number, in range 1 to 4. <br>
Parameter _range_: input range, either `LO` or `HI`.
This command specifies which set of calibration coefficients should be used to interpret ADC samples.
Note that this command does not change the actual input range of the Red Pitaya.
The input range can only be changed by manually placing a jumper on the board.
Query: `AIN:CHn:RANGE?`<br>
Response: currently configured input range, either `LO` or `HI`.
### `AIN:CHn:OFFSET[:LO|HI]`
Command: `AIN:CHn:OFFSET offs`<br>
Field _n_: channel number, in range 1 to 4. <br>
Parameter _offs_: floating point number specifying the offset calibration.
The offset calibration specifies the raw ADC code corresponding to analog input level 0 Volt.
The expected value is in the middle of the ADC code range, i.e. approximately 8192.
The plain variant of the command configures the offset calibration for the active input range of the channel.
Command: `AIN:CHn:OFFSET:LO offs`<br>
Command: `AIN:CHn:OFFSET:HI offs`<br>
These variants of the command configure the offset calibration for a specific input range.
Query: `AIN:CHn:OFFSET?`<br>
Query: `AIN:CHn:OFFSET:LO?`<br>
Query: `AIN:CHn:OFFSET:HI?`<br>
Response: floating point number indicating the offset calibration for the active input range or the specified input range.
### `AIN:CHn:GAIN[:LO|HI]`
Command: `AIN:CHn:GAIN gain`<br>
Field _n_: channel number, in range 1 to 4. <br>
Parameter _gain_: floating point number specifying the gain calibration.
The gain calibration specifies the difference in raw ADC code corresponding to a 1 Volt difference in analog input level.
The expected value is negative, because the Red Pitaya uses an inverting input amplifier.
The plain variant of the command configures the gain calibration for the active input range of the channel.
Command: `AIN:CHn:GAIN:LO offs`<br>
Command: `AIN:CHn:GAIN:HI offs`<br>
These variants of the command configure the gain calibration for a specific input range.
Query: `AIN:CHn:GAIN?`<br>
Query: `AIN:CHn:GAIN:LO?`<br>
Query: `AIN:CHn:GAIN:HI?`<br>
Response: floating point number indicating the gain calibration for the active input range or the specified input range.
### `AIN:CAL:SAVE`
Command: `AIN:CAL:SAVE`
This command saves the active calibration settings to the SD card, to be used as power-on defaults.
The following settings are saved: for each analog input channel, its input range, offset calibration for low and high range, and gain calibration for low and high range.
### `AIN:CHn:SAMPLE[:RAW]?`
Query: `AIN:CHn:SAMPLE?`<br>
Field _n_: channel number, in range 1 to 4. <br>
Response: floating point number representing the most recent ADC sample for the specified input channel in Volt.
Query: `AIN:CHn:SAMPLE:RAW?`<br>
Response: decimal integer representing the raw ADC code of the most recent sample for the specified input channel.
Sample rate settings are not applicable to this command.
The ADC always samples at 125 MSa/s.
This command returns the most recent single sample, without downsampling or averaging.
### `AIN:CHn:MINMAX[:RAW]?`
Query: `AIN:CHn:MINMAX?`<br>
Field _n_: channel number, in range 1 to 4. <br>
Response: two floating point numbers separated by a space character, representing the minimum and maximum input level in Volt.
Query: `AIN:CHn:MINMAX:RAW?`<br>
Response: two decimal integers separated by a space character, representing the minimum and maximum raw ADC code.
The returned values are the minimum and maximum sample values that occurred since the last reset of the range monitor.
### `AIN:MINMAX:CLEAR`
Command: `AIN:MINMAX:CLEAR`
This command resets the input range monitors of all analog input channels.
### `AIN:SRATE`
Command: `AIN:SRATE rate`<br>
Parameter _rate_: floating point number specifying the sample rate in samples per second.
This command configures the effective sample rate of the acquisition chain.
Valid sample rates are in range 500 to 125e6 samples per second.
The specified sample rate will be rounded to the nearest supported rate.
Query: `AIN:SRATE?`<br>
Response: floating point number representing the sample rate in samples per second.
### `AIN:SRATE:DIVISOR`
Command: `AIN:SRATE:DIVISOR divisor`<br>
Parameter _divisor_: decimal integer specifying the downsample factor.
This command configures the downsample factor of the acquisition chain.
Valid downsample factors are in range 1 to 250000.
Query: `AIN:SRATE:DIVISOR?`<br>
Response: decimal integer representing the downsample factor.
**Note:** Commands `AIN:SRATE` and `AIN:SRATE:DIVISOR` are different methods to control the same internal setting.
**Note:** When auto-trigger mode is selected, the downsample factor must be at least 2.
When 4 channels are active, the downsample factor must be at least 2, or 4 if auto-trigger mode is selected.
### `AIN:SRATE:MODE`
Command: `AIN:SRATE:MODE mode`<br>
Parameter _mode_: downsample mode, either `DECIMATE` or `AVERAGE`.
This command selects downsampling by means of decimation or averaging.
Downsampling works by collecting groups of consecutive raw ADC samples and translating each group into a single downsampled value.
The number of raw samples per group is determined by the downsample factor (see `AIN:SRATE:DIVISOR`).
In mode `DECIMATE`, the first sample of a group is used as downsampled value; the other samples in the group are discarded.
In mode `AVERAGE`, the sum of all samples in a group is used as downsampled value.
Query: `AIN:SRATE:MODE?`<br>
Response: either `DECIMATE` or `AVERAGE`.
### `AIN:SRATE:GAIN?`
Query: `AIN:SRATE:GAIN?`<br>
Response: floating point number representing the effective gain factor due to downsampling.
The value returned by this query depends on the downsample factor and the downsample mode.
In downsample mode `DECIMATE`, this query always returns 1.0.
In downsample mode `AVERAGE`, this query returns a number between 1 and 1024.
### `AIN:NSAMPLES`
Command: `AIN:NSAMPLES n`<br>
Parameter _n_: decimal integer specifying the number of samples per channel per trigger.
This command configures the number of (downsampled) samples to collect for each trigger.
Valid values are from 1 to 65536.
Query: `AIN:NSAMPLES?`<br>
Response: decimal integer representing the number of samples per trigger.
### `AIN:TRIGGER`
Command: `AIN:TRIGGER`
This command forces a trigger to occur, regardless of the configured trigger mode.
Note that even a forced trigger may be ignored if the acquisition chain is still processing a previous trigger.
### `AIN:TRIGGER:MODE`
Command: `AIN:TRIGGER:MODE mode`<br>
Parameter _mode_: trigger mode, either `NONE` or `AUTO` or `EXTERNAL` or `EXTERNAL_ONCE`.
**Note:** When trigger mode `EXTERNAL_ONCE` is selected, the trigger mode automatically changes to `NONE` as soon as a trigger occurs.
Query: `AIN:TRIGGER:MODE?`<br>
Response: active trigger mode.
### `AIN:TRIGGER:DELAY`
Command: `AIN:TRIGGER:DELAY n`<br>
Parameter _n_: decimal integer specifying trigger delay as a number of 8 ns cycles.
This configures a delay between trigger detection and the start of sample collection.
Valid values are from 0 to 65535.
Query: `AIN:TRIGGER:DELAY?`<br>
Response: decimal integer representing the trigger delay as a number of 8 ns cycles.
### `AIN:TRIGGER:STATUS?`
Query: `AIN:TRIGGER:STATUS?`<br>
Response: trigger status, either `BUSY` or `WAITING`.
This query returns `BUSY` when the acquisition chain is processing a trigger, or `WAITING` if the acquisition chain is waiting for a trigger.
### `AIN:TRIGGER:EXT:CHANNEL`
Command: `AIN:TRIGGER:EXT:CHANNEL n`<br>
Parameter _n_: decimal integer specifying a digital input channel, in range 0 to 3.
This command selects the digital input channel to use as external trigger.
Query: `AIN:TRIGGER:EXT:CHANNEL?`<br>
Response: decimal integer specifying the selected digital input channel.
### `AIN:TRIGGER:EXT:EDGE`
Command: `AIN:TRIGGER:EXT:EDGE edge`<br>
Parameter _edge_: trigger edge, either `RISING` or `FALLING`.
This command selects rising or falling edges in the external trigger signal.