THM1176InstrumentManager  1.0
Qt Object abstraction for Metrolab THM1176
Instrument Manager for Metrolab THM1176/TFM1186.

Introduction

The THM1176 Instrument Manager is a high-level Qt Object abstraction of the Metrolab Three-axis Hall Magnetometer THM1176 / Three-axis Fluxgate Magnetometer TFM1186.

Summary

The THM1176 Instrument Manager consists of three objects, running in different threads:

The user only has to worry about the public interface; the two other objects are created and destroyed automatically.

The Manager relies on Qt for the multi-threading insfrastructure, and on the THM1176 C++ API to communicate with the instrument.

The public interface of the THM1176 Instrument Manager consists of the methods of the MTL::CTHM1176InstrumentManager class. These fall into three categories:

  • Qt slots for a very limited number of actions: start and stop the Manager, and send a trigger.
  • Get and Set methods for Qt properties. Some properties are read-only, and only have a Get method.
  • Qt signals to notify of property changes.

The public interface of the THM1176 Instrument Manager is summarized in the tables below.

Startup and shutdown:

Method type Name Parameters
Slot Start (void)
Slot Stop (void)

Basic instrument control:

Method type Name Parameters
Property: Get, Notify InstrumentList (CResourceList)
Property: Get, Set, Notify CurrentInstrument (tResourceName)
Property: Get, Set, Notify OperatingMode (eTHM1176OperatingMode)
Property: Get, Notify Measurement (CMeasurement)
Property: Get, Notify ErrorList (CErrorList)
Slot SendTrigger (void)

Instrument information and parameter bounds:

Method type Name Parameters
Property: Get, Notify Identification (sIdentifier)
Property: Get, Notify RangeList (CFluxList)
Property: Get, Notify UnitsList (CTHM1176UnitsList)
Property: Get, Notify DivisorList (CDivisorList)
Property: Get, Notify AveragingParmBounds (sAveraging<sBoundedParm>)
Property: Get, Notify TriggerParmBounds (sInputTrigger<sBoundedParm>)
Property: Get, Notify RangeParmBounds (sRange<sBoundedParm>)

Parameters:

Method type Name Parameters
Property: Get, Set, Notify AveragingParms (sAveraging<uParm>)
Property: Get, Set, Notify TriggerParms (sInputTrigger<uParm>)
Property: Get, Set, Notify OutputSelect (sArbitraryMeasurements)
Property: Get, Set, Notify SleepParm (bool)
Property: Get, Set, Notify Units (eTHM1176Units)
Property: Get, Set, Notify RangeParms (sRange<uParm>)
Property: Get, Set, Notify CommFormat (eCommunicationFormat)

Utilities:

Method type Name Parameters
- SetCalibrationOverride (bool)
- GetImmediateMeasurementPeriod (sAveraging<uParm>, F64)
- ConvertTimestamp (U64, CAbsoluteTimestamp)
- ReadInformationDates (QDateTime, QDateTime)

Usage

  1. Create a CTHM1176InstrumentManager object.
  2. Invoke the Start slot to initialize the Instrument Manager.
  3. Wait for the NotifyInstrumentList signal to obtain the list of detected instruments. Alternatively, invoke the GetInstrumentList slot.
  4. Invoke the SetCurrentInstrument slot to connect to the desired instrument. At any time, you can use the GetCurrentInstrument slot or the NotifyCurrentInstrument signal to retrieve the resource name of the current instrument.
  5. Wait for the NotifyOperatingMode signal to wait until the instrument enters the kTHM1176Idle state. You can also invoke the GetOperatingMode at any time to get the operating mode.
  6. Wait for the NotifyIdentification signal to obtain the instrument identifier. You can invoke the GetIdentification slot to obtain the same information.
  7. Wait for the:

    Invoke the corresponding "Get" slots to retrieve the same instrument information at any time.

  8. Invoke the:

    Invoke the corresponding "Get" slots to obtain the current values of any of the above parameters, or wait for the corresponding "Notify" signal to be notified of value changes.

  9. Invoke the SetOperatingMode slot to set the operating mode to kTHM1176Measure, to perform a single measurement, or to kTHM1176MeasureContinuously to perform continuous measurement.
  10. For bus-triggered acquisition, invoke the SendTrigger slot to send the apropriate number of triggers.
  11. Wait for the NotifyMeasurement signal for a new set of measurements to arrive. You can also invoke the GetMeasurement slot to retrieve the last measurement at any time.
  12. The NotifyErrorList signal notifies you of any errors. You can also retrieve the current error list with the GetErrorList slot.
  13. Invoke the SetOperatingMode slot to set the operating mode to kTHM1176CalibrateZeroOffset, to initiate the zero-offset calibration procedure. Invoke the SetOperatingMode slot to set the operating mode to kTHM1176RestoreZeroOffset, to restore the zero-offset to factory settings. In eiter case, wait for the NotifyOperatingMode signal to wait until the instrument reenters the kTHM1176Idle state.
  14. Invoke the SetOperatingMode slot to set the operating mode to kTHM1176NotConnected, to disconnect from the instrument.
  15. Invoke the Stop slot to shut down the Instrument Manager.

Examples

Any of the Instrument Manager tests can serve as example: THM1176IM_Test01_Connect, THM1176IM_Test02_Measure or THM1176IM_Test03_Parameters.