Contact us

Search result for:

Find the right API to design your software

25.11.2022 | MFC2046, PT2026, TFM1186, THM1176

Write your own software!

If you prefer to develop your software instead of using the PT2026 software, MFCToolV10 or EZMag3D, Metrolab provides a set of Application Programming Interfaces to simplify and speed-up your code development.

We are now integrating the MFC2046 and the MFC3045 system cameras in a single “C++ instrument catalog”, offering a standard software layer for both systems and allowing you to incorporate both instruments in your new code seamlessly.

PT2026

LabVIEW API
  • This procedure assumes you have installed National Instruments LabVIEW and NI-VISA. The code is LabVIEW 2015. Any version of NI-VISA should work;
    see http://www.ni.com/product-documentation/53413/en/
  • Version 1.9 of the PT2026 LabVIEW driver requires at least PT2026 ARM firmware version 1.23. To check whether this release is installed, look at the instrument version information in the PT2026 software’s Setup screen; it should read:
    elXXXXXX-arm1.23-dsp2.10-cpld1.9-paXXX-optXXXXXXXX
    where “X” represents irrelevant letters and digits.

 

C++ API

The PT2026 C++ API controls a PT2026 via an IVI-Foundation compatible VISA library. It provides access to the entire functionality of the PT2026 SCPI command set, as documented in chapter 6, “Host Interfaces,” of the “NMR Precision Teslameter PT2026 User’s Manual“.

  •  
  • Examples
    • Follow the source directory C++InstrumentCatalogDistribution_20_10_08/InstrumentDriver/PT2026

MFC2046 &

MFC3045

C++ Instrument Catalog

If you prefer to develop your own MFC software instead of using the MFToolV10, Metrolab provides a “C++ instrument catalog” interface to simplify and speed-up your code development.
Writing a software interface for an instrument using a list of methods is quite often a tedious task; one has to understand the imbrication and the consequences of calling one method before another. To simplify the developer’s life, Metrolab proposes a unified and straightforward way to control the instrument using a data-oriented protocol, occulting most of the instrument’s internal specificities. We call this software layer the “C++ instrument catalog”. Utilizing it, you won’t have to interface with low-level instrument commands set like SCPI. This catalog simplifies software development by offering a way to access the instrument through a set of pre-defined variables. Some have a composite data type associated with a convenient notification-upon-value-change system.

For more details, read the documentation available in the “C++ instrument catalog” package.

We are now integrating the MFC2046 and the MFC3045 system cameras in a single “C++ instrument catalog”, offering a standard software layer for both systems, and allowing you to incorporate both instruments in your new code seamlessly.

Beware, do not use PT2026 SCPI commands when developing a new MFC2046’software. These SCPI commands, as stated in the PT2026 User’s Manual, do not encompass all the aspects required to operate the Magnetic Field Camera system optimally. You must use the “C++ instrument catalog “to develop your MFC2046 software.

If you don’t want to develop your software to control the system camera, but need to export measurement results, instrument, and status information automatically; you may use the plugin mechanism natively available in MFCToolV10 and develop a DLL. Read the MFCToolV10 User’s Manual for more information.

  • Examples, get started
    • Follow the source directory C++InstrumentCatalogDistribution_20_10_08/Example/MFCCatalogExample

 

C++ MFCTool Plugins (Header and DLL)

THM1176 & 

TFM1186

LabVIEW API
  • Documentation:
    • See chapter 5 of “THM1176 User Manual v1_3r1_4
C++ API

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”.

  • Documentation
    • After extracting the above zip file, open the file THM1176InstrumentDriver/doc/html/index.html in a browser.

  • Examples available in the documentation 
C++ Instrument Manager

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

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

  • MTL::CTHM1176InstrumentManager: Public interface
  • MTL::CTHM1176InstrumentController: VISA I/O
  • MTL::CTHM1176InstrumentScanner: Periodically scans for connected instruments

You only have to worry about the public interface; the two other objects are created and destroyed automatically.

  • Documentation
    • After extracting the above zip file, open the file THM1176InstrumentManager/doc/html/index.html in a browser.

  • Examples available in the documentation
C++ EZMag3D Plugins (Trigger, Mapper)

Download and install EZMag3D Software for your OS from the Metrolab download section:

https://old.metrolab.com/resources/downloads/#product_THM1176

Windows, Linux, and macOS available.

  • Expand the Metrolab-EZMag3D-vXXX.src.zip file located in the EZMag3D_XXX application directory, where “XXX” is the EZMag3D version (e.g. “1.1.2″).
  • The source code for the Manual Mapper plugin is located in the directory Metrolab-EZMag3D-vXXX-src/EZMag3D/MapperPlugins/ManualMapperPlugin.
  • The source code for the Manual Trigger plugin is located in the directory Metrolab-EZMag3D-vXXX-src/EZMag3D/TriggerPlugins/ManualTriggerPlugin.
  • Duplicate the appropriate directory, change the file names, update the sub-project file (xxx.pro), and add your new plugin to the top-level project file (Metrolab-EZMag3D-vXXX-src/EZMag3D/EZMag3D.pro).
  • Rebuild the EZMag3D project, to make sure that the project is set up correctly. Do not forget to install the support libraries, as described in Metrolab-EZMag3D-vXXX-src/EZMag3D/README.md.
  • Now add the desired functionality in the code.
  • Before running, copy all plugins to the appropriate EZMag3D plugin sub-directories, located in a subdirectory of the application directory: ezmag3d/ (Windows and Linux) or EZMag3D.app/Contents/PlugIns/ezmag3d/ (macOS). To render this less tedious, you can use the “Projects > Build > Build Steps > Add Build Step” option in Qt Creator to automatically copy all plugins to the plugin directories.
es_ES
Share This