Hello...
In network analyzer only one S-parameter window is opened with one S21 Trace (Phase format). When we manually save the data as .csv file on the network analyser, its saving Phase and amplitude data together in the file.
We could able to read phase and amplitude separately from separate window one after other by switching the window and using "FDATA" SCPI command.
But when we try to read the data through software programmatically, not sure how to read both phase and amplitude together from one window and one trace. Need to know how to save data like its being saved manually on .csv file.
Regards,
S Nagaraju
you don't need multiple traces to get both the magnitude and phase of the same trace. there a couple of different ways to get the complex data from a trace. one way is to use the CALC:DATA? query command, but instead asking for FDATA, you ask for SDATA. that query will return 2 numbers per data point, where the first number in the pair is the real and the 2nd number is imaginary component of the complex data. using the real and imaginary values of each point, you can then compute the magnitude and phase using simple trig formulas mag (dB) = 20 * Log10(sqrroot(real^2 + imaginary^2) ) and the phase = arctan(imaginary/real).
However if you don't want to do any math, you can simply use the calc:data? FDATA command twice. if the trace format is logmag at first, when you send the command, you get log mag data. next without sweeping the channel, send the command to change the format of the trace to phase (calc:form PHASE) and then send the calc:data? FDATA command again and this time, the data returned will be phase.