ngscopeclient v0.2
Loading...
Searching...
No Matches
AgilentMultimeter.h
Go to the documentation of this file.
1/***********************************************************************************************************************
2* *
3* libscopehal *
4* *
5* Copyright (c) 2012-2026 Andrew D. Zonenberg and contributors *
6* All rights reserved. *
7* *
8* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
9* following conditions are met: *
10* *
11* * Redistributions of source code must retain the above copyright notice, this list of conditions, and the *
12* following disclaimer. *
13* *
14* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the *
15* following disclaimer in the documentation and/or other materials provided with the distribution. *
16* *
17* * Neither the name of the author nor the names of any contributors may be used to endorse or promote products *
18* derived from this software without specific prior written permission. *
19* *
20* THIS SOFTWARE IS PROVIDED BY THE AUTHORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
21* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL *
22* THE AUTHORS BE HELD LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
23* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR *
24* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
25* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE *
26* POSSIBILITY OF SUCH DAMAGE. *
27* *
28***********************************************************************************************************************/
29
35#ifndef AgilentMultimeter_h
36#define AgilentMultimeter_h
37
43 : public virtual SCPIMultimeter
44{
45
46public:
48 virtual ~AgilentMultimeter();
49
50 virtual unsigned int GetInstrumentTypes() const override;
51 virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override;
52
53 virtual unsigned int GetMeasurementTypes() override;
54 virtual unsigned int GetSecondaryMeasurementTypes() override;
55
56 //Channel info
57 virtual int GetCurrentMeterChannel() override;
58 virtual void SetCurrentMeterChannel(int chan) override;
59
60 //Meter operating mode
61 virtual MeasurementTypes GetMeterMode() override;
62 virtual MeasurementTypes GetSecondaryMeterMode() override;
63 virtual void SetMeterMode(MeasurementTypes type) override;
64 virtual void SetSecondaryMeterMode(MeasurementTypes type) override;
65
66 //Control
67 virtual void SetMeterAutoRange(bool enable) override;
68 virtual bool GetMeterAutoRange() override;
69 virtual void StartMeter() override;
70 virtual void StopMeter() override;
71
72 virtual int GetMeterDigits() override;
73
74 //Get readings
75 virtual double GetMeterValue() override;
76 virtual double GetSecondaryMeterValue() override;
77
78protected:
79 MeasurementTypes m_mode;
80 bool m_modeValid;
81
82public:
83 static std::string GetDriverNameInternal();
84
85 //This is intentionally not virtual since it's a static method used by enumeration
86 //cppcheck-suppress duplInheritedMember
87 static std::vector<SCPIInstrumentModel> GetDriverSupportedModels()
88 {
89 return {
90 #ifdef _WIN32
91 {"Agilent 34401A", {{ SCPITransportType::TRANSPORT_UART, "COM<x>" }}}
92 #else
93 {"Agilent 34401A", {{ SCPITransportType::TRANSPORT_UART, "/dev/ttyUSB<x>" }}}
94 #endif
95 };
96 }
97 METER_INITPROC(AgilentMultimeter)
98};
99
100#endif
Driver for Agilent 34401A.
Definition AgilentMultimeter.h:44
virtual uint32_t GetInstrumentTypesForChannel(size_t i) const override
Returns a bitfield describing the set of instrument types that a given channel supports.
Definition AgilentMultimeter.cpp:114
virtual int GetMeterDigits() override
Returns the digit resolution of the meter.
Definition AgilentMultimeter.cpp:122
virtual unsigned int GetInstrumentTypes() const override
Returns a bitfield describing the set of instrument types that this instrument supports.
Definition AgilentMultimeter.cpp:95
virtual unsigned int GetSecondaryMeasurementTypes() override
Gets a bitmask of secondary measurement types currently available.
Definition AgilentMultimeter.cpp:108
virtual MeasurementTypes GetSecondaryMeterMode() override
Gets the active secondary mode.
virtual double GetSecondaryMeterValue() override
Get the value of the secondary measurement.
Definition AgilentMultimeter.cpp:253
virtual void SetSecondaryMeterMode(MeasurementTypes type) override
Sets the active secondary mode.
virtual double GetMeterValue() override
Get the value of the primary measurement.
Definition AgilentMultimeter.cpp:229
An SCPI-based multimeter.
Definition SCPIMultimeter.h:38
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition SCPITransport.h:53