![]() |
THM1176InstrumentManager 1.2
Qt Object abstraction for Metrolab THM1176
|
THM1176 instrument class. More...
#include <THM1176.h>


Public Member Functions | |
| CTHM1176Instrument (RsrcMgrType &rResourceManager, tResourceName ResourceName) | |
| Constructor. | |
| virtual | ~CTHM1176Instrument () |
| Destructor. | |
| const CErrorList & | CurrentErrorList () |
| Fetch current error list. | |
| void | ClearErrorList () |
| Clear the error list. | |
| bool | Connect (U32 InitialTimeout, bool Exclusive=true, std::string *pErrMsg=nullptr) |
| Open the connection to the instrument. | |
| void | Disconnect () |
| Close the connection to the instrument. | |
| bool | ParmAveragingSet (const sAveraging< uParm > &rAvg) |
| Set the averaging parameter. | |
| bool | ParmAveragingGet (sAveraging< uParm > &rAvg) |
| Fetch the currently selected averaging parameter. | |
| bool | ParmAveragingGet (sAveraging< sBoundedParm > &rAvg) |
| Fetch current averaging parameter, incl. min/max/default. | |
| bool | ParmSleepSet (bool Sleep) |
| Set parameter whether to sleep after each acquisition. | |
| bool | ParmSleepGet (bool &rSleep) |
| Fetch parameter whether to sleep after each acquisition. | |
| bool | ParmTriggerInputSet (const sInputTrigger< uParm > &rInputTrig) |
| Set trigger input parameters. | |
| bool | ParmTriggerInputGet (sInputTrigger< uParm > &rInputTrig) |
| Fetch current trigger input parameters. | |
| bool | ParmTriggerInputGet (sInputTrigger< sBoundedParm > &rInputTrig) |
| Fetch current trigger input parameters, incl. min/max/default. | |
| bool | ParmUnitsSet (eUnits Units) |
| Set measurement units. | |
| bool | ParmUnitsGet (eUnits &rUnits) |
| Fetch currently selected measurement units. | |
| bool | ParmUseCalibrationSet (bool UseCal) |
| Set whether to return calibrated results. | |
| bool | ParmUseCalibrationGet (bool &rUseCal) |
| Fetch parameter whether to return calibrated results. | |
| bool | ParmRangeSet (const sRange< uParm > &rRange) |
| Set measurement range. | |
| bool | ParmRangeGet (sRange< uParm > &rRange) |
| Fetch currently selected measurement range. | |
| bool | ParmRangeGet (sRange< sBoundedParm > &rRange) |
| Fetch currently selected measurement range, incl. min/max/default. | |
| bool | ReadFileDirectory (U32 &rUsedBytes, U32 &rAvailableBytes, tFileList &rFileList) |
| Read the instrument's file directory information. | |
| bool | ReadFile (std::string Path, std::string &rContent) |
| Read a file from the instrument's file system. | |
| bool | Initiate (bool Continuous=false) |
| Initiate measurements. | |
| bool | Abort (void) |
| Abort a measurement in progress. | |
| bool | SendBusTrigger () |
| Send a USB bus trigger. | |
| bool | MeasurementsGet (U32 NoMeasurements, CFluxList &rBx, CFluxList &rBy, CFluxList &rBz, eUnits &rUnits, U16 &rTemp, CTimestampList &rTimestampList, sMeasurementConditions *pMeasurementConditions=NULL) |
| Retrieve measurements: short form. | |
| bool | MeasurementsGet (sArbitraryMeasurements ArbSelect, CFluxList &rBx, CFluxList &rBy, CFluxList &rBz, eUnits &rUnits, U16 &rTemp, CTimestampList &rTimestampList, sMeasurementConditions *pMeasurementConditions=NULL) |
| Retrieve measurements: long form. | |
| bool | SetFormat (eCommunicationFormat Format) |
| Select whether data is returned as text or binary. | |
| bool | GetFormat (eCommunicationFormat &Format) |
| Retrieve whether data is returned as text or binary. | |
| 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. | |
| bool | Measure (CFluxList &rBx, CFluxList &rBy, CFluxList &rBz, unsigned int NoMeasurements=1, bool DefaultParms=true, eUnits Units=kT, tFlux ExpectedField=0., unsigned int NoDigits=0) |
| High-level measurement: multiple measurements. | |
| bool | StatusPreset () |
| Reset OPERation and QUEStionable enable registers. | |
| bool | StatusGet (sStatusRegister Reg, U16 &rStatus) |
| Fetch current value of a single status register. | |
| bool | StatusGet (RegisterList Regs, StatusValues &rStatus) |
| Fetch current values of a list of status registers. | |
| 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 | GetIdentification (std::string &rIdentification) |
| Fetch the intrument's identification string. | |
| bool | GetIdentification (sIdentifier &rIdentification) |
| Fetch the intrument's parsed identification string. | |
| bool | GetAllRanges (CFluxList &rRanges) |
| Fetch all the intrument's ranges. | |
| bool | ConvertTimestamp (const U64 RawTimestamp, CAbsoluteTimestamp &rTimestamp) |
| Convert a raw timestamp to UNIX Epoch time and nanoseconds. | |
| bool | GetAllUnits (CUnitsList &rUnits) |
| Fetch all units supported by instrument. | |
| bool | GetDivisor (eUnits Units, U32 &rDivisor) |
| Fetch divisor to convert instrument's base units to given units. | |
| bool | GetRotationMatrix (Matrix3f &Matrix) |
| Fetch the intrument's rotation matrix, to correct angular error. | |
| bool | GetImmediateMeasurementPeriod (const sAveraging< uParm > &rAvg, eModelRevision modelRev, F64 &rPeriod) |
| Compute measurement interval for Immediate Trigger, for a given averaging parameter. | |
| bool | CalibrateZeroOffset (bool ForceCalibration=false) |
| Perform the Zero Offset calibration procedure. | |
| bool | RestoreZeroOffset () |
| Restore the factory values for the Zero Offset. | |
| bool | Reset () |
| Reset the instrument to power-on configuration. | |
| bool | SwitchToDFUMode () |
| Enter the Device Firmware Upgrade mode. | |
| bool | ReadInformationDates (std::string &rSManufacturingDate, std::time_t &rManufacturingDate, std::string &rSCalibrationDate, std::time_t &rCalibrationDate) |
| Fetch the intrument's date information. | |
| bool | AbortRead () |
| Abort a read operation. | |
THM1176 instrument class.
Abstraction of a Metrolab THM1176 Three-axis Hall Magnetometer or TFM1186 Three-axis Fluxgate Magnetometer.
| InstrType | Instrument class to use for communication, e.g. CVISAInstrument or CUSBTMCInstrument |
| RsrcMgrType | Associated Resource Manager, e.g. CVISAResourceManager or CUSBTMCResourceManager |
| CTHM1176Instrument::CTHM1176Instrument | ( | RsrcMgrType & | rResourceManager, |
| tResourceName | ResourceName ) |
Constructor.
| [in] | rResourceManager | Resource Manager. |
| [in] | ResourceName | Resource name. |
Definition at line 828 of file THM1176.cpp.
Destructor.
Definition at line 835 of file THM1176.cpp.
Abort a measurement in progress.
Definition at line 1479 of file THM1176.cpp.
Abort a read operation.
Note: This operation is nonoperational for instruments with firmware version 3.1 or below. It will cause your instrument to lock up.
Definition at line 2316 of file THM1176.cpp.
| bool CTHM1176Instrument::CalibrateZeroOffset | ( | bool | ForceCalibration = false | ) |
Perform the Zero Offset calibration procedure.
| [in] | ForceCalibration | Override warnings about models that should not be calibrated |
Notes:
Definition at line 2107 of file THM1176.cpp.
Clear the error list.
Definition at line 854 of file THM1176.cpp.
| bool CTHM1176Instrument::Connect | ( | U32 | InitialTimeout, |
| bool | Exclusive = true, | ||
| std::string * | pErrMsg = nullptr ) |
Open the connection to the instrument.
| [in] | InitialTimeout | Timeout on exclusive lock request. |
| [in] | Exclusive | Whether or not to request an exclusive lock. |
| [in] | pErrMsg | Optional error message. |
Definition at line 866 of file THM1176.cpp.
|
inline |
| const CErrorList & CTHM1176Instrument::CurrentErrorList | ( | ) |
Close the connection to the instrument.
Definition at line 933 of file THM1176.cpp.
| bool CTHM1176Instrument::GetAllRanges | ( | CFluxList & | rRanges | ) |
Fetch all the intrument's ranges.
| [out] | rRanges | List of ranges. |
Definition at line 2030 of file THM1176.cpp.
| bool CTHM1176Instrument::GetAllUnits | ( | CUnitsList & | rUnits | ) |
Fetch all units supported by instrument.
| [out] | rUnits | List of units. |
Definition at line 2042 of file THM1176.cpp.
Fetch divisor to convert instrument's base units to given units.
| [in] | Units | Units for which we want the divisor. |
| [out] | rDivisor | The returned divisor; zero if error. |
Definition at line 2054 of file THM1176.cpp.
| bool CTHM1176Instrument::GetFormat | ( | eCommunicationFormat & | Format | ) |
Retrieve whether data is returned as text or binary.
| [out] | Format | Text or binary. |
Definition at line 1736 of file THM1176.cpp.
| bool CTHM1176Instrument::GetIdentification | ( | sIdentifier & | rIdentification | ) |
Fetch the intrument's parsed identification string.
| [out] | rIdentification | Returned identification string. |
Definition at line 2020 of file THM1176.cpp.
| bool CTHM1176Instrument::GetIdentification | ( | std::string & | rIdentification | ) |
Fetch the intrument's identification string.
| [out] | rIdentification | Returned identification string. |
Definition at line 2010 of file THM1176.cpp.
| bool CTHM1176Instrument::GetImmediateMeasurementPeriod | ( | const sAveraging< uParm > & | rAvg, |
| eModelRevision | modelRev, | ||
| F64 & | rPeriod ) |
Compute measurement interval for Immediate Trigger, for a given averaging parameter.
| [in] | rAvg | Averaging setting. |
| [in] | modelRev | THM1176 Model: kA for THM1176-A. kB for THM1176-B. |
| [out] | rPeriod | Corresponding measurement period, in s. |
Definition at line 2081 of file THM1176.cpp.
| bool CTHM1176Instrument::GetRotationMatrix | ( | Matrix3f & | Matrix | ) |
Fetch the intrument's rotation matrix, to correct angular error.
| [out] | Matrix | The returned rotation matrix. |
Definition at line 2074 of file THM1176.cpp.
| bool CTHM1176Instrument::Initiate | ( | bool | Continuous = false | ) |
Initiate measurements.
| [in] | Continuous | Whether to measure continuously. |
Definition at line 1463 of file THM1176.cpp.
| bool CTHM1176Instrument::Measure | ( | CFluxList & | rBx, |
| CFluxList & | rBy, | ||
| CFluxList & | rBz, | ||
| unsigned int | NoMeasurements = 1, | ||
| bool | DefaultParms = true, | ||
| eUnits | Units = kT, | ||
| tFlux | ExpectedField = 0., | ||
| unsigned int | NoDigits = 0 ) |
High-level measurement: multiple measurements.
| [out] | rBx | Measured Bx values. |
| [out] | rBy | Measured By values. |
| [out] | rBz | Measured Bz values. |
| [in] | NoMeasurements | Number of measurements. |
| [in] | DefaultParms | Use default or currently selected parameters. |
| [in] | Units | Measurement units. |
| [in] | ExpectedField | Select range for this expected field. |
| [in] | NoDigits | Number of digits to return. |
Definition at line 1831 of file THM1176.cpp.
| bool CTHM1176Instrument::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.
| [out] | rBx | Measured Bx value. |
| [out] | rBy | Measured By value. |
| [out] | rBz | Measured Bz value. |
| [in] | DefaultParms | Use default or currently selected parameters. |
| [in] | Units | Measurement units. |
| [in] | ExpectedField | Select range for this expected field. |
| [in] | NoDigits | Number of digits to return. |
Definition at line 1773 of file THM1176.cpp.
| bool CTHM1176Instrument::MeasurementsGet | ( | sArbitraryMeasurements | ArbSelect, |
| CFluxList & | rBx, | ||
| CFluxList & | rBy, | ||
| CFluxList & | rBz, | ||
| eUnits & | rUnits, | ||
| U16 & | rTemp, | ||
| CTimestampList & | rTimestampList, | ||
| sMeasurementConditions * | pMeasurementConditions = NULL ) |
Retrieve measurements: long form.
| [in] | ArbSelect | Select which data to return, and how much. |
| [out] | rBx | Measured Bx values; empty if not selected. |
| [out] | rBy | Measured By values; empty if not selected. |
| [out] | rBz | Measured Bz values; empty if not selected. |
| [out] | rUnits | Units in which data is returned. |
| [out] | rTemp | Returned temperature; zero if not selected. |
| [out] | rTimestampList | Timestamp for each measurement; empty if not selected. |
| [out] | pMeasurementConditions | Averaging, trigger and calibration parameters. |
Note: If pMeasurementConditions is NULL (the default), the measurement parameters are not returned.
Definition at line 1527 of file THM1176.cpp.
| bool CTHM1176Instrument::MeasurementsGet | ( | U32 | NoMeasurements, |
| CFluxList & | rBx, | ||
| CFluxList & | rBy, | ||
| CFluxList & | rBz, | ||
| eUnits & | rUnits, | ||
| U16 & | rTemp, | ||
| CTimestampList & | rTimestampList, | ||
| sMeasurementConditions * | pMeasurementConditions = NULL ) |
Retrieve measurements: short form.
| [in] | NoMeasurements | Number of measurements. |
| [out] | rBx | Measured Bx values. |
| [out] | rBy | Measured By values. |
| [out] | rBz | Measured Bz values. |
| [out] | rUnits | Units in which data is returned. |
| [out] | rTemp | Returned temperature. |
| [out] | rTimestampList | Timestamp for each measurement. |
| [out] | pMeasurementConditions | Averaging, trigger and calibration parameters. |
Note: If pMeasurementConditions is NULL (the default), the measurement parameters are not returned.
Definition at line 1507 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmAveragingGet | ( | sAveraging< sBoundedParm > & | rAvg | ) |
Fetch current averaging parameter, incl. min/max/default.
| [out] | rAvg | Averaging parameters, incl. min/max/default. |
Definition at line 980 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmAveragingGet | ( | sAveraging< uParm > & | rAvg | ) |
Fetch the currently selected averaging parameter.
| [out] | rAvg | Current averaging parameters. |
Definition at line 958 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmAveragingSet | ( | const sAveraging< uParm > & | rAvg | ) |
Set the averaging parameter.
| [in] | rAvg | Desired averaging setting. |
Definition at line 946 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmRangeGet | ( | sRange< sBoundedParm > & | rRange | ) |
Fetch currently selected measurement range, incl. min/max/default.
| [out] | rRange | Measurement range, incl. min/max/default. |
Definition at line 1301 of file THM1176.cpp.
Fetch currently selected measurement range.
| [out] | rRange | Measurement range. |
Definition at line 1263 of file THM1176.cpp.
Set measurement range.
| [in] | rRange | Desired measurement range. |
Definition at line 1237 of file THM1176.cpp.
Fetch parameter whether to sleep after each acquisition.
| [out] | rSleep | Whether or not to sleep. |
Definition at line 1020 of file THM1176.cpp.
Set parameter whether to sleep after each acquisition.
| [in] | Sleep | Whether or not to sleep. |
Definition at line 1010 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmTriggerInputGet | ( | sInputTrigger< sBoundedParm > & | rInputTrig | ) |
Fetch current trigger input parameters, incl. min/max/default.
| [out] | rInputTrig | Trigger input parameters, incl. min/max/default. |
Definition at line 1113 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmTriggerInputGet | ( | sInputTrigger< uParm > & | rInputTrig | ) |
Fetch current trigger input parameters.
| [out] | rInputTrig | Trigger input parameters. |
Definition at line 1068 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmTriggerInputSet | ( | const sInputTrigger< uParm > & | rInputTrig | ) |
Set trigger input parameters.
| [in] | rInputTrig | Trigger input parameters. |
Definition at line 1030 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmUnitsGet | ( | eUnits & | rUnits | ) |
Fetch currently selected measurement units.
| [out] | rUnits | Measurement units. |
Definition at line 1186 of file THM1176.cpp.
Set measurement units.
| [in] | Units | Measurement units. |
Definition at line 1164 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmUseCalibrationGet | ( | bool & | rUseCal | ) |
Fetch parameter whether to return calibrated results.
| [out] | rUseCal | Whether to return calibrated results. |
Definition at line 1227 of file THM1176.cpp.
| bool CTHM1176Instrument::ParmUseCalibrationSet | ( | bool | UseCal | ) |
Set whether to return calibrated results.
| [in] | UseCal | Whether to return calibrated results. |
Definition at line 1210 of file THM1176.cpp.
| bool CTHM1176Instrument::ReadFile | ( | std::string | Path, |
| std::string & | rContent ) |
Read a file from the instrument's file system.
| [in] | Path | Path of file to be read. |
| [out] | rContent | Contents of file. |
Definition at line 1419 of file THM1176.cpp.
| bool CTHM1176Instrument::ReadFileDirectory | ( | U32 & | rUsedBytes, |
| U32 & | rAvailableBytes, | ||
| tFileList & | rFileList ) |
Read the instrument's file directory information.
| [out] | rUsedBytes | Number of bytes occupied by files. |
| [out] | rAvailableBytes | Number of bytes still available. |
| [out] | rFileList | List of files. |
Definition at line 1354 of file THM1176.cpp.
| bool CTHM1176Instrument::ReadInformationDates | ( | std::string & | rSManufacturingDate, |
| std::time_t & | rManufacturingDate, | ||
| std::string & | rSCalibrationDate, | ||
| std::time_t & | rCalibrationDate ) |
Fetch the intrument's date information.
| [out] | rSManufacturingDate | Manufacturing date as string. |
| [out] | rManufacturingDate | Manufacturing date as time structure. |
| [out] | rSCalibrationDate | Calibration date as string. |
| [out] | rCalibrationDate | Calibration date as time structure. |
Definition at line 2261 of file THM1176.cpp.
Reset the instrument to power-on configuration.
Definition at line 2198 of file THM1176.cpp.
Restore the factory values for the Zero Offset.
Definition at line 2167 of file THM1176.cpp.
| bool CTHM1176Instrument::SetFormat | ( | eCommunicationFormat | Format | ) |
Select whether data is returned as text or binary.
| [in] | Format | Select text or binary. |
Definition at line 1699 of file THM1176.cpp.
| bool CTHM1176Instrument::StatusGet | ( | RegisterList | Regs, |
| StatusValues & | rStatus ) |
Fetch current values of a list of status registers.
| [in] | Regs | Registers to fetch. |
| [out] | rStatus | Register values; zero if error. |
Definition at line 1929 of file THM1176.cpp.
| bool CTHM1176Instrument::StatusGet | ( | sStatusRegister | Reg, |
| U16 & | rStatus ) |
Fetch current value of a single status register.
| [in] | Reg | Register to fetch. |
| [out] | rStatus | Register value; zero if error. |
Definition at line 1899 of file THM1176.cpp.
Reset OPERation and QUEStionable enable registers.
Definition at line 1890 of file THM1176.cpp.
| bool CTHM1176Instrument::StatusSetEnableRegister | ( | eStatusRegisterSet | Set, |
| U16 | DisableMask, | ||
| U16 | EnableMask ) |
Disable and enable bits in the given enable register.
| [in] | Set | Register set whose enable register is to be modified. |
| [in] | DisableMask | Bits to be disabled. |
| [in] | EnableMask | Bits to be enabled. |
Note: The DisableMask is applied before the EnableMask, so the EnableMask takes precedence.
Definition at line 1974 of file THM1176.cpp.
Enter the Device Firmware Upgrade mode.
Note: This function is intended for use by the manufacturer only. It can cause your instrument to become nonoperational.
Definition at line 2251 of file THM1176.cpp.
| bool CTHM1176Instrument::WriteAndRead | ( | const std::string & | rWriteStr, |
| CSCPIBuffer & | rReadBuffer ) |
Write an arbitrary command and read the result.
| [in] | rWriteStr | Command to write. |
| [out] | rReadBuffer | Returned result. |
Definition at line 324 of file THM1176.cpp.