There are number of useful SCPI commands available under the SYST:DATA:MEMory node to help the user gather data from the VNA instrument.
Specifically, these commands enable:
Retrieving the data for all the S-Parameters within an S-Parameter calibration without creating individual measurement traces (“CAL” mode)
Batching up the collection of data so that the client does not have to retrieve data on every sweep (“REPeat COUNT”)
Automatically pushing data into a binary file
Making data available over shared memory for the fastest possible transfer speed
The first part of using these commands is to initialize the memory buffer and to indicate which measurements should be monitored. This first part is accomplished using these commands:
For each measurement x to be added:
SYST:DATA:MEM:MEAS[x]:FORM <formatType>
SYST:DATA:MEM:MEAS[x]:REPeat <repeatCount> // this is optional and only necessary if client code wants to batch results without retrieving on each sweep
SYST:DATA:MEM:COMMit <optional memory name>
At this point, after each sweep, the VNA will push the data into the buffers.
Shared Memory: The buffers can be accessed over shared memory using the optional memory name. See the shared memory example.
Saving the buffer to a file: To save the buffer to a file, use the SYST:DATA:MEM:COMMit <filename>. To access the file outside of the VNA firmware, close the VNA handle to the file with SYST:DATA:MEM:CLOSe:FILE <filename>.
Accessing the data with SCPI: To access the data via SCPI, use the SYST:DATA:MEM:READ:MEAS[x]? query.
For each measurement x:
SYST:DATA:MEM:READ:MEAS[x]? FDATA
It can be convenient to record all the corrected S-Parameters on a standard channel. To configure this measurement, use SYST:DATA:MEM:MEAS[x]:FORM CAL
For example:
SYST:DATA:MEM:INIT
SYST:DATA:MEM:MEAS1:FORM CAL
SYST:DATA:MEM:MEAS1:ADD
SYST:DATA:MEM:COMMit <optional memory name>
Then, to retrieve the data, either use the shared memory buffer name.
Or the data can be retrieved using SCPI:
SYST:DATA:MEM:MEAS1:CAL? 'S11',DB
SYST:DATA:MEM:MEAS1:CAL? 'S21',DB
SYST:DATA:MEM:MEAS1:CAL? 'S12',DB
SYST:DATA:MEM:MEAS1:CAL? 'S22',DB