Scope
|
#include <DAQmxTask.h>
Inherits DAQmx::CDAQmxTask.
Public Member Functions | |
void | CreateAIVoltageChannel (const std::wstring &_devicechannel, const std::wstring &_name=L"", int32 _terminalconfig=DAQmx_Val_Cfg_Default, float64 _minval=-10.0, float64 _maxval=10.0, int32 _units=DAQmx_Val_Volts, const std::wstring &_customscalename=L"") |
void | ConfigureBuffer (const uInt32 &_sampsperchannel) |
int32 | ReadU16 (std::vector< uint16_t > &_data, const int32 &_sampsperchan, const uint32_t &_channels, bool &_timedout, const float64 &_timeout=2) |
int32 | ReadU16Dummy (std::vector< uint16_t > &_data, const int32 &_sampsperchan, const uint32_t &_channels, bool &_timedout, const float64 &_timeout=2) |
int32 | ReadI16 (std::vector< int16_t > &_data, const int32 &_sampsperchan, const uint32_t &_channels, bool &_timedout, const float64 &_timeout=2) |
Public Member Functions inherited from DAQmx::CDAQmxTask | |
~CDAQmxTask (void) | |
void | CreateTask (const std::wstring &_name=L"") |
bool | Created () const |
void | ConfigureImplicitTiming (const int32 &_mode, const int32 &_samplesperchan) |
void | ConfigureSampleTiming (const std::wstring &_src, const float64 &_rate, const int32 &_samplesperchan, const int32 &_samplingtype=DAQmx_Val_ContSamps, const int32 &_actedge=DAQmx_Val_Rising) |
void | ConfigureReferenceClock (const std::wstring &_src, const float64 &_rate) |
void | ConfigureDigStartTrigger (const std::wstring &_src, const int32 &_trigedge=DAQmx_Val_Rising) |
void | Start (void) |
void | Stop (void) |
void | Clear (void) |
bool | IsTaskDone (void) |
int32_t | WaitUntilDone (const float64 &_waittime) |
void | ExportSignal (int32 _signal, const std::wstring &_terminal) |
void | SetWriteOffset (int32 posreltofirst) |
void | SetRegeneration (const bool &_regenerate) |
Protected Attributes | |
std::mersenne_twister< uint32_t, 32, 624, 397, 31, 0x9908b0df, 11, 7, 0x9d2c5680, 15, 0xefc60000, 18 > | mtgen |
Protected Attributes inherited from DAQmx::CDAQmxTask | |
TaskHandle | task_handle |
Wraps a DAQmx Analog Input Task.
Usually the device has int16 internally (since the ranges are +-x volts) If one, however, reads that out as a uin16, positive data is from 0-32767 and all negative data is 0
Definition at line 258 of file DAQmxTask.h.
void DAQmx::CDAQmxAnalogInTask::CreateAIVoltageChannel | ( | const std::wstring & | _devicechannel, |
const std::wstring & | _name = L"" , |
||
int32 | _terminalconfig = DAQmx_Val_Cfg_Default , |
||
float64 | _minval = -10.0 , |
||
float64 | _maxval = 10.0 , |
||
int32 | _units = DAQmx_Val_Volts , |
||
const std::wstring & | _customscalename = L"" |
||
) |
[in] | _devicechannel | channel names on the device |
[in] | _name | name this channel should have |
[in] | _terminalconfig | Input terminal configuration. Possible values are (from NiDAQmx.h):
|
[in] | _minval,_maxval | minimum and maximum expected input signal (changes the digitizer preamp, so choose wisely) |
[in] | _units | Unit type of the input signal. Possible values are (from NiDAQmx.h):
|
[in] | _customscalename | name of a custom defined scale |
Definition at line 312 of file DAQmxTask.cpp.
void DAQmx::CDAQmxAnalogInTask::ConfigureBuffer | ( | const uInt32 & | _sampsperchannel | ) |
Configures input buffer (there is one buffer per channel)
[in] | _sampsperchannel | buffersize per channel |
Definition at line 333 of file DAQmxTask.cpp.
int32 DAQmx::CDAQmxAnalogInTask::ReadU16 | ( | std::vector< uint16_t > & | _data, |
const int32 & | _sampsperchan, | ||
const uint32_t & | _channels, | ||
bool & | _timedout, | ||
const float64 & | _timeout = 2 |
||
) |
[in,out] | _data | int16_t vector to read into |
[in] | _sampsperchan | number of samples to read per channel |
[in] | _channels | number of channels to read from |
[out] | _timedout | true if read timedout (then also returning -1) |
[in] | _timeout | in seconds, wait that long for enough samples to be in the buffer |
scope::ScopeException | on error during read, except time out error |
Definition at line 340 of file DAQmxTask.cpp.
int32 DAQmx::CDAQmxAnalogInTask::ReadU16Dummy | ( | std::vector< uint16_t > & | _data, |
const int32 & | _sampsperchan, | ||
const uint32_t & | _channels, | ||
bool & | _timedout, | ||
const float64 & | _timeout = 2 |
||
) |
Generates random numbers or zeros instead of real read from a device.
[in,out] | _data | int16_t vector to generate into |
[in] | _sampsperchan | number of samples to generate per channel |
[in] | _channels | number of channels to read from |
[out] | _timedout | true if read timedout (then also returning -1) |
[in] | _timeout | in seconds, wait that long for enough samples to be in the buffer |
Definition at line 361 of file DAQmxTask.cpp.
int32 DAQmx::CDAQmxAnalogInTask::ReadI16 | ( | std::vector< int16_t > & | _data, |
const int32 & | _sampsperchan, | ||
const uint32_t & | _channels, | ||
bool & | _timedout, | ||
const float64 & | _timeout = 2 |
||
) |
Reads from a device as signed 16bit integers.
[in,out] | _data | int16_t vector to read into |
[in] | _sampsperchan | number of samples to read per channel |
[in] | _channels | number of channels to read from |
[out] | _timedout | true if read timedout (then also returning -1) |
[in] | _timeout | wait that long for enough samples to be in the buffer |
scope::ScopeException | on error during read, except time out error |
Definition at line 369 of file DAQmxTask.cpp.
|
protected |
For the ReadDummy function which returns random numbers.
Definition at line 263 of file DAQmxTask.h.