userlevelmeter.cpp
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 #include "userlevelmeter.h"
16 //---------------------------------------------------------------------------
17 
18 REGISTER_TYPE(XDriverList, ILM, "Oxford ILM Helium Level Meter");
19 REGISTER_TYPE(XDriverList, LM500, "Cryomagnetics LM-500 Level Meter");
20 
21 XILM::XILM(const char *name, bool runtime,
22  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
23  XOxfordDriver<XLevelMeter>(name, runtime, ref(tr_meas), meas) {
24  const char *channels_create[] = {"He", 0L};
25  createChannels(ref(tr_meas), meas, channels_create);
26 }
27 
28 double
29 XILM::getLevel(unsigned int ch) {
30  return read(ch + 1) / 10.0;
31 }
32 
33 XLM500::XLM500(const char *name, bool runtime,
34  Transaction &tr_meas, const shared_ptr<XMeasure> &meas) :
35  XCharDeviceDriver<XLevelMeter>(name, runtime, ref(tr_meas), meas) {
36  const char *channels_create[] = {"1", "2", 0L};
37  createChannels(ref(tr_meas), meas, channels_create);
38 
39  interface()->setEOS("");
40  interface()->setGPIBUseSerialPollOnWrite(false);
41  interface()->setGPIBUseSerialPollOnRead (false);
42  interface()->setGPIBWaitBeforeWrite(40);
43  // ExclusiveWaitAfterWrite = 10;
44  interface()->setGPIBWaitBeforeRead(40);
45  interface()->setSerialEOS("\r\n");
46  interface()->setSerialBaudRate(9600);
47  interface()->setSerialHasEchoBack(true);
48 }
49 
50 double
51 XLM500::getLevel(unsigned int ch) {
52  interface()->queryf("MEAS? %u", ch + 1);
53  return interface()->toDouble();
54 }

Generated for KAME4 by  doxygen 1.8.3