67#define THM1176_SUPPORTED_VERSION_MIN_MAJOR 3
68#define THM1176_SUPPORTED_VERSION_MIN_MINOR 0
96 template <
class InstrType,
class RsrcMgrType>
106 std::string m_Identification;
112 std::map<eUnits,U32> m_Units;
113 Matrix3f m_RotationMatrix;
114 std::string m_ManufacturingDate;
115 std::string m_CalibrationDate;
122 bool m_UseCalibration;
125 std::vector<std::chrono::high_resolution_clock::time_point> m_TriggerTimes;
126 std::atomic_bool m_AbortRead;
132 bool ReadIdentification(std::string & rIdentification);
133 bool ParseIdentification(
struct sIdentifier & rIdentification);
134 bool GetErrorList(
CErrorList & rList,
const std::string & rContext);
137 bool ReadAllUnits(std::map<eUnits,U32> & rAllUnits);
138 bool ReadUseCalibration(
bool & rUseCal);
139 bool ReadManufacturingDate(std::string & rDate);
140 bool ReadRotationMatrix(Matrix3f & rMatrix, std::string & rCalibrationDate);
175 bool Connect(
U32 InitialTimeout,
bool Exclusive =
true, std::string *pErrMsg =
nullptr);
276 bool ReadFile(std::string Path, std::string & rContent);
283 bool Initiate(
bool Continuous =
false);
355 bool DefaultParms =
true,
eUnits Units =
kT,
356 tFlux ExpectedField = 0.,
unsigned int NoDigits = 0);
369 bool DefaultParms =
true,
eUnits Units =
kT,
370 tFlux ExpectedField = 0.,
unsigned int NoDigits = 0);
487 bool ReadInformationDates(std::string & rSManufacturingDate, std::time_t & rManufacturingDate, std::string & rSCalibrationDate, std::time_t & rCalibrationDate);
Abstract IEEE488 instrument class: interface definition.
unsigned long long U64
64-bit unsigned integer.
int I32
32-bit signed integer.
unsigned int U32
32-bit unsigned integer.
double F64
64-bit floating-point number.
unsigned short U16
16-bit unsigned integer.
Type definitions for C++ API for Metrolab THM1176/TFM1186.
bool StatusPreset()
Reset OPERation and QUEStionable enable registers.
bool ParmAveragingGet(sAveraging< uParm > &rAvg)
Fetch the currently selected averaging parameter.
bool GetIdentification(std::string &rIdentification)
Fetch the intrument's identification string.
bool ReadFileDirectory(U32 &rUsedBytes, U32 &rAvailableBytes, tFileList &rFileList)
Read the instrument's file directory information.
bool StatusGet(sStatusRegister Reg, U16 &rStatus)
Fetch current value of a single status register.
virtual ~CTHM1176Instrument()
Destructor.
bool ParmUseCalibrationGet(bool &rUseCal)
Fetch parameter whether to return calibrated results.
bool Initiate(bool Continuous=false)
Initiate measurements.
bool GetAllRanges(CFluxList &rRanges)
Fetch all the intrument's ranges.
bool ParmUnitsGet(eUnits &rUnits)
Fetch currently selected measurement units.
bool SetFormat(eCommunicationFormat Format)
Select whether data is returned as text or binary.
bool ParmSleepGet(bool &rSleep)
Fetch parameter whether to sleep after each acquisition.
bool ParmRangeSet(const sRange< uParm > &rRange)
Set measurement range.
bool Abort(void)
Abort a measurement in progress.
bool ReadInformationDates(std::string &rSManufacturingDate, std::time_t &rManufacturingDate, std::string &rSCalibrationDate, std::time_t &rCalibrationDate)
Fetch the intrument's date information.
bool Connect(U32 InitialTimeout, bool Exclusive=true, std::string *pErrMsg=nullptr)
Open the connection to the instrument.
bool Measure(tFlux &rBx, tFlux &rBy, tFlux &rBz, bool DefaultParms=true, eUnits Units=kT, tFlux ExpectedField=0., unsigned int NoDigits=0)
High-level measurement: single measurement.
void Disconnect()
Close the connection to the instrument.
CTHM1176Instrument(RsrcMgrType &rResourceManager, tResourceName ResourceName)
Constructor.
bool ParmTriggerInputSet(const sInputTrigger< uParm > &rInputTrig)
Set trigger input parameters.
bool GetDivisor(eUnits Units, U32 &rDivisor)
Fetch divisor to convert instrument's base units to given units.
bool ParmRangeGet(sRange< uParm > &rRange)
Fetch currently selected measurement range.
bool AbortRead()
Abort a read operation.
bool StatusSetEnableRegister(eStatusRegisterSet Set, U16 DisableMask, U16 EnableMask)
Disable and enable bits in the given enable register.
bool WriteAndRead(const std::string &rWriteStr, CSCPIBuffer &rReadBuffer)
Write an arbitrary command and read the result.
bool ParmUnitsSet(eUnits Units)
Set measurement units.
bool GetImmediateMeasurementPeriod(const sAveraging< uParm > &rAvg, eModelRevision modelRev, F64 &rPeriod)
Compute measurement interval for Immediate Trigger, for a given averaging parameter.
bool ConvertTimestamp(const U64 RawTimestamp, CAbsoluteTimestamp &rTimestamp)
Convert a raw timestamp to UNIX Epoch time and nanoseconds.
bool ReadFile(std::string Path, std::string &rContent)
Read a file from the instrument's file system.
bool ParmAveragingSet(const sAveraging< uParm > &rAvg)
Set the averaging parameter.
bool Reset()
Reset the instrument to power-on configuration.
bool SendBusTrigger()
Send a USB bus trigger.
bool CalibrateZeroOffset(bool ForceCalibration=false)
Perform the Zero Offset calibration procedure.
bool ParmSleepSet(bool Sleep)
Set parameter whether to sleep after each acquisition.
bool ParmTriggerInputGet(sInputTrigger< uParm > &rInputTrig)
Fetch current trigger input parameters.
bool SwitchToDFUMode()
Enter the Device Firmware Upgrade mode.
bool GetAllUnits(CUnitsList &rUnits)
Fetch all units supported by instrument.
bool ParmUseCalibrationSet(bool UseCal)
Set whether to return calibrated results.
bool GetRotationMatrix(Matrix3f &Matrix)
Fetch the intrument's rotation matrix, to correct angular error.
bool RestoreZeroOffset()
Restore the factory values for the Zero Offset.
bool GetFormat(eCommunicationFormat &Format)
Retrieve whether data is returned as text or binary.
const CErrorList & CurrentErrorList()
Fetch current error list.
bool MeasurementsGet(U32 NoMeasurements, CFluxList &rBx, CFluxList &rBy, CFluxList &rBz, eUnits &rUnits, U16 &rTemp, CTimestampList &rTimestampList, sMeasurementConditions *pMeasurementConditions=NULL)
Retrieve measurements: short form.
void ClearErrorList()
Clear the error list.
Timestamp for a measurement.
List of errors returned by the instrument.
List of flux density values.
List of measurement units.
List of SCPI status registers.
List of values returned for several SCPI status registers.
F32 tFlux
Flux density value, as 32-bit floating-point number.
eCommunicationFormat
Enumeration of possible formats for returned data.
std::vector< sFile > tFileList
List of directory entries.
eModelRevision
THM1176 type A or B.
eUnits
Enumeration of possible measurement units.
eStatusRegisterSet
Enumeration of SCPI status register sets.
std::string tResourceName
IEEE488 resource name.
static const I32 THM1176_NO_ANGLE_CORRECTION_CODE
Warning that angle correction was not applied.
std::recursive_mutex CRecursiveMutex
Recursive Mutex.
Specify the measurement data to be returned.
Instrument's identification string - parsed version.
Summary of the parameters used to make a measurement.
Measurement range parameter.
Complete identification of a SCPI status register.