2 #include "InputsDAQmx.h"
3 #include "parameters/IO.h"
4 #include "parameters/Scope.h"
6 #include "helpers/DaqChunk.h"
7 #include "helpers/ScopeException.h"
13 int32_t samplingtype = (_params.
requested_mode() == DaqModeHelper::continuous)?DAQmx_Val_ContSamps:DAQmx_Val_FiniteSamps;
20 , DAQmx_Val_Cfg_Default
21 , -(_inputparams->
range())
22 , (_inputparams->
range()));
26 double pixelrate = 1/(_params.
areas[
area]->daq.pixeltime()*1E-6);
27 double inputrate = pixelrate;
31 uint32_t oversampling = round2ui32(inputrate/pixelrate);
33 uint32_t pixelsperchan = _params.
areas[
area]->Currentframe().TotalPixels();
36 pixelsperchan *= _params.
areas[
area]->daq.requested_frames() * _params.
areas[ThisAreaOrMasterArea(
area)]->daq.averages();
45 if ( DaqTimingHelper::Mode::ReferenceClock == _inputparams->
daq_timing() )
51 standardchunksize = oversampling * std::max(64u*64u, std::min(_params.
areas[
area]->Currentframe().TotalPixels() >> 2, 128u*128u));
73 bool timedout =
false;
75 read =
task.
ReadU16(_chunk.
data, _chunk.PerChannel(), _chunk.NChannels(), timedout, _timeout);
ScopeString commontrigger
The trigger channel which is the internal common master trigger for all devices.
The master parameters class.
void ConfigureReferenceClock(const std::wstring &_src, const float64 &_rate)
Configures the reference clock for the task.
std::array< std::unique_ptr< Area >, SCOPE_NAREAS > areas
holds AreaParameters for all areas.
std::wstring ClockString(const scope::DaqTimingHelper::Mode &_timing, const std::wstring &_externalclocksource)
Generates a string for the sample clock from daq_timing.
std::vector< uint16_t > data
The data vector.
A DaqChunk contains data from all channels sequentially.
This is the include file for standard system include files, or project specific include files that ar...
ScopeValue< DaqMode > requested_mode
requested acquisition mode (see DaqModeHelper)
void Start(void)
Starts the task.
In here all declarations for all kinds of datatypes Scope needs.
void ScopeExceptionHandler(const std::string &_origin, const bool &_log, const bool &_showmessagebox, const bool &_trace, const bool &_rethrow)
Handles all exceptions and does nice logging.
void Clear(void)
Clear the task.
void CreateTask(const std::wstring &_name=L"")
void ConfigureSampleTiming(const std::wstring &_src, const float64 &_rate, const int32 &_samplesperchan, const int32 &_samplingtype=DAQmx_Val_ContSamps, const int32 &_actedge=DAQmx_Val_Rising)
Configures a sample timing for the task.
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 ConfigureDigStartTrigger(const std::wstring &_src, const int32 &_trigedge=DAQmx_Val_Rising)
Configures the start trigger.
void Stop(void)
Stops the task.
int32 ReadU16(std::vector< uint16_t > &_data, const int32 &_sampsperchan, const uint32_t &_channels, bool &_timedout, const float64 &_timeout=2)