 |
THM1176InstrumentManager
1.0
Qt Object abstraction for Metrolab THM1176
|
Go to the documentation of this file.
25 #define THM1176_VISA_RESOURCE_PATTERN "USB[0-9]*::0x1BFA::0x0498::[0-9]+::INSTR"
26 #define THM1176_CONNECT_TIMEOUT 5000 // ms
28 #define BLOCK_SIZE_MIN 256
29 #define BLOCK_SIZE_MAX 4096
30 #define BLOCK_SIZE_INC 256
32 #define AVERAGING_COUNT_MIN 100
33 #define AVERAGING_COUNT_MAX 1000
34 #define AVERAGING_COUNT_INC 100
44 std::string l_Command;
46 l_Command +=
";:INIT;:FETC:TIM?";
47 l_Command +=
";:TRIG:COUN " + std::to_string(BlockSize);
48 l_Command +=
";:AVER:COUN " + std::to_string(AveragingCount);
49 l_Command +=
";:INIT;:FETC:TIM?";
56 for (
auto l_pError = l_ErrorList.begin(); l_pError < l_ErrorList.end(); l_pError++)
57 std::cerr <<
"Error: " << l_pError->Code <<
"; " << l_pError->Description << std::endl;
64 if (l_Tokens.size() != 2)
68 std::string l_Token0 = std::string(l_Tokens[0].begin, l_Tokens[0].end);
69 std::string l_Token1 = std::string(l_Tokens[1].begin, l_Tokens[1].end);
70 U64 l_T0 = std::stoull(l_Token0, 0, 0);
71 U64 l_T1 = std::stoull(l_Token1, 0, 0);
84 if (NULL == l_pResourceManager || !l_pResourceManager->
Initialize())
90 if (l_InstrumentList.empty())
95 if (NULL == l_pTHM1176)
106 std::cout << l_BlockSize <<
"\t" << l_AveragingCount <<
"\t" <<
113 delete l_pResourceManager;
117 std::cerr << rE.what() << std::endl;
123 if (l_pResourceManager)
124 delete l_pResourceManager;
List of VISA resource names.
virtual bool FindResources(CResourceList &rList, std::string Filter="?*")
Find VISA resources.
std::vector< MTL_INSTRUMENT_BUFFER_TYPE >::iterator end()
Return an iterator to the end of the buffer.
unsigned long long U64
64-bit unsigned integer.
THM1176 instrument class.
std::vector< MTL_INSTRUMENT_BUFFER_TYPE >::iterator begin()
Return an iterator to the beginning of the buffer.
std::vector< sToken > tTokens
List of tokens.
Collection of utility macros for error messages.
void Disconnect()
Close the connection to the instrument.
bool WriteAndRead(const std::string &rWriteStr, CSCPIBuffer &rReadBuffer)
Write an arbitrary command and read the result.
const tTokens Tokenize(const char Separator=';', size_t Offset=0)
Split the buffer into tokens.
const CErrorList & CurrentErrorList()
Fetch current error list.
bool Connect(U32 InitialTimeout, bool Exclusive=true)
Open the connection to the instrument.
C++ wrapper for NI-VISA: interface definition.
List of errors returned by the instrument.
unsigned short U16
16-bit unsigned integer.
Interface definition for C++ API for Metrolab THM1176/TFM1186.
Exception handling utilities.
VISA Resource Manager class.
virtual bool Initialize()
Initialize the Resource Manager.