userdmm.h
1 /***************************************************************************
2  Copyright (C) 2002-2015 Kentaro Kitagawa
3  kitagawa@phys.s.u-tokyo.ac.jp
4 
5  This program is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  You should have received a copy of the GNU Library General
11  Public License and a list of authors along with this program;
12  see the files COPYING and AUTHORS.
13 ***************************************************************************/
14 //---------------------------------------------------------------------------
15 #ifndef userdmmH
16 #define userdmmH
17 
18 #include "chardevicedriver.h"
19 #include "charinterface.h"
20 #include "dmm.h"
21 //---------------------------------------------------------------------------
22 //! Base class for SCPI DMMs.
23 class XDMMSCPI : public XCharDeviceDriver<XDMM> {
24 public:
25  XDMMSCPI(const char *name, bool runtime,
26  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
27  XCharDeviceDriver<XDMM>(name, runtime, ref(tr_meas), meas) {}
28  virtual ~XDMMSCPI() {}
29 
30  //! requests the latest reading
31  virtual double fetch();
32  //! one-shot reading
33  virtual double oneShotRead();
34 protected:
35  //! called when m_function is changed
36  virtual void changeFunction();
37 };
38 
39 
40 //! Keithley 2182 nanovolt meter
41 //! One must setup 2182 for SCPI mode
42 class XKE2182:public XDMMSCPI {
43 public:
44  XKE2182(const char *name, bool runtime,
45  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
46  XDMMSCPI(name, runtime, ref(tr_meas), meas) {
47  iterate_commit([=](Transaction &tr){
48  tr[ *function()].add("VOLT");
49  tr[ *function()].add("TEMP");
50  });
51  }
52 };
53 
54 //! Keithley 2000 Multimeter
55 //! One must setup 2000 for SCPI mode
56 class XKE2000:public XDMMSCPI {
57 public:
58  XKE2000(const char *name, bool runtime,
59  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
60  XDMMSCPI(name, runtime, ref(tr_meas), meas) {
61  iterate_commit([=](Transaction &tr){
62  tr[ *function()].add("VOLT:DC");
63  tr[ *function()].add("VOLT:AC");
64  tr[ *function()].add("CURR:DC");
65  tr[ *function()].add("CURR:AC");
66  tr[ *function()].add("RES");
67  tr[ *function()].add("FRES");
68  tr[ *function()].add("FREQ");
69  tr[ *function()].add("TEMP");
70  tr[ *function()].add("PER");
71  tr[ *function()].add("DIOD");
72  tr[ *function()].add("CONT");
73  });
74 
75  interface()->setGPIBWaitBeforeRead(20);
76  }
77 };
78 
79 //! Agilent(Hewlett-Packard) 34420A nanovolt meter
80 class XHP34420A:public XDMMSCPI {
81 public:
82  XHP34420A(const char *name, bool runtime,
83  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
84  XDMMSCPI(name, runtime, ref(tr_meas), meas)
85  {
86  iterate_commit([=](Transaction &tr){
87  tr[ *function()].add("VOLT");
88  tr[ *function()].add("CURR");
89  tr[ *function()].add("RES");
90  tr[ *function()].add("FRES");
91  });
92  }
93 };
94 
95 //! Agilent(Hewlett-Packard) 3458A DMM.
96 class XHP3458A : public XCharDeviceDriver<XDMM> {
97 public:
98  XHP3458A(const char *name, bool runtime,
99  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
100  virtual ~XHP3458A() {}
101 
102  //requests the latest reading
103  virtual double fetch();
104  //one-shot reading
105  virtual double oneShotRead();
106 protected:
107  //! called when m_function is changed
108  virtual void changeFunction();
109 };
110 
111 //! Agilent(Hewlett-Packard) 3478A DMM.
112 class XHP3478A : public XCharDeviceDriver<XDMM> {
113 public:
114  XHP3478A(const char *name, bool runtime,
115  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
116  virtual ~XHP3478A() {}
117 
118  //requests the latest reading
119  virtual double fetch();
120  //one-shot reading
121  virtual double oneShotRead();
122 protected:
123  //! called when m_function is changed
124  virtual void changeFunction();
125 };
126 
127 
128 //! SANWA PC500/510/520M DMM.
129 class XSanwaPC500 : public XCharDeviceDriver<XDMM> {
130 public:
131  XSanwaPC500(const char *name, bool runtime,
132  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
133  virtual ~XSanwaPC500() {}
134 
135  //requests the latest reading
136  virtual double fetch();
137  //one-shot reading
138  virtual double oneShotRead();
139 protected:
140  //! called when m_function is changed
141  virtual void changeFunction();
142  //! send command.
143  virtual void requestData();
144 };
145 //! SANWA PC5000 DMM.
146 class XSanwaPC5000 : public XSanwaPC500 {
147 public:
148  XSanwaPC5000(const char *name, bool runtime,
149  Transaction &tr_meas, const shared_ptr<XMeasure> &meas);
150 protected:
151  //! send command.
152  virtual void requestData();
153 };
154 
155 #endif

Generated for KAME4 by  doxygen 1.8.3