The commands CALCulate<Ch>:DATA:NSWeep...? SDATa, <Trace_Hist_Count> retrieve the results of any sweep within a previously defined single sweep group. This means that, in single sweep mode, you can first measure a specified number of sweeps (SENSe<Ch>:SWEep:COUNt <sweeps>) and then read any of the data traces acquired.
This feature has no equivalent in manual control where always the last data trace is displayed.
// Reset the analyzer
*RST
:SYSTEM:DISPLAY:UPDATE ON
// Create a second and third channel with new diagram areas and traces.
:CALCULATE2:PARAMETER:SDEFINE "Trc2","S11"
:CALCULATE2:PARAMETER:SELECT "Trc2"
:DISPLAY:WINDOW2:STATE ON
:DISPLAY:WINDOW2:TRACE1:FEED 'Trc2'
:CALCULATE3:PARAMETER:SDEFINE "Trc3","S11"
:CALCULATE3:PARAMETER:SELECT "Trc3"
:DISPLAY:WINDOW3:STATE ON
:DISPLAY:WINDOW3:TRACE1:FEED 'Trc3'
// Select sweep time for the channels.
:SENSE1:SWEEP:TIME 1 S
:SENSE2:SWEEP:TIME 1 S
:SENSE3:SWEEP:TIME 1 S
// Enable single sweep mode for all channels so that sweep count settings are used
:INITIATE:CONTINUOUS OFF
// Select single sweep mode with channel-specific sweep count settings
// Set sweep counts and start measurement in all channels
:INITIATE:IMMEDIATE:SCOPE SINGLE
:SENSE1:SWEEP:COUNT 1
:SENSE2:SWEEP:COUNT 2
:SENSE3:SWEEP:COUNT 3
:INITIATE1:IMMEDIATE; *WAI
:INITIATE2:IMMEDIATE; *WAI
:INITIATE3:IMMEDIATE; *WAI
// Select single sweep mode with global sweep count settings
// Set global sweep count for all channels, start measurement in all channels
:INITIATE:IMMEDIATE:SCOPE ALL
:SENSE:SWEEP:COUNT 4
:INITIATE:IMMEDIATE; *WAI