00001 /*************************************************************************** 00002 dataqsdk.h - DataqSDK for Linux, include file. 00003 ------------------- 00004 begin : Wed Jun 9 2004 00005 author : Ioan S. Popescu 00006 00007 Copyright (C) 2004 DATAQ Instruments, Inc. <develop@dataq.com> 00008 00009 This program is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU General Public License 00011 as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 00023 ***************************************************************************/ 00024 00025 #ifndef DATAQSDK_H 00026 #define DATAQSDK_H 00027 00028 class dsdk; 00029 00031 class dataqsdk 00032 { 00033 public: 00034 dataqsdk(); 00035 ~dataqsdk(); 00036 00040 00041 const int ADChannelCount(); 00042 const long int ADCounter(); 00044 const long int AvailableData(); 00045 const long int BurstCounter(); 00047 const char *const DeviceFile(); 00049 const long int EventPoint(); 00051 const int InfoBoardID(); 00053 // true = PGH, false = PGL 00054 const bool InfoPGL(); 00056 const int InfoRev(); 00058 const char *const InfoSerial(); 00060 // (# channels) * (SampleRate) 00061 const double MaxBurstRate(); 00062 // used to determine the device: properties, abilities, etc. 00063 // if called before it's been set, it will return a list of devices, 00064 // that can be handled by the library, separated by the '\0' character; 00065 // the last entry is followed by 2 '\0' characters 00066 const char *const ProductName(); 00068 const double SampleRate(); 00069 // predefined levels of limits around the TrigLevel to be passed 00070 // before the trigger goes off 00071 const int TrigHysteresisIdx(); 00072 // the trigger point (in counts) at which the trigger will go off 00073 const int TrigLevel(); 00074 const int TrigMode(); 00075 // trigger channel (zero-based) 00076 const int TrigScnChnIdx(); 00077 // 0 = trigger on the rising slope (negative) 00078 // 1 = trigger on the falling slope (positive) 00079 const int TrigSlope(); 00080 // number of scans to acquire after trigger occurs, and stop 00081 const int TrigPostLength(); 00082 // number of scans to acquire before trigger occurs, and stop 00083 const int TrigPreLength(); 00089 00090 void ADChannelCount(const int ChannelCount); 00091 void ADCounter(const long int Counter); 00092 void BurstCounter(const long int BurstCounter); 00094 void DeviceFile(const char *const DeviceFile); 00096 void EventPoint(const long int EventPnt); 00098 // (# channels) * (SampleRate) 00099 void MaxBurstRate(const double MaxBurstRt); 00100 // used to determine the device: properties, abilities, etc. 00101 void ProductName(const char *const ProductName); 00103 void SampleRate(const double SampleRt); 00104 // predefined levels of limits around the TrigLevel to be passed 00105 // before the trigger goes off 00106 void TrigHysteresisIdx(const int Hidx); 00107 // the trigger point (in counts) at which the trigger will go off 00108 void TrigLevel(const int Level); 00109 void TrigMode(const int Mode); 00110 // trigger channel (zero-based) 00111 void TrigScnChnIdx(const int SCidx); 00112 // 0 = trigger on the rising slope (negative) 00113 // 1 = trigger on the falling slope (positive) 00114 void TrigSlope(const int Slope); 00115 // number of scans to acquire after trigger occurs, and stop 00116 void TrigPostLength(const int PostLength); 00117 // number of scans to acquire before trigger occurs, and stop 00118 void TrigPreLength(const int PreLength); 00124 00125 void ADChannelList(const int *const ChannelList); 00126 // array index corresponds to physical channel (zero-based) 00127 void ADDiffList(const int *const DiffList); 00128 // assigns the gain index to supporting devices 00129 // array index corresponds to physical channel (zero-based) 00130 void ADGainList(const int *const GainList); 00132 void ADMethodList(const int *const MethodList); 00133 // sends 'value' to a DAC 'port' 00134 void DAOutput(const int value, const int port); 00135 // attempts to detect any currently connected devices and returns a 00136 // pointer to a string of ProductIDs separated by the '\0' character 00137 // with the last entry followed by 2 '\0' characters. 00138 // will not detect devices that aren't automatically detected by the 00139 // kernel (USB devices are most likely to be detected) 00140 const char *const DetectedDevices(); 00141 const long int DigitalInput(); 00142 // sends 'value' to all digital ports 00143 // which port depends on the bit position in value 00144 // what value (0, 1) depends on the corresponding bit in 'value' 00145 void DigitalOutput(const int value); 00146 void GetData(); 00148 void GetDataEx(short int *iArray, const int Count); 00149 void GetDataFrame(); 00150 void GetDataFrameEx(short int *iArray, const int Count); 00152 void Start(); 00154 void Stop(); 00162 00163 const bool ControlError(long int &Code); 00165 const bool NewData(long int &Count); 00167 const bool OverRun(); 00170 private: 00172 dataqsdk(const dataqsdk ©); 00173 00174 char *m_ProductName; 00175 int m_last_error; 00176 dsdk *m_classID; 00177 }; 00178 00179 #endif 00180