THM1176InstrumentDriver  1.0
C++ API for Metrolab THM1176
C++ API for Metrolab Three-axis Hall Magnetometer THM1176.

Introduction

This C++ Application Programming Interface (API) controls a Metrolab magnetometer in the Three-axis Hall Magnetometer THM1176 family (including the Three-axis Fluxgate Magnetometer TFM1186), either via a USBTMC driver accessed by the VISA library (CVISAInstrument) or via a libusb-based USBTMC instrument driver (CUSBTMCInstrument). It provides access to the entire functionality of the THM1176 SCPI command set, as documented in "Three-Axis Magnetometers: THM1176 and TFM1186 User's Manual".

Using the API

  1. Create and initialize a Resource Manager object (CVISAResourceManager or CUSBTMCResourceManager).
  2. Call the Resource Manager's FindResources method (CVISAResourceManager::FindResources or CUSBTMCResourceManager::FindResources) with the appropriate filter ("USB[0-9]*::0x1BFA::0x0498::[0-9]+::INSTR" for VISA, "7162:1176" for USBTMC).
  3. Create a CTHM1176Instrument object, with the Resource Manager and desired resource as arguments.
  4. Call CTHM1176Instrument::Connect.
  5. Call whatever other methods you want to control the THM1176.
  6. Call CTHM1176Instrument::Disconnect.
  7. Destroy the THM1176 Instrument and Resource Manager objects.

Examples

Any of the test cases will serve as an example. The simplest functional test case is CTHM1176ConnectTest, which simply connects and disconnects from the instrument. When reading the test code, note that the first steps of Using the API are handled by the test setup method.