| THM1176InstrumentDriver 1.2 C++ API for Metrolab THM1176

Loading...
Searching...
No Matches
THM1176Types.h
Go to the documentation of this file.
1// Copyright (c) 2025 Metrolab Technology S.A., Geneva, Switzerland (www.metrolab.com)
2// See the included file LICENSE.txt for the licensing conditions.
3
7
8#pragma once
9
10// Standard includes
11#include <string>
12#include <vector>
13#include <cmath>
14#include <ctime>
15
16// Personal includes
17#include "OSDefines.h"
18#include "IEEE488InstrumentTypes.h"
19
20 namespace MTL
21{
22 namespace Instrument
23{
24 namespace THM1176Types
25{
26
27//----------------------------------------------------------------------//
28// Basic Types //
29//----------------------------------------------------------------------//
30 typedef F32 tFlux;
31
32//----------------------------------------------------------------------//
33// Status //
34//----------------------------------------------------------------------//
36 enum eStatusRegisterSet
37{
38 kStatusByte = 0,
39 kStandardEventStatusRegister,
40 kStatusQuestionableStatusRegister,
41 kStatusOperationStatusRegister
42};
43
44 enum eStatusRegisterType
45{
46 kStatusEvent = 0,
47 kStatusCondition,
48 kStatusEnable
49};
50
51 struct sStatusRegister
52{
53 eStatusRegisterSet Set = kStatusByte;
54 eStatusRegisterType Type = kStatusEvent;
55
56 public:
60 sStatusRegister(eStatusRegisterSet S = { }, eStatusRegisterType T = { })
61 : Set(S), Type(T)
62 { }
63};
64
65 class RegisterList : public std::vector<sStatusRegister>
66{
67};
68
75 class StatusValues : public std::vector<U16>
76{
77};
78
80 union uStatusByte
81{
83 U16 RawSTB = 0;
84
86 struct sStatusByte
87 {
88 // Contains a 1-byte status summary. The THM1176 uses the following bits:
89 U8 NA0_1 : 2;
90 U8 EAV : 1;
91 U8 QSB : 1;
92 U8 MAV : 1;
93 U8 ESB : 1;
94 U8 RQS : 1;
95 U8 OSB : 1;
96 } StatusByte;
97};
98
99 union uStandardEvent
100{
102 U16 RawSE = 0;
103
105 struct sStandardEvent
106 {
107 // Latches certain standardized events. The THM1176 uses the following bits:
108 U8 OperationComplete : 1;
109 U8 NA1 : 1;
110 U8 QueryError : 1;
111 U8 DeviceDependentError : 1;
112 U8 ExecutionError : 1;
113 U8 CommandError : 1;
114 U8 NA6 : 1;
115 U8 PowerOn : 1;
116 } StandardEvent;
117};
118
119 union uOPERation
120{
122 U16 RawOPER = 0;
123
125 struct sOPERation
126 {
127 // Captures conditions which are part of the instrument's normal operation. The THM1176 uses the following bits:
128 U16 CALibrating : 1;
129 U16 NA1 : 1;
130 U16 RANGing : 1;
131 U16 NA3 : 1;
132 U16 MEASuring : 1;
133 U16 WaitingForTRIGger : 1;
134 U16 NA6_15 : 10;
135 } OPERation;
136};
137
138 union uQUEStionable
139{
141 U16 RawQUES = 0;
142
144 struct sQUEStionable
145 {
146 // Indicates conditions that may reduce the quality of the measurement. The THM1176 sets the following bits:
147 U16 NA0_4 : 5;
148 U16 Frequency : 1;
149 U16 NA6_8 : 3;
150 U16 Overrange : 1;
151 U16 NA10_15 : 6;
152 } QUEStionable;
153};
154
155std::ostream & operator<<(std::ostream & Stream, const eStatusRegisterSet & RegSet);
156std::ostream & operator<<(std::ostream & Stream, const eStatusRegisterType & RegType);
157std::ostream & operator<<(std::ostream & Stream, const sStatusRegister & RegDef);
158std::ostream & operator<<(std::ostream & Stream, const RegisterList & RegList);
159std::ostream & operator<<(std::ostream & Stream, const StatusValues & StatusList);
160std::ostream & operator<<(std::ostream & Stream, const uStatusByte & StatusByte);
161std::ostream & operator<<(std::ostream & Stream, const uStandardEvent & StdEventReg);
162std::ostream & operator<<(std::ostream & Stream, const uOPERation & OperReg);
163std::ostream & operator<<(std::ostream & Stream, const uQUEStionable & QuestReg);
164
165//----------------------------------------------------------------------//
166// Flux //
167//----------------------------------------------------------------------//
169 class CFluxList : public std::vector<tFlux>
170{
171};
172std::ostream & operator<<(std::ostream & Stream, const CFluxList & FluxList);
173
174//----------------------------------------------------------------------//
175// Units //
176//----------------------------------------------------------------------//
181 enum eUnits
182{
183 kT,
184 kmT,
185 kuT,
186 knT,
187 kGauss,
188 kkGauss,
189 kmGauss,
190 kMHzp
191};
192
193 class CUnitsList : public std::vector<eUnits>
194{
195};
196
202 class CDivisorList : public std::vector<U32>
203{
204};
205std::ostream & operator<<(std::ostream & Stream, const eUnits & Units);
206std::ostream & operator<<(std::ostream & Stream, const CUnitsList & UnitsList);
207std::ostream & operator<<(std::ostream & Stream, const CDivisorList & DivisorList);
208
209//----------------------------------------------------------------------//
210// Errors //
211//----------------------------------------------------------------------//
213 struct sError
214{
215 I32 Code;
216 std::string Description;
217 std::string Context;
218
219 public:
224 sError(I32 Code = 0, std::string Description = "", std::string Context = "")
225 : Code(Code), Description(Description), Context(Context)
226 { }
227 bool operator==(sError other) const;
228 bool operator!=(sError other) const;
229};
230
231 class CErrorList : public std::vector<sError>
232{
233};
234std::ostream & operator<<(std::ostream & Stream, const sError & Error);
235std::ostream & operator<<(std::ostream & Stream, const CErrorList & ErrorList);
236
237//----------------------------------------------------------------------//
238// Parameters //
239//----------------------------------------------------------------------//
240//------------------------------------------//
241// Generic
244 template <class DataType>
245 struct sBoundedParm
246{
247 DataType Val{};
248 DataType Min{};
249 DataType Max{};
250 DataType Def{};
251
252 public:
258 sBoundedParm(DataType Val = 0, DataType Min = 0, DataType Max = 0, DataType Def = 0)
259 : Val(Val), Min(Min), Max(Max), Def(Def)
260 { }
261 void clear(void)
262 {
263 Val = { };
264 Min = { };
265 Max = { };
266 Def = { };
267 }
268 bool operator==(sBoundedParm other) const
269 {
270 return (
271 Val == other.Val &&
272 Min == other.Min &&
273 Max == other.Max &&
274 Def == other.Def
275 );
276 }
277 bool operator!=(sBoundedParm other) const
278 {
279 return (!operator==(other));
280 }
281 sBoundedParm & operator=(const DataType & scalar)
282 {
283 Val = scalar;
284 Min = scalar;
285 Max = scalar;
286 Def = scalar;
287 return *this;
288 }
289};
290
293 template <class DataType>
294 using uParm = DataType;
295
302 template <template<class> class ParmType>
303 struct sExample
304{
305 bool ExampleState;
306 ParmType<F64> ExampleF64;
307 ParmType<F32> ExampleF32;
308};
309
310//------------------------------------------//
311// Version
313 struct sVersion
314{
315 U8 Major = 0;
316 U8 Minor = 0;
317 std::string Name = "";
318
319 public:
323 sVersion(U8 Maj = 0, U8 Min = 0)
324 : Major(Maj), Minor(Min)
325 { }
326 void clear(void);
327 bool operator==(sVersion other) const;
328 bool operator!=(sVersion other) const;
329};
330std::ostream & operator<<(std::ostream & Stream, const sVersion & Version);
331
332//------------------------------------------//
333// Instrument enum model
335 enum class eInstrModel {
336 kTHM1176LF,
337 kTHM1176MF,
338 kTHM1176HF,
339 kTHM1176HFC,
340 kTFM1186,
341 kUnknown
342};
343
344//------------------------------------------//
345// Thm Revision
347 enum eModelRevision { kA, kB };
348
349//------------------------------------------//
350// Identifier
352 struct sIdentifier
353{
354 std::string Manufacturer;
355 std::string Model;
356 U32 SerialNumber = 0;
357 struct sVersion ElectronicsVersion;
358 struct sVersion ProbeVersion;
359 struct sVersion FirmwareVersion;
360 enum eModelRevision ModelRevision;
361 enum eInstrModel InstrModel;
362
363 public:
373 sIdentifier(std::string Mfr = "", std::string Mdl = "", U32 SN = 0, struct sVersion EVsn = { }, struct sVersion PVsn = { }, struct sVersion FVsn = { }, eModelRevision ThmRev = kA, eInstrModel InstrMdl= eInstrModel::kUnknown)
374 : Manufacturer(Mfr), Model(Mdl), SerialNumber(SN), ElectronicsVersion(EVsn), ProbeVersion(PVsn), FirmwareVersion(FVsn), ModelRevision(ThmRev), InstrModel(InstrMdl)
375 { }
376 void clear(void);
377 bool operator==(sIdentifier other) const;
378 bool operator!=(sIdentifier other) const;
379};
380std::ostream & operator<<(std::ostream & Stream, const sIdentifier & ID);
381
382//------------------------------------------//
383// Averaging
386 template <template<class> class ParmType>
387 struct sAveraging
388{
389 ParmType<U16> NoPoints{};
390
391 public:
394 sAveraging(ParmType<U16> NPts = { })
395 : NoPoints(NPts)
396 { }
397 void clear(void)
398 {
399 NoPoints = { };
400 }
401 bool operator==(sAveraging other) const
402 {
403 return (NoPoints == other.NoPoints);
404 }
405 bool operator!=(sAveraging other) const
406 {
407 return (!operator==(other));
408 }
409};
410std::ostream & operator<<(std::ostream & Stream, const sAveraging<uParm> & AvgParm);
411std::ostream & operator<<(std::ostream & Stream, const sAveraging<sBoundedParm> & AvgParm);
412
413//------------------------------------------//
414// Input Trigger
416 enum eInputTriggerSource
417{
418 kInputTrigSrcImmediate,
419 kInputTrigSrcTimer,
420 kInputTrigSrcBus
421};
422
424 template <template<class> class ParmType>
425 struct sInputTrigger
426{
427 eInputTriggerSource Source{ };
428 ParmType<F64> Period_s{ };
429 ParmType<U16> Count{ };
430
431 public:
436 sInputTrigger(eInputTriggerSource Src = { }, ParmType<F64> Per = { }, ParmType<U16> Cnt = { })
437 : Source(Src), Period_s(Per), Count(Cnt)
438 { }
439 void clear(void)
440 {
441 Source = { };
442 Period_s = { };
443 Count = { };
444 }
445 bool operator==(sInputTrigger other) const
446 {
447 return (
448 Source == other.Source &&
449 Period_s == other.Period_s &&
450 Count == other.Count
451 );
452 }
453 bool operator!=(sInputTrigger other) const
454 {
455 return (!operator==(other));
456 }
457};
458std::ostream & operator<<(std::ostream & Stream, const eInputTriggerSource & TrgSrc);
459std::ostream & operator<<(std::ostream & Stream, const sInputTrigger<uParm> & TrigParm);
460std::ostream & operator<<(std::ostream & Stream, const sInputTrigger<sBoundedParm> & TrigParm);
461
462//------------------------------------------//
463// Format
465 enum eCommunicationFormat
466{
467 kComFormatAscii,
468 kComFormatInteger,
469 kComFormatPacked2Byte,
470 kComFormatPacked1Byte
471};
472std::ostream & operator<<(std::ostream & Stream, const eCommunicationFormat & CommFormat);
473
474//------------------------------------------//
475// Range
477 template <template<class> class ParmType>
478 struct sRange
479{
480 bool Auto{ };
481 ParmType<tFlux> Range{ };
482
483 public:
487 sRange(bool A = { }, ParmType<tFlux> R = { })
488 : Auto(A), Range(R)
489 { }
490 void clear(void)
491 {
492 Auto = { };
493 Range = { };
494 }
495 bool operator==(sRange other) const
496 {
497 return (
498 Auto == other.Auto &&
499 Range == other.Range
500 );
501 }
502 bool operator!=(sRange other) const
503 {
504 return (!operator==(other));
505 }
506};
507std::ostream & operator<<(std::ostream & Stream, const sRange<uParm> & RangeParm);
508std::ostream & operator<<(std::ostream & Stream, const sRange<sBoundedParm> & RangeParm);
509
510//------------------------------------------//
511// Files
513 struct sFile
514{
515 size_t Size = 0;
516 std::string Path;
517 std::string Type;
518
519 public:
524 sFile(size_t S = 0, std::string P = "", std::string T = "")
525 : Size(S), Path(P), Type(T)
526 { }
527 void clear();
528 bool operator==(sFile other) const;
529 bool operator!=(sFile other) const;
530};
531
532 typedef std::vector<sFile> tFileList;
533
534std::ostream & operator<<(std::ostream & Stream, const sFile & FileInfo);
535std::ostream & operator<<(std::ostream & Stream, const tFileList & FileList);
536
537//----------------------------------------------------------------------//
538// Time stamp //
539//----------------------------------------------------------------------//
550 class CAbsoluteTimestamp
551{
552 private:
553 std::time_t s = 0;
554 U64 ns = 0;
555
556 public:
557 static const U64 NS_PER_SEC = 1000000000;
561 CAbsoluteTimestamp(std::time_t Seconds = 0, U64 Nanoseconds = 0);
562 CAbsoluteTimestamp & operator= (const CAbsoluteTimestamp & Value);
563 bool operator==(CAbsoluteTimestamp other);
564 bool operator!=(CAbsoluteTimestamp other);
565 std::time_t seconds(void) const;
566 U64 nanoseconds(void) const;
567 void clear(void);
568};
569
570 CAbsoluteTimestamp operator+ (CAbsoluteTimestamp a, CAbsoluteTimestamp b);
571 CAbsoluteTimestamp operator- (CAbsoluteTimestamp a, CAbsoluteTimestamp b);
572std::ostream & operator<<(std::ostream & Stream, const CAbsoluteTimestamp & Timestamp);
573
575 class CTimestampList : public std::vector<U64>
576{
577 public:
584 bool GetEstimatedPeriod(F64 & Period);
585};
586std::ostream & operator<<(std::ostream & Stream, const CTimestampList & TimestampList);
587
588//----------------------------------------------------------------------//
589// Measurements //
590//----------------------------------------------------------------------//
592 struct sArbitraryMeasurements
593{
594 bool Bx = false;
595 bool By = false;
596 bool Bz = false;
597 bool Temperature = false;
598 bool Timestamp = false;
599 U32 NoMeasurements = 0;
600
601 public:
609 sArbitraryMeasurements(bool Bx = false, bool By = false, bool Bz = false, bool Temp = false, bool Time = false, U32 NMeas = 0)
610 : Bx(Bx), By(By), Bz(Bz), Temperature(Temp), Timestamp(Time), NoMeasurements(NMeas)
611 { }
612 void clear();
613 bool operator==(sArbitraryMeasurements other) const;
614 bool operator!=(sArbitraryMeasurements other) const;
615};
616
618 struct sMeasurementConditions
619{
620 sAveraging<uParm> AveragingParms;
621 sInputTrigger<uParm> TriggerParms;
622 bool UseCalibration = false;
623 tFlux Range;
624
625 public:
631 sMeasurementConditions(sAveraging<uParm> AvgParms = { }, sInputTrigger<uParm> TrigParms= { }, bool UseCal = false, tFlux RangeIn = 0.)
632 : AveragingParms(AvgParms), TriggerParms(TrigParms), UseCalibration(UseCal), Range(RangeIn)
633 { }
634 void clear();
635 bool operator==(sMeasurementConditions other) const;
636 bool operator!=(sMeasurementConditions other) const;
637};
638
639std::ostream & operator<<(std::ostream & Stream, const sArbitraryMeasurements & MeasSpec);
640std::ostream & operator<<(std::ostream & Stream, const sMeasurementConditions & MeasCond);
641
642} // namespace THM1176Types
643} // namespace Instrument
644} // namespace MTL
IEEE488InstrumentTypes.h
Abstract IEEE488 instrument class: type definitions.
OSDefines.h
Platform Dependent Definitions.
U64
unsigned long long U64
64-bit unsigned integer.
Definition OSDefines.h:32
U8
unsigned char U8
Unsigned byte.
Definition OSDefines.h:29
F32
float F32
32-bit floating-point number.
Definition OSDefines.h:33
I32
int I32
32-bit signed integer.
Definition OSDefines.h:27
U32
unsigned int U32
32-bit unsigned integer.
Definition OSDefines.h:31
F64
double F64
64-bit floating-point number.
Definition OSDefines.h:34
U16
unsigned short U16
16-bit unsigned integer.
Definition OSDefines.h:30
MTL::Instrument::THM1176Types::CAbsoluteTimestamp
Timestamp for a measurement.
Definition THM1176Types.h:551
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::NS_PER_SEC
static const U64 NS_PER_SEC
Definition THM1176Types.h:557
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::seconds
std::time_t seconds(void) const
Fetch the number of seconds.
Definition THM1176Types.cpp:363
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator!=
bool operator!=(CAbsoluteTimestamp other)
Inequality operator.
Definition THM1176Types.cpp:359
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator==
bool operator==(CAbsoluteTimestamp other)
Equality operator.
Definition THM1176Types.cpp:355
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::CAbsoluteTimestamp
CAbsoluteTimestamp(std::time_t Seconds=0, U64 Nanoseconds=0)
Constructor.
Definition THM1176Types.cpp:343
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::clear
void clear(void)
Clear to default values (zeroes).
Definition THM1176Types.cpp:371
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::operator=
CAbsoluteTimestamp & operator=(const CAbsoluteTimestamp &Value)
Assignment operator.
Definition THM1176Types.cpp:349
MTL::Instrument::THM1176Types::CAbsoluteTimestamp::nanoseconds
U64 nanoseconds(void) const
Fetch the number of nanoseconds.
Definition THM1176Types.cpp:367
MTL::Instrument::THM1176Types::CDivisorList
List of divisors, one per measurement unit.
Definition THM1176Types.h:203
MTL::Instrument::THM1176Types::CErrorList
List of errors returned by the instrument.
Definition THM1176Types.h:232
MTL::Instrument::THM1176Types::CFluxList
List of flux density values.
Definition THM1176Types.h:170
MTL::Instrument::THM1176Types::CTimestampList
List of timestamps.
Definition THM1176Types.h:576
MTL::Instrument::THM1176Types::CTimestampList::GetEstimatedPeriod
bool GetEstimatedPeriod(F64 &Period)
Estimate the measurement period from this timestamp list, by means of a least-squares fit.
Definition THM1176Types.cpp:429
MTL::Instrument::THM1176Types::CUnitsList
List of measurement units.
Definition THM1176Types.h:194
MTL::Instrument::THM1176Types::RegisterList
List of SCPI status registers.
Definition THM1176Types.h:66
MTL::Instrument::THM1176Types::StatusValues
List of values returned for several SCPI status registers.
Definition THM1176Types.h:76
MTL::Instrument::THM1176Types
Definition THM1176TypeConversions.h:20
MTL::Instrument::THM1176Types::eStatusRegisterType
eStatusRegisterType
Enumeration of SCPI status register types.
Definition THM1176Types.h:45
MTL::Instrument::THM1176Types::kStatusEnable
@ kStatusEnable
Enable register.
Definition THM1176Types.h:48
MTL::Instrument::THM1176Types::kStatusCondition
@ kStatusCondition
Condition register.
Definition THM1176Types.h:47
MTL::Instrument::THM1176Types::kStatusEvent
@ kStatusEvent
Event register.
Definition THM1176Types.h:46
MTL::Instrument::THM1176Types::operator-
CAbsoluteTimestamp operator-(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp subtraction operator.
Definition THM1176Types.cpp:394
MTL::Instrument::THM1176Types::eInstrModel
eInstrModel
Enumeration of instrument (THM1176-LF, THM1176-MF, ...) model.
Definition THM1176Types.h:335
MTL::Instrument::THM1176Types::eInstrModel::kUnknown
@ kUnknown
Definition THM1176Types.h:341
MTL::Instrument::THM1176Types::eInstrModel::kTHM1176HFC
@ kTHM1176HFC
Definition THM1176Types.h:339
MTL::Instrument::THM1176Types::eInstrModel::kTHM1176LF
@ kTHM1176LF
Definition THM1176Types.h:336
MTL::Instrument::THM1176Types::eInstrModel::kTHM1176MF
@ kTHM1176MF
Definition THM1176Types.h:337
MTL::Instrument::THM1176Types::eInstrModel::kTFM1186
@ kTFM1186
Definition THM1176Types.h:340
MTL::Instrument::THM1176Types::eInstrModel::kTHM1176HF
@ kTHM1176HF
Definition THM1176Types.h:338
MTL::Instrument::THM1176Types::operator<<
std::ostream & operator<<(std::ostream &Stream, const eStatusRegisterSet &RegSet)
Status register set stream output.
Definition THM1176Types.cpp:27
MTL::Instrument::THM1176Types::uParm
DataType uParm
Parameter template, with only current value.
Definition THM1176Types.h:294
MTL::Instrument::THM1176Types::tFlux
F32 tFlux
Flux density value, as 32-bit floating-point number.
Definition THM1176Types.h:30
MTL::Instrument::THM1176Types::eCommunicationFormat
eCommunicationFormat
Enumeration of possible formats for returned data.
Definition THM1176Types.h:466
MTL::Instrument::THM1176Types::kComFormatInteger
@ kComFormatInteger
Binary (32-bit integers).
Definition THM1176Types.h:468
MTL::Instrument::THM1176Types::kComFormatPacked2Byte
@ kComFormatPacked2Byte
Binary packed: first field value as I32, remainder deltas as I16.
Definition THM1176Types.h:469
MTL::Instrument::THM1176Types::kComFormatPacked1Byte
@ kComFormatPacked1Byte
Binary packed: first field value as I32, remainder deltas as I8.
Definition THM1176Types.h:470
MTL::Instrument::THM1176Types::kComFormatAscii
@ kComFormatAscii
Human-legible text.
Definition THM1176Types.h:467
MTL::Instrument::THM1176Types::tFileList
std::vector< sFile > tFileList
List of directory entries.
Definition THM1176Types.h:532
MTL::Instrument::THM1176Types::eModelRevision
eModelRevision
THM1176 type A or B.
Definition THM1176Types.h:347
MTL::Instrument::THM1176Types::kA
@ kA
Definition THM1176Types.h:347
MTL::Instrument::THM1176Types::kB
@ kB
Definition THM1176Types.h:347
MTL::Instrument::THM1176Types::operator+
CAbsoluteTimestamp operator+(CAbsoluteTimestamp a, CAbsoluteTimestamp b)
Timestamp addition operator.
Definition THM1176Types.cpp:380
MTL::Instrument::THM1176Types::eInputTriggerSource
eInputTriggerSource
Enumeration of possible trigger sources.
Definition THM1176Types.h:417
MTL::Instrument::THM1176Types::kInputTrigSrcTimer
@ kInputTrigSrcTimer
Timed trigger: start measurement at regular intervals.
Definition THM1176Types.h:419
MTL::Instrument::THM1176Types::kInputTrigSrcImmediate
@ kInputTrigSrcImmediate
Immediate trigger: start measurement immediately after previous one completes.
Definition THM1176Types.h:418
MTL::Instrument::THM1176Types::kInputTrigSrcBus
@ kInputTrigSrcBus
Bus trigger: start measurement upon USB trigger message.
Definition THM1176Types.h:420
MTL::Instrument::THM1176Types::eUnits
eUnits
Enumeration of possible measurement units.
Definition THM1176Types.h:182
MTL::Instrument::THM1176Types::knT
@ knT
Nano-Tesla.
Definition THM1176Types.h:186
MTL::Instrument::THM1176Types::kmT
@ kmT
Milli-Tesla.
Definition THM1176Types.h:184
MTL::Instrument::THM1176Types::kMHzp
@ kMHzp
Equivalent proton NMR resonant frequency, in Mega-Hertz.
Definition THM1176Types.h:190
MTL::Instrument::THM1176Types::kGauss
@ kGauss
Gauss.
Definition THM1176Types.h:187
MTL::Instrument::THM1176Types::kmGauss
@ kmGauss
Milli-Gauss.
Definition THM1176Types.h:189
MTL::Instrument::THM1176Types::kT
@ kT
Tesla.
Definition THM1176Types.h:183
MTL::Instrument::THM1176Types::kkGauss
@ kkGauss
Kilo-Gauss.
Definition THM1176Types.h:188
MTL::Instrument::THM1176Types::kuT
@ kuT
Micro-Tesla.
Definition THM1176Types.h:185
MTL::Instrument::THM1176Types::eStatusRegisterSet
eStatusRegisterSet
Enumeration of SCPI status register sets.
Definition THM1176Types.h:37
MTL::Instrument::THM1176Types::kStatusByte
@ kStatusByte
Status Byte.
Definition THM1176Types.h:38
MTL::Instrument::THM1176Types::kStatusQuestionableStatusRegister
@ kStatusQuestionableStatusRegister
Questionable Status Register.
Definition THM1176Types.h:40
MTL::Instrument::THM1176Types::kStandardEventStatusRegister
@ kStandardEventStatusRegister
Standard Event Status Register.
Definition THM1176Types.h:39
MTL::Instrument::THM1176Types::kStatusOperationStatusRegister
@ kStatusOperationStatusRegister
Operation Status Register.
Definition THM1176Types.h:41
MTL::Instrument
Definition THM1176.h:74
MTL
Definition THM1176.h:73
MTL::Instrument::THM1176Types::sArbitraryMeasurements
Specify the measurement data to be returned.
Definition THM1176Types.h:593
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Bx
bool Bx
Return the flux density X-component.
Definition THM1176Types.h:594
MTL::Instrument::THM1176Types::sArbitraryMeasurements::operator==
bool operator==(sArbitraryMeasurements other) const
Equality operator.
Definition THM1176Types.cpp:493
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Temperature
bool Temperature
Return the sensor temperature.
Definition THM1176Types.h:597
MTL::Instrument::THM1176Types::sArbitraryMeasurements::operator!=
bool operator!=(sArbitraryMeasurements other) const
Inequality operator.
Definition THM1176Types.cpp:504
MTL::Instrument::THM1176Types::sArbitraryMeasurements::By
bool By
Return the flux density Y-component.
Definition THM1176Types.h:595
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Bz
bool Bz
Return the flux density Z-component.
Definition THM1176Types.h:596
MTL::Instrument::THM1176Types::sArbitraryMeasurements::clear
void clear()
Clear to default values.
Definition THM1176Types.cpp:488
MTL::Instrument::THM1176Types::sArbitraryMeasurements::sArbitraryMeasurements
sArbitraryMeasurements(bool Bx=false, bool By=false, bool Bz=false, bool Temp=false, bool Time=false, U32 NMeas=0)
Constructor.
Definition THM1176Types.h:609
MTL::Instrument::THM1176Types::sArbitraryMeasurements::Timestamp
bool Timestamp
Return the timestamp.
Definition THM1176Types.h:598
MTL::Instrument::THM1176Types::sArbitraryMeasurements::NoMeasurements
U32 NoMeasurements
Return this number of measurements.
Definition THM1176Types.h:599
MTL::Instrument::THM1176Types::sAveraging
Averaging parameter.
Definition THM1176Types.h:388
MTL::Instrument::THM1176Types::sAveraging::sAveraging
sAveraging(ParmType< U16 > NPts={ })
Constructor.
Definition THM1176Types.h:394
MTL::Instrument::THM1176Types::sAveraging::operator!=
bool operator!=(sAveraging other) const
Inequality operator.
Definition THM1176Types.h:405
MTL::Instrument::THM1176Types::sAveraging::NoPoints
ParmType< U16 > NoPoints
Number of points in block average.
Definition THM1176Types.h:389
MTL::Instrument::THM1176Types::sAveraging::clear
void clear(void)
Clear to default (zero).
Definition THM1176Types.h:397
MTL::Instrument::THM1176Types::sAveraging::operator==
bool operator==(sAveraging other) const
Equality operator.
Definition THM1176Types.h:401
MTL::Instrument::THM1176Types::sBoundedParm::Val
DataType Val
Current value.
Definition THM1176Types.h:247
MTL::Instrument::THM1176Types::sBoundedParm::Max
DataType Max
Upper bound.
Definition THM1176Types.h:249
MTL::Instrument::THM1176Types::sBoundedParm::sBoundedParm
sBoundedParm(DataType Val=0, DataType Min=0, DataType Max=0, DataType Def=0)
Constructor.
Definition THM1176Types.h:258
MTL::Instrument::THM1176Types::sBoundedParm::operator!=
bool operator!=(sBoundedParm other) const
Inequality operator.
Definition THM1176Types.h:277
MTL::Instrument::THM1176Types::sBoundedParm::operator=
sBoundedParm & operator=(const DataType &scalar)
Set value, min, max and default to given value.
Definition THM1176Types.h:281
MTL::Instrument::THM1176Types::sBoundedParm::Min
DataType Min
Lower bound.
Definition THM1176Types.h:248
MTL::Instrument::THM1176Types::sBoundedParm::clear
void clear(void)
Clear the parameter to default values.
Definition THM1176Types.h:261
MTL::Instrument::THM1176Types::sBoundedParm::operator==
bool operator==(sBoundedParm other) const
Equality operator.
Definition THM1176Types.h:268
MTL::Instrument::THM1176Types::sBoundedParm::Def
DataType Def
Default value.
Definition THM1176Types.h:250
MTL::Instrument::THM1176Types::sError
Error returned by the instrument.
Definition THM1176Types.h:214
MTL::Instrument::THM1176Types::sError::operator==
bool operator==(sError other) const
Equality operator.
Definition THM1176Types.cpp:145
MTL::Instrument::THM1176Types::sError::sError
sError(I32 Code=0, std::string Description="", std::string Context="")
Constructor.
Definition THM1176Types.h:224
MTL::Instrument::THM1176Types::sError::Context
std::string Context
SCPI commands being executed at time of error.
Definition THM1176Types.h:217
MTL::Instrument::THM1176Types::sError::operator!=
bool operator!=(sError other) const
Inequality operator.
Definition THM1176Types.cpp:153
MTL::Instrument::THM1176Types::sError::Code
I32 Code
Error code.
Definition THM1176Types.h:215
MTL::Instrument::THM1176Types::sError::Description
std::string Description
Error description.
Definition THM1176Types.h:216
MTL::Instrument::THM1176Types::sExample
Sample parameter template.
Definition THM1176Types.h:304
MTL::Instrument::THM1176Types::sExample::ExampleF32
ParmType< F32 > ExampleF32
Example of an F32 element.
Definition THM1176Types.h:307
MTL::Instrument::THM1176Types::sExample::ExampleF64
ParmType< F64 > ExampleF64
Example of an F64 element.
Definition THM1176Types.h:306
MTL::Instrument::THM1176Types::sExample::ExampleState
bool ExampleState
Example of a boolean element.
Definition THM1176Types.h:305
MTL::Instrument::THM1176Types::sFile
Directory entry in the instrument's file system.
Definition THM1176Types.h:514
MTL::Instrument::THM1176Types::sFile::clear
void clear()
Clear to default values.
Definition THM1176Types.cpp:308
MTL::Instrument::THM1176Types::sFile::Path
std::string Path
File path.
Definition THM1176Types.h:516
MTL::Instrument::THM1176Types::sFile::operator==
bool operator==(sFile other) const
Equality operator.
Definition THM1176Types.cpp:314
MTL::Instrument::THM1176Types::sFile::operator!=
bool operator!=(sFile other) const
Inequality operator.
Definition THM1176Types.cpp:322
MTL::Instrument::THM1176Types::sFile::Type
std::string Type
File type ("ASCII" or "BINARY").
Definition THM1176Types.h:517
MTL::Instrument::THM1176Types::sFile::sFile
sFile(size_t S=0, std::string P="", std::string T="")
Constructor.
Definition THM1176Types.h:524
MTL::Instrument::THM1176Types::sFile::Size
size_t Size
File size, in bytes.
Definition THM1176Types.h:515
MTL::Instrument::THM1176Types::sIdentifier
Instrument's identification string - parsed version.
Definition THM1176Types.h:353
MTL::Instrument::THM1176Types::sIdentifier::FirmwareVersion
struct sVersion FirmwareVersion
Version numbers of firmware.
Definition THM1176Types.h:359
MTL::Instrument::THM1176Types::sIdentifier::Manufacturer
std::string Manufacturer
Manufacturer name ("Metrolab Technology SA").
Definition THM1176Types.h:354
MTL::Instrument::THM1176Types::sIdentifier::ElectronicsVersion
struct sVersion ElectronicsVersion
Version numbers of electronics.
Definition THM1176Types.h:357
MTL::Instrument::THM1176Types::sIdentifier::SerialNumber
U32 SerialNumber
Serial number.
Definition THM1176Types.h:356
MTL::Instrument::THM1176Types::sIdentifier::operator!=
bool operator!=(sIdentifier other) const
Inequality operator.
Definition THM1176Types.cpp:220
MTL::Instrument::THM1176Types::sIdentifier::ProbeVersion
struct sVersion ProbeVersion
Version numbers of probe.
Definition THM1176Types.h:358
MTL::Instrument::THM1176Types::sIdentifier::Model
std::string Model
Model name (e.g. "THM1176-MF").
Definition THM1176Types.h:355
MTL::Instrument::THM1176Types::sIdentifier::operator==
bool operator==(sIdentifier other) const
Equality oeprator.
Definition THM1176Types.cpp:209
MTL::Instrument::THM1176Types::sIdentifier::clear
void clear(void)
Clear to default.
Definition THM1176Types.cpp:198
MTL::Instrument::THM1176Types::sIdentifier::InstrModel
enum eInstrModel InstrModel
Enumerator of instrument model.
Definition THM1176Types.h:361
MTL::Instrument::THM1176Types::sIdentifier::sIdentifier
sIdentifier(std::string Mfr="", std::string Mdl="", U32 SN=0, struct sVersion EVsn={ }, struct sVersion PVsn={ }, struct sVersion FVsn={ }, eModelRevision ThmRev=kA, eInstrModel InstrMdl=eInstrModel::kUnknown)
Constructor.
Definition THM1176Types.h:373
MTL::Instrument::THM1176Types::sIdentifier::ModelRevision
enum eModelRevision ModelRevision
Revision of Model.
Definition THM1176Types.h:360
MTL::Instrument::THM1176Types::sInputTrigger
Input trigger parameter.
Definition THM1176Types.h:426
MTL::Instrument::THM1176Types::sInputTrigger::Count
ParmType< U16 > Count
Trigger count: take this many measurements before sending results.
Definition THM1176Types.h:429
MTL::Instrument::THM1176Types::sInputTrigger::Source
eInputTriggerSource Source
Trigger source.
Definition THM1176Types.h:427
MTL::Instrument::THM1176Types::sInputTrigger::sInputTrigger
sInputTrigger(eInputTriggerSource Src={ }, ParmType< F64 > Per={ }, ParmType< U16 > Cnt={ })
Constructor.
Definition THM1176Types.h:436
MTL::Instrument::THM1176Types::sInputTrigger::operator==
bool operator==(sInputTrigger other) const
Equality operator.
Definition THM1176Types.h:445
MTL::Instrument::THM1176Types::sInputTrigger::operator!=
bool operator!=(sInputTrigger other) const
Inequality operator.
Definition THM1176Types.h:453
MTL::Instrument::THM1176Types::sInputTrigger::clear
void clear(void)
Clear to default.
Definition THM1176Types.h:439
MTL::Instrument::THM1176Types::sInputTrigger::Period_s
ParmType< F64 > Period_s
Trigger period, for timed trigger.
Definition THM1176Types.h:428
MTL::Instrument::THM1176Types::sMeasurementConditions::UseCalibration
bool UseCalibration
Use calibration data.
Definition THM1176Types.h:622
MTL::Instrument::THM1176Types::sMeasurementConditions::Range
tFlux Range
Current range setting.
Definition THM1176Types.h:623
MTL::Instrument::THM1176Types::sMeasurementConditions::operator!=
bool operator!=(sMeasurementConditions other) const
Inequality operator.
Definition THM1176Types.cpp:525
MTL::Instrument::THM1176Types::sMeasurementConditions::sMeasurementConditions
sMeasurementConditions(sAveraging< uParm > AvgParms={ }, sInputTrigger< uParm > TrigParms={ }, bool UseCal=false, tFlux RangeIn=0.)
Constructor.
Definition THM1176Types.h:631
MTL::Instrument::THM1176Types::sMeasurementConditions::clear
void clear()
Clear to default values.
Definition THM1176Types.cpp:509
MTL::Instrument::THM1176Types::sMeasurementConditions::AveragingParms
sAveraging< uParm > AveragingParms
Averaging parameters.
Definition THM1176Types.h:620
MTL::Instrument::THM1176Types::sMeasurementConditions::TriggerParms
sInputTrigger< uParm > TriggerParms
Trigger parameters.
Definition THM1176Types.h:621
MTL::Instrument::THM1176Types::sMeasurementConditions::operator==
bool operator==(sMeasurementConditions other) const
Equality operator.
Definition THM1176Types.cpp:516
MTL::Instrument::THM1176Types::sRange::clear
void clear(void)
Clear to default values.
Definition THM1176Types.h:490
MTL::Instrument::THM1176Types::sRange::Auto
bool Auto
Auto-ranging enabled.
Definition THM1176Types.h:480
MTL::Instrument::THM1176Types::sRange::operator!=
bool operator!=(sRange other) const
Inequality operator.
Definition THM1176Types.h:502
MTL::Instrument::THM1176Types::sRange::operator==
bool operator==(sRange other) const
Equality operator.
Definition THM1176Types.h:495
MTL::Instrument::THM1176Types::sRange::sRange
sRange(bool A={ }, ParmType< tFlux > R={ })
Constructor.
Definition THM1176Types.h:487
MTL::Instrument::THM1176Types::sRange::Range
ParmType< tFlux > Range
Measurement range, if auto-ranging is not enabled.
Definition THM1176Types.h:481
MTL::Instrument::THM1176Types::sStatusRegister::Set
eStatusRegisterSet Set
SCPI register set.
Definition THM1176Types.h:53
MTL::Instrument::THM1176Types::sStatusRegister::Type
eStatusRegisterType Type
SCPI register type.
Definition THM1176Types.h:54
MTL::Instrument::THM1176Types::sStatusRegister::sStatusRegister
sStatusRegister(eStatusRegisterSet S={ }, eStatusRegisterType T={ })
Constructor.
Definition THM1176Types.h:60
MTL::Instrument::THM1176Types::sVersion
Major and minor version numbers.
Definition THM1176Types.h:314
MTL::Instrument::THM1176Types::sVersion::operator!=
bool operator!=(sVersion other) const
Inequality operator.
Definition THM1176Types.cpp:185
MTL::Instrument::THM1176Types::sVersion::clear
void clear(void)
Clear to default (zeroes).
Definition THM1176Types.cpp:174
MTL::Instrument::THM1176Types::sVersion::Name
std::string Name
Version name.
Definition THM1176Types.h:317
MTL::Instrument::THM1176Types::sVersion::operator==
bool operator==(sVersion other) const
Equality operator.
Definition THM1176Types.cpp:179
MTL::Instrument::THM1176Types::sVersion::Minor
U8 Minor
Minor version number.
Definition THM1176Types.h:316
MTL::Instrument::THM1176Types::sVersion::sVersion
sVersion(U8 Maj=0, U8 Min=0)
Constructor.
Definition THM1176Types.h:323
MTL::Instrument::THM1176Types::sVersion::Major
U8 Major
Major version number.
Definition THM1176Types.h:315
MTL::Instrument::THM1176Types::uOPERation::sOPERation
Access the Operation Status Register as bit fields.
Definition THM1176Types.h:126
MTL::Instrument::THM1176Types::uOPERation::sOPERation::RANGing
U16 RANGing
Changing range.
Definition THM1176Types.h:130
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA6_15
U16 NA6_15
Not Available.
Definition THM1176Types.h:134
MTL::Instrument::THM1176Types::uOPERation::sOPERation::CALibrating
U16 CALibrating
Measuring zero-offset.
Definition THM1176Types.h:128
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA1
U16 NA1
Not Available.
Definition THM1176Types.h:129
MTL::Instrument::THM1176Types::uOPERation::sOPERation::NA3
U16 NA3
Not Available.
Definition THM1176Types.h:131
MTL::Instrument::THM1176Types::uOPERation::sOPERation::WaitingForTRIGger
U16 WaitingForTRIGger
Waiting for trigger.
Definition THM1176Types.h:133
MTL::Instrument::THM1176Types::uOPERation::sOPERation::MEASuring
U16 MEASuring
Measuring magnetic field strength.
Definition THM1176Types.h:132
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable
Access the Questionable Status Register as bit fields.
Definition THM1176Types.h:145
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA10_15
U16 NA10_15
Not Available.
Definition THM1176Types.h:151
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::Frequency
U16 Frequency
Acquisition buffer or the timed trigger has been overrun.
Definition THM1176Types.h:148
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA6_8
U16 NA6_8
Not Available.
Definition THM1176Types.h:149
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::Overrange
U16 Overrange
Measurement was over-range.
Definition THM1176Types.h:150
MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable::NA0_4
U16 NA0_4
Not Available.
Definition THM1176Types.h:147
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent
Access the Standard Event Status Register as bit fields.
Definition THM1176Types.h:106
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::CommandError
U8 CommandError
Error in preceding command.
Definition THM1176Types.h:113
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::NA1
U8 NA1
Not Available.
Definition THM1176Types.h:109
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::DeviceDependentError
U8 DeviceDependentError
Errors specific to the THM1176, including internal errors.
Definition THM1176Types.h:111
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::ExecutionError
U8 ExecutionError
Error detected during command execution.
Definition THM1176Types.h:112
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::PowerOn
U8 PowerOn
THM1176 has been powered up.
Definition THM1176Types.h:115
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::NA6
U8 NA6
Not Available.
Definition THM1176Types.h:114
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::OperationComplete
U8 OperationComplete
*OPC has flagged operation complete
Definition THM1176Types.h:108
MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent::QueryError
U8 QueryError
Error in preceding query.
Definition THM1176Types.h:110
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte
Access the Status Byte as bit fields.
Definition THM1176Types.h:87
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::MAV
U8 MAV
Message Available.
Definition THM1176Types.h:92
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::NA0_1
U8 NA0_1
Not Available.
Definition THM1176Types.h:89
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::EAV
U8 EAV
Error Available in Error / Event Queue.
Definition THM1176Types.h:90
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::OSB
U8 OSB
OPERation status summary bit.
Definition THM1176Types.h:95
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::RQS
U8 RQS
ReQuest for Service.
Definition THM1176Types.h:94
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::ESB
U8 ESB
Standard Event Status Register summary bit.
Definition THM1176Types.h:93
MTL::Instrument::THM1176Types::uStatusByte::sStatusByte::QSB
U8 QSB
QUEStionable status summary bit.
Definition THM1176Types.h:91
MTL::Instrument::THM1176Types::uOPERation
Union to access the Operation Status Register as integer or bit fields.
Definition THM1176Types.h:120
MTL::Instrument::THM1176Types::uOPERation::OPERation
struct MTL::Instrument::THM1176Types::uOPERation::sOPERation OPERation
Access the Operation Status Register as bit fields.
MTL::Instrument::THM1176Types::uOPERation::RawOPER
U16 RawOPER
Access the Operation Status Register as unsigned integer.
Definition THM1176Types.h:122
MTL::Instrument::THM1176Types::uQUEStionable
Union to access the Questionable Status Register as integer or bit fields.
Definition THM1176Types.h:139
MTL::Instrument::THM1176Types::uQUEStionable::RawQUES
U16 RawQUES
Access the Questionable Status Register as unsigned integer.
Definition THM1176Types.h:141
MTL::Instrument::THM1176Types::uQUEStionable::QUEStionable
struct MTL::Instrument::THM1176Types::uQUEStionable::sQUEStionable QUEStionable
Access the Questionable Status Register as bit fields.
MTL::Instrument::THM1176Types::uStandardEvent
Union to access the Standard Event Status Register as integer or bit fields.
Definition THM1176Types.h:100
MTL::Instrument::THM1176Types::uStandardEvent::StandardEvent
struct MTL::Instrument::THM1176Types::uStandardEvent::sStandardEvent StandardEvent
Access the Standard Event Status Register as bit fields.
MTL::Instrument::THM1176Types::uStandardEvent::RawSE
U16 RawSE
Access the Standard Event Status Register as unsigned integer.
Definition THM1176Types.h:102
MTL::Instrument::THM1176Types::uStatusByte
Union to access the Status Byte as integer or bit fields.
Definition THM1176Types.h:81
MTL::Instrument::THM1176Types::uStatusByte::StatusByte
struct MTL::Instrument::THM1176Types::uStatusByte::sStatusByte StatusByte
Access the Status Byte as bit fields.
MTL::Instrument::THM1176Types::uStatusByte::RawSTB
U16 RawSTB
Access the Status Byte as unsigned integer.
Definition THM1176Types.h:83