10 auto InstrParams = DynExp::dynamic_Params_cast<NIDAQAnalogIn>(Instance.
ParamsGetter());
11 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
13 Instance.
LockObject(InstrParams->HardwareAdapter, InstrData->HardwareAdapter);
14 InstrData->ChannelHandle = InstrData->HardwareAdapter->InitializeAnalogInChannel(InstrParams->ChannelName.Get(),
24 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
26 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
37 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
40 SampleStream->
WriteSamples(InstrData->HardwareAdapter->ReadAnalogValues(InstrData->ChannelHandle));
47 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
49 InstrData->HardwareAdapter->StartTask(InstrData->ChannelHandle);
56 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
58 InstrData->HardwareAdapter->StopTask(InstrData->ChannelHandle);
65 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(Instance.
InstrumentDataGetter());
67 InstrData->HardwareAdapter->RestartTask(InstrData->ChannelHandle);
80 {
"Default terminal configuration chosen by NI DAQ at run time", TerminalConfigType::Default },
81 {
"Referenced single-ended terminal configuration", TerminalConfigType::RSE },
82 {
"Non-referenced single-ended terminal configuration", TerminalConfigType::NRSE },
83 {
"Differential terminal configuration", TerminalConfigType::Diff },
84 {
"Pseudodifferential terminal configuration", TerminalConfigType::PseudoDiff }
96 :
AnalogIn(OwnerThreadID, std::move(Params))
102 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(
GetInstrumentData());
103 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
105 return HardwareParams->StreamSizeParams.Values();
110 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(
GetInstrumentData());
111 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
113 return HardwareParams->NumericSampleStreamParams.Values();
118 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(
GetInstrumentData());
120 return InstrData->HardwareAdapter->HasFinishedTask(InstrData->ChannelHandle);
125 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogIn>(
GetInstrumentData());
127 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
Implementation of an instrument to control a single analog input of the National Instruments NIDAQmx ...
Meta instrument for a single analog input port based on the data stream and generic input port meta i...
void WriteSamples(const std::vector< T > &Samples)
Writes multiple samples to the stream's buffer StreamBuffer.
void ResetImpl(dispatch_tag< AnalogInData >) override final
static Util::TextValueListType< TerminalConfigType > TerminalConfigTypeStrList()
void ConfigureParamsImpl(dispatch_tag< AnalogInParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
void ExitFuncImpl(dispatch_tag< AnalogInTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
void InitFuncImpl(dispatch_tag< AnalogInTasks::InitTask >, DynExp::InstrumentInstance &Instance) override final
Initializes the respective instrument within the instrument inheritance hierarchy....
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
virtual DynExp::TaskResultType RunChild(DynExp::InstrumentInstance &Instance) override
Runs the task. Override RunChild() to define a derived task's action(s). Any exception leaving RunChi...
void UpdateFuncImpl(dispatch_tag< AnalogInTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual void OnErrorChild() const override
Derived classes can perform critical shutdown actions after an error has occurred....
virtual StreamSizeParamsExtension::ValueType GetStreamSizeParams() const override
Retrieves the size of the instrument's data stream from the instrument parameters....
constexpr static DataStreamInstrumentData::ValueType HardwareMinValue() noexcept
virtual NumericSampleStreamParamsExtension::ValueType GetNumericSampleStreamParams() const override
Retrieves sample stream settings of the instrument's data stream from the instrument's or from the un...
NIDAQAnalogIn(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
void ResetImpl(dispatch_tag< AnalogIn >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
constexpr static DataStreamInstrumentData::ValueType HardwareMaxValue() noexcept
virtual Util::OptionalBool HasFinished() const override
Determines whether the underlying hardware adapter finished data acquisition or writing data.
Type containing the values of all the parameters belonging to NumericSampleStreamParamsExtension.
Implements a circular data stream based on Util::circularbuf using samples of an arithmetic type Samp...
Type containing the values of all the parameters belonging to StreamSizeParamsExtension.
Refer to DynExp::ParamsBase::dispatch_tag.
Refer to DynExp::ParamsBase::dispatch_tag.
InstrumentDataTypeSyncPtrType GetInstrumentData(const std::chrono::milliseconds Timeout=GetInstrumentDataTimeoutDefault)
Locks the mutex of the instrument data class instance InstrumentData assigned to this InstrumentBase ...
Refer to ParamsBase::dispatch_tag.
Defines data for a thread belonging to a InstrumentBase instance. Refer to RunnableInstance.
const InstrumentBase::InstrumentDataGetterType InstrumentDataGetter
Getter for instrument's data. Refer to InstrumentBase::InstrumentDataGetterType.
Refer to ParamsBase::dispatch_tag.
Tag for function dispatching mechanism within this class used when derived classes are not intended t...
const Object::ParamsGetterType ParamsGetter
Invoke to obtain the parameters (derived from ParamsBase) of Owner.
void UnlockObject(LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer)
Unlocks an Object instance stored in the LinkedObjectWrapperContainer ObjectWrapperContainer....
void LockObject(const ParamsBase::Param< ObjectLink< ObjectT >> &LinkParam, LinkedObjectWrapperContainer< ObjectT > &ObjectWrapperContainer, std::chrono::milliseconds Timeout=ObjectLinkBase::LockObjectTimeoutDefault)
Locks an Object instance referenced by a parameter LinkParam of type ParamsBase::Param< ObjectLink< O...
Defines the return type of task functions.
Refer to DynExp::ParamsBase::dispatch_tag.
Data type which stores an optional bool value (unknown, false, true). The type evaluates to bool whil...
DynExp's instrument namespace contains the implementation of DynExp instruments which extend DynExp's...
std::unique_ptr< ParamsBase > ParamsBasePtrType
Alias for a pointer to the parameter system base class ParamsBase.
std::vector< std::pair< TextType, ValueType > > TextValueListType
Type of a list containing key-value pairs where key is a text of type Util::TextType.
Accumulates include statements to provide a precompiled header.