16 #define MRPT_HAS_SOME_NIDAQMX (MRPT_HAS_NIDAQMXBASE || MRPT_HAS_NIDAQMX) 18 #define MRPT_USE_NIDAQMXBASE (MRPT_HAS_NIDAQMXBASE && !MRPT_HAS_NIDAQMX) 19 #define MRPT_USE_NIDAQMX (MRPT_HAS_NIDAQMX) 22 #if MRPT_USE_NIDAQMXBASE 23 # include "NIDAQmxBase.h" 30 #if MRPT_USE_NIDAQMXBASE 31 # define MRPT_DAQmxGetExtendedErrorInfo DAQmxBaseGetExtendedErrorInfo 32 # define MRPT_DAQmxCreateTask DAQmxBaseCreateTask 33 # define MRPT_DAQmxCreateAIVoltageChan DAQmxBaseCreateAIVoltageChan 34 # define MRPT_DAQmxCreateAOVoltageChan DAQmxBaseCreateAOVoltageChan 35 # define MRPT_DAQmxCreateDIChan DAQmxBaseCreateDIChan 36 # define MRPT_DAQmxCreateDOChan DAQmxBaseCreateDOChan 37 # define MRPT_DAQmxCreateCIPeriodChan DAQmxBaseCreateCIPeriodChan 38 # define MRPT_DAQmxCreateCICountEdgesChan DAQmxBaseCreateCICountEdgesChan 39 # define MRPT_DAQmxCreateCIPulseWidthChan DAQmxBaseCreateCIPulseWidthChan 40 # define MRPT_DAQmxCreateCILinEncoderChan DAQmxBaseCreateCILinEncoderChan 41 # define MRPT_DAQmxCreateCIAngEncoderChan DAQmxBaseCreateCIAngEncoderChan 42 # define MRPT_DAQmxCreateCOPulseChanFreq DAQmxBaseCreateCOPulseChanFreq 43 # define MRPT_DAQmxCfgSampClkTiming DAQmxBaseCfgSampClkTiming 44 # define MRPT_DAQmxCfgInputBuffer DAQmxBaseCfgInputBuffer 45 # define MRPT_DAQmxCfgOutputBuffer DAQmxBaseCfgOutputBuffer 46 # define MRPT_DAQmxStartTask DAQmxBaseStartTask 47 # define MRPT_DAQmxStopTask DAQmxBaseStopTask 48 # define MRPT_DAQmxClearTask DAQmxBaseClearTask 49 # define MRPT_DAQmxReadAnalogF64 DAQmxBaseReadAnalogF64 50 # define MRPT_DAQmxReadCounterF64 DAQmxBaseReadCounterF64 51 # define MRPT_DAQmxReadDigitalU8 DAQmxBaseReadDigitalU8 52 # define MRPT_DAQmxWriteAnalogF64 DAQmxBaseWriteAnalogF64 53 # define MRPT_DAQmxWriteDigitalU32 DAQmxBaseWriteDigitalU32 54 # define MRPT_DAQmxWriteDigitalLines DAQmxBaseWriteDigitalLines 56 # define MRPT_DAQmxGetExtendedErrorInfo DAQmxGetExtendedErrorInfo 57 # define MRPT_DAQmxCreateTask DAQmxCreateTask 58 # define MRPT_DAQmxCreateAIVoltageChan DAQmxCreateAIVoltageChan 59 # define MRPT_DAQmxCreateAOVoltageChan DAQmxCreateAOVoltageChan 60 # define MRPT_DAQmxCreateDIChan DAQmxCreateDIChan 61 # define MRPT_DAQmxCreateDOChan DAQmxCreateDOChan 62 # define MRPT_DAQmxCreateCIPeriodChan DAQmxCreateCIPeriodChan 63 # define MRPT_DAQmxCreateCICountEdgesChan DAQmxCreateCICountEdgesChan 64 # define MRPT_DAQmxCreateCIPulseWidthChan DAQmxCreateCIPulseWidthChan 65 # define MRPT_DAQmxCreateCILinEncoderChan DAQmxCreateCILinEncoderChan 66 # define MRPT_DAQmxCreateCIAngEncoderChan DAQmxCreateCIAngEncoderChan 67 # define MRPT_DAQmxCreateCOPulseChanFreq DAQmxCreateCOPulseChanFreq 68 # define MRPT_DAQmxCfgSampClkTiming DAQmxCfgSampClkTiming 69 # define MRPT_DAQmxCfgInputBuffer DAQmxCfgInputBuffer 70 # define MRPT_DAQmxCfgOutputBuffer DAQmxCfgOutputBuffer 71 # define MRPT_DAQmxStartTask DAQmxStartTask 72 # define MRPT_DAQmxStopTask DAQmxStopTask 73 # define MRPT_DAQmxClearTask DAQmxClearTask 74 # define MRPT_DAQmxReadAnalogF64 DAQmxReadAnalogF64 75 # define MRPT_DAQmxReadCounterF64 DAQmxReadCounterF64 76 # define MRPT_DAQmxReadDigitalU8 DAQmxReadDigitalU8 77 # define MRPT_DAQmxWriteAnalogF64 DAQmxWriteAnalogF64 78 # define MRPT_DAQmxWriteDigitalU32 DAQmxWriteDigitalU32 79 # define MRPT_DAQmxWriteDigitalLines DAQmxWriteDigitalLines 83 #define MRPT_DAQmx_ErrChk(functionCall) \ 84 if( (functionCall)<0) \ 87 MRPT_DAQmxGetExtendedErrorInfo(errBuff,2048); \ 88 std::string sErr = mrpt::format("DAQ error: '%s'\nCalling: '%s'",errBuff,#functionCall); \ 89 THROW_EXCEPTION(sErr) \ 106 new_obs_available(0),
112 taskHandle(o.taskHandle),
114 read_pipe(o.read_pipe.get()),
115 write_pipe(o.write_pipe.get()),
116 must_close(o.must_close),
117 is_closed(o.is_closed),
118 new_obs_available(0),
130 mrpt::utils::COutputLogger(
"CNationalInstrumentsDAQ")
136 #define MY_LOAD_HERE_CONFIG_VAR(variableName,variableType,targetVariable,configFileObject,sectionNameStr) \ 137 targetVariable = configFileObject.read_##variableType(sectionNameStr,variableName,targetVariable,false); 139 #define MY_LOAD_HERE_CONFIG_VAR_NO_DEFAULT(variableName,variableType,targetVariable,configFileObject,sectionNameStr) \ 141 targetVariable = configFileObject.read_##variableType(sectionNameStr,variableName,targetVariable,true); \ 142 } catch (std::exception &) \ 144 THROW_EXCEPTION( format( "Value for '%s' not found in config file", std::string(variableName).c_str() )); \ 159 const unsigned int nTasks = cfg.
read_uint64_t(sect,
"num_tasks", 0,
true );
161 std::cerr <<
"[CNationalInstrumentsDAQ] Warning: Number of tasks is zero. No datalogging will be done.\n";
165 for (
unsigned int i=0;i<nTasks;i++)
172 const string sChanns = cfg.
read_string(sect,sTask+
string(
".channels"),
"",
true);
173 vector<string> lstStrChanns;
175 if (lstStrChanns.empty())
182 t.taskLabel = cfg.
read_string(sect,sTask+
string(
".taskLabel"), sTask,
false );
184 for (
size_t j=0;j<lstStrChanns.size();j++)
186 if (
strCmpI(lstStrChanns[j],
"ai"))
195 else if (
strCmpI(lstStrChanns[j],
"ao"))
203 else if (
strCmpI(lstStrChanns[j],
"di"))
208 else if (
strCmpI(lstStrChanns[j],
"do"))
213 else if (
strCmpI(lstStrChanns[j],
"ci_period"))
215 t.has_ci_period =
true;
224 else if (
strCmpI(lstStrChanns[j],
"ci_count_edges"))
226 t.has_ci_count_edges =
true;
229 MY_LOAD_HERE_CONFIG_VAR( sTask+
string(
".ci_count_edges.initialCount"),
int,
t.ci_count_edges.initialCount, cfg,sect)
230 MY_LOAD_HERE_CONFIG_VAR( sTask+
string(
".ci_count_edges.countDirection"),
string,
t.ci_count_edges.countDirection, cfg,sect)
232 else if (
strCmpI(lstStrChanns[j],
"ci_pulse_width"))
234 t.has_ci_pulse_width =
true;
241 else if (
strCmpI(lstStrChanns[j],
"ci_lin_encoder"))
243 t.has_ci_lin_encoder =
true;
253 else if (
strCmpI(lstStrChanns[j],
"ci_ang_encoder"))
255 t.has_ci_ang_encoder =
true;
267 else if (
strCmpI(lstStrChanns[j],
"co_pulses"))
269 t.has_co_pulses =
true;
278 THROW_EXCEPTION_FMT(
"Unknown channel type '%s'! See the docs of CNationalInstrumentsDAQ",lstStrChanns[j].c_str())
292 #if MRPT_HAS_SOME_NIDAQMX 294 struct daqmx_str_val {
299 const daqmx_str_val daqmx_vals[] = {
300 {
"DAQmx_Val_Cfg_Default", DAQmx_Val_Cfg_Default },
301 {
"DAQmx_Val_RSE", DAQmx_Val_RSE },
302 {
"DAQmx_Val_NRSE", DAQmx_Val_NRSE },
303 {
"DAQmx_Val_Diff", DAQmx_Val_Diff },
304 {
"DAQmx_Val_Seconds", DAQmx_Val_Seconds },
305 {
"DAQmx_Val_Rising", DAQmx_Val_Rising },
306 {
"DAQmx_Val_Falling", DAQmx_Val_Falling },
307 {
"DAQmx_Val_CountUp", DAQmx_Val_CountUp },
308 {
"DAQmx_Val_CountDown", DAQmx_Val_CountDown },
309 {
"DAQmx_Val_ExtControlled", DAQmx_Val_ExtControlled },
310 {
"DAQmx_Val_AHighBHigh", DAQmx_Val_AHighBHigh },
311 {
"DAQmx_Val_AHighBLow", DAQmx_Val_AHighBLow },
312 {
"DAQmx_Val_ALowBHigh", DAQmx_Val_ALowBHigh },
313 {
"DAQmx_Val_ALowBLow", DAQmx_Val_ALowBLow },
314 {
"DAQmx_Val_X1", DAQmx_Val_X1},
315 {
"DAQmx_Val_X2", DAQmx_Val_X2},
316 {
"DAQmx_Val_X4", DAQmx_Val_X4},
317 {
"DAQmx_Val_Meters", DAQmx_Val_Meters },
318 {
"DAQmx_Val_Inches", DAQmx_Val_Inches },
319 {
"DAQmx_Val_Ticks", DAQmx_Val_Ticks },
320 {
"DAQmx_Val_Degrees", DAQmx_Val_Degrees },
321 {
"DAQmx_Val_Radians", DAQmx_Val_Radians },
322 {
"DAQmx_Val_High", DAQmx_Val_High},
323 {
"DAQmx_Val_Low", DAQmx_Val_Low}
330 for (
unsigned int i=0;i<
sizeof(daqmx_vals)/
sizeof(daqmx_vals[0]);i++)
332 if (
strCmpI(daqmx_vals[i].str,
s.c_str()))
333 return daqmx_vals[i].val;
344 #if MRPT_HAS_SOME_NIDAQMX 358 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&ipt.
taskHandle);
379 tf.
di.
line.c_str(),NULL,DAQmx_Val_ChanPerLine));
383 tf.
douts.
line.c_str(),NULL,DAQmx_Val_ChanPerLine));
391 DAQmx_Val_LowFreq1Ctr,
469 ipt.
read_pipe->timeout_read_start_us = 100000;
470 ipt.
read_pipe->timeout_read_between_us = 100000;
478 catch (std::exception
const &e)
480 std::cerr <<
"[CNationalInstrumentsDAQ] Error:" << std::endl << e.what() << std::endl;
483 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&ipt.
taskHandle);
492 cerr <<
"[CNationalInstrumentsDAQ::initialize] Waiting for the grabbing thread to end due to exception...\n";
494 cerr <<
"[CNationalInstrumentsDAQ::initialize] Grabbing thread ended.\n";
500 std::cerr <<
"[CNationalInstrumentsDAQ] Error while creating tasks. Closing other tasks before returning...\n";
502 std::cerr <<
"[CNationalInstrumentsDAQ] Closing tasks done.\n";
521 if (
m_verbose) cout <<
"[CNationalInstrumentsDAQ::stop] Waiting for grabbing threads to end...\n";
530 if (
m_verbose) cout <<
"[CNationalInstrumentsDAQ::stop] All threads ended.\n";
533 #if MRPT_HAS_SOME_NIDAQMX 536 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&it->taskHandle);
556 std::vector<mrpt::obs::CObservationRawDAQPtr> &outObservations,
557 bool &hardwareError )
559 hardwareError =
false;
560 outObservations.clear();
564 hardwareError =
true;
577 if (it->new_obs_available!=0)
579 it->read_pipe->ReadObject(&tmp_obs);
580 --(it->new_obs_available);
612 std::vector<mrpt::utils::CSerializablePtr> new_obs;
628 #if MRPT_HAS_SOME_NIDAQMX 631 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&ipt.
taskHandle);
632 if (
m_verbose) cout <<
"[CNationalInstrumentsDAQ::grabbing_thread] Starting thread for task " << ipt.
taskHandle <<
"\n";
641 vector<uint8_t> u8Buf;
655 bool there_are_data =
false;
665 dBuf.resize(totalSamplesToRead);
666 int32 pointsReadPerChan=-1;
670 &dBuf[0],dBuf.size(),
671 &pointsReadPerChan,NULL))<0 && err!=DAQmxErrorSamplesNotYetAvailable)
675 else if (pointsReadPerChan>0) {
678 there_are_data =
true;
679 if (
m_verbose) cout <<
"[CNationalInstrumentsDAQ::grabbing_thread] " << pointsReadPerChan <<
" analog samples read.\n";
685 u8Buf.resize(totalSamplesToRead);
687 int32 pointsReadPerChan=-1;
691 &u8Buf[0],u8Buf.size(),
692 &pointsReadPerChan,NULL))<0 && err!=DAQmxErrorSamplesNotYetAvailable)
696 else if (pointsReadPerChan>0) {
699 there_are_data =
true;
700 if (
m_verbose) cout <<
"[CNationalInstrumentsDAQ::grabbing_thread] " << pointsReadPerChan <<
" digital samples read.\n";
706 dBuf.resize(totalSamplesToRead);
707 int32 pointsReadPerChan=-1;
710 totalSamplesToRead,timeout,
711 &dBuf[0],dBuf.size(),
712 &pointsReadPerChan,NULL))<0 && err!=DAQmxErrorSamplesNotYetAvailable)
716 else if (pointsReadPerChan>0) {
725 there_are_data =
true;
730 cout <<
"[CNationalInstrumentsDAQ::grabbing_thread] " << pointsReadPerChan <<
" counter samples read ([0]="<< obs.
CNTRIN_double[0] <<
").\n";
731 if (++decim>100) decim=0;
750 catch(std::exception &e)
752 std::cerr <<
"[CNationalInstrumentsDAQ::grabbing_thread] Exception:\n" << e.what() << std::endl;
754 #endif //MRPT_HAS_SOME_NIDAQMX 762 #if MRPT_HAS_SOME_NIDAQMX 766 std::advance(it, task_index);
768 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&ipt.
taskHandle);
770 int32 samplesWritten=0;
774 nSamplesPerChannel,
FALSE,timeout, groupedByChannel ? DAQmx_Val_GroupByChannel : DAQmx_Val_GroupByScanNumber,
775 const_cast<float64*>(volt_values),
776 &samplesWritten, NULL) )
788 #if MRPT_HAS_SOME_NIDAQMX 792 std::advance(it, task_index);
794 TaskHandle &taskHandle= *
reinterpret_cast<TaskHandle*
>(&ipt.
taskHandle);
796 uInt8 dat = line_value ? 1:0;
798 int32 samplesWritten=0;
799 int32 nSamplesPerChannel = 1;
803 nSamplesPerChannel,
FALSE,timeout, DAQmx_Val_GroupByScanNumber,
804 &dat,&samplesWritten,NULL) )
817 has_ai(false), has_ao(false), has_di(false), has_do(false),
818 has_ci_period(false), has_ci_count_edges(false), has_ci_pulse_width(false), has_ci_lin_encoder(false),has_ci_ang_encoder(false),has_co_pulses(false),
819 samplesPerSecond(1000.0),
820 bufferSamplesPerChannel(200000),
821 samplesPerChannelToRead(1000)
#define ASSERT_EQUAL_(__A, __B)
void appendObservations(const std::vector< mrpt::utils::CSerializablePtr > &obj)
This method must be called by derived classes to enqueue a new observation in the list to be returned...
uint16_t AIN_channel_count
Readings from analog input (ADCs) channels (vector length=channel count) in Volts.
#define MRPT_DAQmxCreateCILinEncoderChan
double sample_rate
Readings from ticks counters, such as quadrature encoders.
Each of the tasks to create in CNationalInstrumentsDAQ::initialize().
#define ASSERT_ABOVE_(__A, __B)
virtual void initialize()
Setup and launch the DAQ tasks, in parallel threads.
#define MRPT_DAQmxCreateDOChan
std::string line
The digital line (for example "Dev1/port0/line1")
This namespace provides a OS-independent interface to many useful functions: filenames manipulation...
#define MRPT_DAQmxCreateCIPulseWidthChan
std::string m_sensorLabel
See CGenericSensor.
#define MRPT_DAQmxStartTask
#define THROW_EXCEPTION(msg)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
#define MRPT_DAQmxCreateAOVoltageChan
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ao_t ao
Analog outputs.
#define MRPT_DAQmxCreateDIChan
mrpt::system::TTimeStamp now()
A shortcut for system::getCurrentTime.
Contains classes for various device interfaces.
std::string taskLabel
(Default="task###")
std::string read_string(const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const
#define MY_LOAD_HERE_CONFIG_VAR_NO_DEFAULT(variableName, variableType, targetVariable, configFileObject, sectionNameStr)
#define MRPT_DAQmxCreateCIPeriodChan
bool checkDAQIsWorking() const
Returns true if initialize() was called and at least one task is running.
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_di_t di
Digital inputs (di)
TaskDescription task
A copy of the original task description that generated this thread.
#define MRPT_DAQmxWriteDigitalLines
#define MRPT_DAQmxReadAnalogF64
void readFromDAQ(std::vector< mrpt::obs::CObservationRawDAQPtr > &outObservations, bool &hardwareError)
Receives data from the DAQ thread(s).
CNationalInstrumentsDAQ()
Constructor.
This class allows loading and storing values and vectors of different types from a configuration text...
void loadConfig_sensorSpecific(const mrpt::utils::CConfigFileBase &configSource, const std::string &iniSection)
See the class documentation at the top for expected parameters.
std::list< TInfoPerTask > m_running_tasks
MRPT_TODO("Modify ping to run on Windows + Test this")
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_do_t douts
Digital outs (do)
#define MRPT_DAQmxWriteAnalogF64
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ci_count_edges_t ci_count_edges
Counter: period of a digital signal.
#define MRPT_UNUSED_PARAM(a)
Can be used to avoid "not used parameters" warnings from the compiler.
std::string sampleClkSource
Sample clock source: may be empty (default value) for some channels.
#define MRPT_DAQmxCreateCIAngEncoderChan
void writeDigitalOutputTask(size_t task_index, bool line_value, double timeout)
Changes the boolean state of one digital output line.
void BASE_IMPEXP sleep(int time_ms) MRPT_NO_THROWS
An OS-independent method for sending the current thread to "sleep" for a given period of time...
#define MRPT_DAQmxCfgInputBuffer
std::auto_ptr< mrpt::synch::CPipeWriteEndPoint > write_pipe
#define MRPT_DAQmxReadCounterF64
This namespace contains representation of robot actions and observations.
std::string countDirection
void stop()
Stop the grabbing threads for DAQ tasks.
#define MY_LOAD_HERE_CONFIG_VAR(variableName, variableType, targetVariable, configFileObject, sectionNameStr)
void grabbing_thread(TInfoPerTask &ipt)
Method to be executed in each parallel thread.
An interface to read from data acquisition boards compatible with National Instruments "DAQmx Base" o...
std::string terminalConfig
bool isClear() const
Returns true if the handle is uninitialized.
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ci_period_t ci_period
Counter: period of a digital signal.
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
bool AIN_interleaved
Whether the channels are interleaved (A0 A1 A2 A0 A1 A2...) or not (A0 A0 A0 A1 A1 A1 A2 A2 A2...
virtual ~CNationalInstrumentsDAQ()
Destructor.
GLsizei const GLchar ** string
#define MRPT_DAQmxStopTask
Store raw data from a Data Acquisition (DAQ) device, such that input or output analog and digital cha...
#define IMPLEMENTS_GENERIC_SENSOR(class_name, NameSpace)
This must be inserted in all CGenericSensor classes implementation files:
void writeAnalogOutputTask(size_t task_index, size_t nSamplesPerChannel, const double *volt_values, double timeout, bool groupedByChannel)
Set voltage outputs to all the outputs in an AOUT task For the meaning of parameters, refere to NI DAQmx docs for DAQmxBaseWriteAnalogF64()
mrpt::synch::CAtomicCounter new_obs_available
std::vector< double > CNTRIN_double
Readings from ticks counters, such as quadrature encoders.
uint32_t bufferSamplesPerChannel
(Default=0) From NI's docs: The number of samples the buffer can hold for each channel in the task...
std::string line
The digital line (for example "Dev1/port0/line1")
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
unsigned __int64 uint64_t
#define MRPT_DAQmxCreateAIVoltageChan
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
std::vector< double > AIN_double
Readings from analog input (ADCs) channels (vector length=channel count) in Volts.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp. Where available, this should contain the accurate satellite-based time...
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ci_ang_encoder_t ci_ang_encoder
Counter: uses an angular encoder to measure angular position.
uint32_t samplesPerChannelToRead
(Default=1000) The number of samples to grab at once from each channel.
std::vector< TaskDescription > task_definitions
Publicly accessible vector with the list of tasks to be launched upon call to CNationalInstrumentsDAQ...
void doProcess()
This method will be invoked at a minimum rate of "process_rate" (Hz)
std::auto_ptr< mrpt::synch::CPipeReadEndPoint > read_pipe
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ai_t ai
Analog inputs.
unsigned int physicalChannelCount
IMPORTANT This must be the total number of channels listed in "physicalChannel" (e.g. 1 for "Dev1/ao0")
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ci_lin_encoder_t ci_lin_encoder
Counter: uses a linear encoder to measure linear position.
#define MRPT_DAQmxCreateCOPulseChanFreq
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_ci_pulse_width_t ci_pulse_width
Counter: measure the width of a digital pulse.
uint64_t read_uint64_t(const std::string §ion, const std::string &name, uint64_t defaultValue, bool failIfNotFound=false) const
#define MRPT_DAQmx_ErrChk(functionCall)
unsigned int physicalChannelCount
IMPORTANT This must be the total number of channels listed in "physicalChannel" (e.g. 4 for "Dev1/ai0:3")
std::string BASE_IMPEXP trim(const std::string &str)
Removes leading and trailing spaces.
#define MRPT_DAQmxClearTask
double samplesPerSecond
Sample clock config: samples per second. Continuous (infinite) sampling is assumed.
std::vector< mrpt::obs::CObservationRawDAQPtr > m_nextObservations
A buffer for doProcess.
std::vector< uint8_t > DIN
Present output values for 16-bit analog output (DACs) channels (vector length=channel count) in volts...
bool BASE_IMPEXP strCmpI(const std::string &s1, const std::string &s2)
Return true if the two strings are equal (case insensitive)
unsigned __int32 uint32_t
std::string physicalChannel
#define ASSERTMSG_(f, __ERROR_MSG)
std::string physicalChannel
void BASE_IMPEXP tokenize(const std::string &inString, const std::string &inDelimiters, std::deque< std::string > &outTokens, bool skipBlankTokens=true) MRPT_NO_THROWS
Tokenizes a string according to a set of delimiting characters.
mrpt::system::TThreadHandle hThread
#define MRPT_DAQmxReadDigitalU8
#define MRPT_DAQmxCfgSampClkTiming
struct HWDRIVERS_IMPEXP mrpt::hwdrivers::CNationalInstrumentsDAQ::TaskDescription::desc_co_pulses_t co_pulses
Output counter: digital pulses output.
#define MRPT_DAQmxCreateCICountEdgesChan
#define MRPT_DAQmxCreateTask
void BASE_IMPEXP joinThread(const TThreadHandle &threadHandle)
Waits until the given thread ends.
static void createPipe(ReadPtr &outReadPipe, WritePtr &outWritePipe)
Creates a new pipe and returns the read & write end-points as newly allocated objects.