11#define PT2026_USB_RESOURCE_PATTERN "USB[0-9]*::0x1BFA::0x07EA::[0-9]+::INSTR"
12#define VISA_TIMEOUT_MS 8000
19 using namespace std::chrono_literals;
26 bool _KeyboardKeyPressed =
false;
36 _KeyboardKeyPressed = _kbhit();
38 if ((NULL == l_pInstrument) && !_KeyboardKeyPressed)
39 std::this_thread::sleep_for(1000ms);
41 }
while ((NULL == l_pInstrument) && !_KeyboardKeyPressed);
43 if (_KeyboardKeyPressed)
45 std::cout <<
"Instrument detection aborted by the user." << std::endl;
59 l_pInstrument->
Abort(
true);
61 l_pInstrument->
SetFormat(kComFormatInteger);
81 l_Search.
Mode = kSearchAuto;
94 l_Measure.
Mode = kMeasureAuto;
101 l_MeasAvg.
Type = kMeasRepeat;
110 l_InputTrig.
Source = kInputTrigSrceImmediate;
111 l_InputTrig.
Count = 1;
124 l_ArbSel.
Flux =
true;
148 std::vector<sStatusRegister> l_StatusList = {
sStatusRegister(kStatusOperation, kStatusCondition),
sStatusRegister(kStatusOperation, kStatusEvent) };
149 std::vector<U16> l_StatRes;
151 l_pInstrument->
StatusGet(l_StatusList, l_StatRes);
163 std::cout <<
"L" << std::fixed << std::showpoint << std::setprecision(8) << l_ArbMeas.
AdvMeas.
Basic[0].Flux_UNITS <<
"T" << std::endl;
180 std::cout <<
"N" << std::fixed << std::showpoint << std::setprecision(8) << _CurrentUnlockedFrequency <<
"T" << std::endl;
182 std::this_thread::sleep_for(200ms);
191 l_pInstrument->
Abort(
true);
#define PT2026_USB_RESOURCE_PATTERN
std::vector< tChannel > tChannelList
SCPI channel list
bool ParmSearchSet(const sSearch< uParm > &rSearch, F64 Lgc0122_DetectionLevel_V=0.15)
Configure the search operation, including frequency steps and the search bounds specified in the sele...
bool ParmMeasureGet(sMeasure< uParm > &rMeasure)
bool MeasurementsGet(U32 NoMeasurements, std::vector< tFlux > &rFlux, eUnits &rUnits)
Returns the NMR magnetic field density measurements, including the unit used. A measurement vector is...
bool ParmSearchGet(sSearch< uParm > &rSearch)
bool GetSearchProgress(U8 &rSPR, F32 &rHallMeasurement_UNITS)
bool Abort(bool CancelContinuous=true)
Abort the current operation (Search or measure). Once the operation is aborted, the instrument will b...
bool ParmSearchSetLimits(F64 LowLimit_UNITS, F64 HighLimit_UNITS)
Set the search bounds in the selected unit.
virtual ~CPT2026Instrument()
bool ChannelsSelect(const MTL::SCPI::tChannelList &rChanList)
bool ParmUnitsSet(eUnits Units)
bool SetFormat(eCommunicationFormat Format)
One can request the data in ASCII or binary format. The binary format, which needs extra operation to...
bool ParmTriggerInputSet(const sInputTrigger< uParm > &rInputTrig)
bool StandardStatusSetEnableRegister(eStandardStatusRegister Set, U16 DisableMask, U16 EnableMask)
bool ParmAveragingMeasurementSet(const sMeasurementAveraging< uParm > &rMeasAvg)
bool StatusGet(sStatusRegister Reg, U16 &rStatus)
bool ParmMeasureSet(const sMeasure< uParm > &rMeasure)
bool Connect(U32 InitialTimeout_ms)
bool ChannelsGetList(MTL::SCPI::tChannelList &rChanList)
bool StatusSetEnableRegister(eStatusRegisterSet Set, U16 DisableMask, U16 EnableMask)
bool Initiate(bool Continuous=false)
Starts the search operation and then immediately after NMR resonance detection proceed to NMR measure...
struct MTL::Instrument::PT2026Types::uStatusByte::sStatusByte StatusByte
struct MTL::Instrument::PT2026Types::uOPERation::sOPERation OPERation
eMeasurementAveragingType Type
eInputTriggerSource Source
ParmType< F64 > HighLimit_UNITS
ParmType< F64 > LowLimit_UNITS
std::vector< sBasicMeasurement > Basic
sAdvancedMeasurements AdvMeas
VISA Resource Manager class.
bool FindResources(CResourceList &rList, std::string Filter="?*")
bool EnableEvent(eEventType Type, eEventMechanism Mechanism)
bool WaitOnAllEvents(ViUInt32 Timeout)