Skip to content

Commit 45a30a4

Browse files
committed
only stream data if calculations are performed + documentation of streaming servers
1 parent 6ca5454 commit 45a30a4

File tree

4 files changed

+31
-3
lines changed

4 files changed

+31
-3
lines changed
6.26 KB
Binary file not shown.

Documentation/UserManual/ProgrammingGuide.tex

+26
Original file line numberDiff line numberDiff line change
@@ -851,4 +851,30 @@ \subsubsection{SA:TRACe:TYPE}
851851
\event{Sets the storage type of a trace}{SA:TRACe:TYPE}{<trace>, either by name or by index\\<type>, options are OVERWRITE, MAXHOLD or MINHOLD}
852852
\query{Queries the storage type of a trace}{SA:TRACe:TYPE?}{<trace>, either by name or by index}{OVERWRITE, MAXHOLD or MINHOLD}
853853

854+
\section{Streaming data}
855+
The SCPI server works well for configuring the device and also for reading trace data once an acquition is done. But it isn't very well suited for reading data while the device is capturing it. For some applications (e.g. when running continuous sweeps) it may be beneficial to process the data externally as it getting captured. For this purpose, the LibreVNA-GUI supports streaming the data over dedicated ports.
856+
857+
These streaming servers have to be enbled first. This can be done in \menu[,]{Window,Preferences,Streaming Servers}.
858+
859+
There are a total of 5 streaming servers available. They can all be enabled and used at the same time, although not all servers will output data all the time.
860+
861+
\begin{itemize}
862+
\item \textbf{VNA raw data:} Outputs the raw S-parameters without any calibration applied. This output is always available, even when a calibration is enabled or de-embedding it active. Apart from averaging (if enabled) no processing is done on the data.
863+
\item \textbf{VNA calibrated data:} Outputs the calibrated S-parameters with the calibration applied. This output is only available when a calibration is enabled.
864+
\item \textbf{VNA de-embedded data:} Outputs the de-embedded S-parameters with the de-embbeding and calibration (if enabled) applied. This output is only available when de-embedding is active.
865+
\item \textbf{SA raw data:} Outputs the raw (not normalized) power levels from the spectrum analyzer. This output is always available, even when normalizing is active.
866+
\item \textbf{SA normalized data:} Outputs the normalized power levels from the spectrum analyzer. This output is only available when normalizing is active.
867+
\end{itemize}
868+
869+
\vspace{0.5cm}
870+
871+
All servers output a newline-terminated line of json formatted data for each measurement point in the sweep:
872+
873+
\begin{example}
874+
{"Z0":50.0,"dBm":-20.0,"frequency":42993000.0,"measurements":{"S11_imag":-0.061379313997181856,"S11_real":0.023033630841401063,"S12_imag":0.3205479840477101,"S12_real":-0.5742283570681822,"S21_imag":-0.3746074656570865,"S21_real":0.6126114195570408,"S22_imag":0.06312766256272641,"S22_real":-0.018668561526968372},"pointNum":7}
875+
\end{example}
876+
\begin{example}
877+
{"frequency":2182396.0,"measurements":{"PORT1":7.343487141042715e-06,"PORT2":6.78117066854611e-06},"pointNum":445}
878+
\end{example}
879+
854880
\end{document}

Software/PC_Application/LibreVNA-GUI/SpectrumAnalyzer/spectrumanalyzer.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,9 @@ void SpectrumAnalyzer::NewDatapoint(DeviceDriver::SAMeasurement m)
561561
m.second /= normalize.portCorrection[m.first][m_avg.pointNum];
562562
m.second *= corr;
563563
}
564+
window->addStreamingData(m_avg, AppWindow::SADataType::Normalized);
564565
}
565566

566-
window->addStreamingData(m_avg, AppWindow::SADataType::Normalized);
567567

568568
traceModel.addSAData(m_avg, settings);
569569
emit dataChanged();

Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,9 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m)
958958

959959
cal.correctMeasurement(m_avg);
960960

961-
window->addStreamingData(m_avg, AppWindow::VNADataType::Calibrated);
961+
if(cal.getCaltype().type != Calibration::Type::None) {
962+
window->addStreamingData(m_avg, AppWindow::VNADataType::Calibrated);
963+
}
962964

963965
TraceMath::DataType type;
964966
if(settings.zerospan) {
@@ -986,10 +988,10 @@ void VNA::NewDatapoint(DeviceDriver::VNAMeasurement m)
986988
traceModel.addVNAData(m_avg, type, false);
987989
if(deembedding_active) {
988990
deembedding.Deembed(m_avg);
991+
window->addStreamingData(m_avg, AppWindow::VNADataType::Deembedded);
989992
traceModel.addVNAData(m_avg, type, true);
990993
}
991994

992-
window->addStreamingData(m_avg, AppWindow::VNADataType::Deembedded);
993995

994996
emit dataChanged();
995997
if(m_avg.pointNum == settings.npoints - 1) {

0 commit comments

Comments
 (0)