So, I have a network analyzer (specifically the P9374A, but this question doesn't apply to just this model). Is there a SCPI command that lets me capture raw trace data in SMC mode, something like what Calc:Data:SNP:PORTs:SAVE does in standard mode?
Right now I am saving the data to an .s2p, reading it using a python function, then deleting the .s2p, but this is a hacky approach and is prone to be slow as it is using I/O operations with a hard disk.
I did find this old thread and read it, but my question is specifically about not saving .s2p files, but instead retrieving the raw data directly from the traces.
You have to get data a trace at a timie in SMC if you don't wan to use save to S2P file. To do that, have traces on screen with the data you want (like S11, SC21, IPwr, Opwr, etc.
Then loop through the traces selecting one by one and reading the data. You can read the raw (uncorrected data or the corrected data.
To select the trace, I find it easy to use the measurement number (Mnum) which matches the number on the Trx like trace 1 is Tr1 and Mnum=1:
Data SCPI
Critical Note: CALCulate commands act on the selected measurement. You can select one measurement for each channel using Calc:Par:MNUM
Then read the data using calc:data...from the help file:
Data SCPI
CALCulate<cnum>:DATA? <char>
Applicable Models: N522xB, N523xB, N524xB, M937xA, P937xA
Reads or writes Measurement data, Memory data, or Normalization Divisor data from the Data Access Map location.
For Measurement data, use FDATA, RDATA, or SDATA
For Memory data, use FMEM or SMEM. When querying memory, you must first store a trace into memory using CALC:MATH:MEMorize.
For Normalization Divisor (Receiver Power Cal error term) data, use SDIV
Use FORMat:DATA to change the data type (<REAL,32>, <REAL,64> or <ASCii,0>).
Use FORMat:BORDer to change the byte order. Use “NORMal” when transferring a binary block from LabView or Vee. For other programming languages, you may need to "SWAP" the byte order.
Equation Editor Notes:
When equation editor is active on a trace in a standard S-parameter channel, Calc:Data returns the data from the parameter on the trace that was measured last. For example, for the equation "S22 + S33 + S11”, then S33 is the last measured parameter because it uses source port 3.
In applications, if equation editor is active and the original parameter for the trace is not requested anywhere in the channel, then zeros are returned. If the original parameter is being measured within the channel, then data for the original parameter is returned.
In general, if an equation contains no measurement parameters, then data for the original parameter is returned.
Note: The Calc:Data SCORR command to read / write error terms is Superseded with SENS:CORR:CSET:DATA. SCORR commands do NOT accommodate greater than 12 error terms.
See Critical Note
Parameters
<cnum>
Channel number of the measurement. There must be a selected measurement on that channel. If unspecified, <cnum> is set to 1.
<char>
FDATA
Formatted measurement data to or from Data Access Map location Display (access point 2).
Note: When querying FDATA, data is received in degrees. When setting phase using FDATA, the command expects the data in radians.
Corrected data is returned when correction is ON.
Uncorrected data is returned when correction is OFF.
Returns TWO numbers per data point for Polar and Smith Chart format.
Returns one number per data point for all other formats.
Format of the read data is same as the displayed format.
RDATA
Complex measurement data.
Writes data to Data Access Map location Raw Measurement (access point 0).
When writing corrected data, and correction is ON, it will be corrected again, resulting in meaningless data (Same behavior as SDATA).
Reads data from Data Access Map location Raw Measurement (access point 0).
Returns TWO numbers per data point.
Returned numbers are uncorrected (regardless of correction state)
SDATA
Complex measurement data.
Writes data to Data Access Map location Raw Measurement (access point 0).
When writing corrected data, and correction is ON, it will be corrected again, resulting in meaningless data.
Reads data from Apply Error Terms (access point 1).
Returns TWO numbers per data point.
Corrected data is returned when correction is ON.
Uncorrected data is returned when correction is OFF.
FMEM
Formatted memory data to or from Data Access Map location Memory result (access point 4).
Returns TWO numbers per data point for Polar and Smith Chart format.
Returns one number per data point for all other formats.
Format of the read data is same as the displayed format.
Returned data reflects the correction level (On|OFF) when the data was stored into memory.
SMEM
Complex measurement data to or from Data Access Map location Memory (access point 3).
Returns TWO numbers per data point.
Returned data reflects the correction level (On|OFF) when the data was stored into memory.
Returned data reflects the correction level (On|OFF) when the data was stored into memory.
SDIV
Complex data from Data Access Map location Normalization (5).
Returns TWO numbers per data point.
If normalization interpolation is ON and the number of points changes after the initial normalization, the divisor data will then be interpolated.
When querying the normalization divisor, you must first store a divisor trace using CALC:NORMalize[:IMMediate].