Skip to content

Commit

Permalink
new SCPI command to switch between linear/log sweeps in VNA mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Sep 16, 2024
1 parent b09ea7d commit 009de1a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Binary file modified Documentation/UserManual/ProgrammingGuide.pdf
Binary file not shown.
4 changes: 4 additions & 0 deletions Documentation/UserManual/ProgrammingGuide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ \subsubsection{VNA:POWer:STOP}
\event{Sets the stop power of the power sweep}{VNA:POWer:STOP}{<stop power>, in dBm}
\query{Queries the currently selected stop power}{VNA:POWer:STOP?}{None}{stop power in dBm}

\subsubsection{VNA:SWEEPTYPE}
\event{Selects between linear and logarithmic sweeps}{VNA:SWEEPTYPE}{<type>, either ``LIN'' or ``LOG''}
\query{Queries the currently selected sweep type}{VNA:SWEEPTYPE?}{None}{``LIN'' or ``LOG''}

\subsubsection{VNA:ACQuisition:RUN}
\event{Puts the VNA into run mode (sweep active)}{VNA:ACQuisition:RUN}{None}
\query{Queries whether the VNA is in run mode}{VNA:ACQuisition:RUN?}{None}{TRUE or FALSE}
Expand Down
15 changes: 15 additions & 0 deletions Software/PC_Application/LibreVNA-GUI/VNA/vna.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1456,6 +1456,21 @@ void VNA::SetupSCPI()
}, [=](QStringList) -> QString {
return QString::number(settings.Power.stop);
}));
SCPINode::add(new SCPICommand("SWEEPTYPE", [=](QStringList params) -> QString {
if(params.size() >= 1) {
if(params[0] == "LIN") {
SetLogSweep(false);
return SCPI::getResultName(SCPI::Result::Empty);
} else if(params[0] == "LOG") {
SetLogSweep(true);
return SCPI::getResultName(SCPI::Result::Empty);
}
}
// either no parameter or invalid
return SCPI::getResultName(SCPI::Result::Error);
}, [=](QStringList) -> QString {
return settings.Freq.logSweep ? "LOG" : "LIN";
}));
auto scpi_acq = new SCPINode("ACQuisition");
SCPINode::add(scpi_acq);
scpi_acq->add(new SCPICommand("RUN", [=](QStringList) -> QString {
Expand Down

0 comments on commit 009de1a

Please sign in to comment.