10 auto InstrParams = DynExp::dynamic_Params_cast<NIDAQAnalogOut>(Instance.
ParamsGetter());
11 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
13 Instance.
LockObject(InstrParams->HardwareAdapter, InstrData->HardwareAdapter);
14 InstrData->ChannelHandle = InstrData->HardwareAdapter->InitializeAnalogOutChannel(InstrParams->ChannelName.Get(),
24 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
26 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
37 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
40 InstrData->HardwareAdapter->WriteAnalogValues(InstrData->ChannelHandle, SampleStream->ReadSamples(SampleStream->GetStreamSizeRead()));
47 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
48 InstrData->HardwareAdapter->StopTask(InstrData->ChannelHandle);
55 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
57 InstrData->HardwareAdapter->StartTask(InstrData->ChannelHandle);
64 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
66 InstrData->HardwareAdapter->StopTask(InstrData->ChannelHandle);
73 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(Instance.
InstrumentDataGetter());
75 InstrData->HardwareAdapter->RestartTask(InstrData->ChannelHandle);
91 :
AnalogOut(OwnerThreadID, std::move(Params))
97 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(
GetInstrumentData());
98 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
100 return HardwareParams->StreamSizeParams.Values();
105 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(
GetInstrumentData());
106 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
108 return HardwareParams->NumericSampleStreamParams.Values();
113 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(
GetInstrumentData());
115 return InstrData->HardwareAdapter->HasFinishedTask(InstrData->ChannelHandle);
120 bool IsMultisample{};
123 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(
GetInstrumentData());
124 IsMultisample = InstrData->HardwareAdapter->GetTask(InstrData->ChannelHandle)->IsMultisample();
139 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQAnalogOut>(
GetInstrumentData());
141 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
Implementation of an instrument to control a single analog output of the National Instruments NIDAQmx...
Meta instrument for a single analog output port based on the data stream, function generator,...
virtual void SetDefault(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const
Writes AnalogOutParams::DefaultValue to the sample stream. CallbackFunc gets called after the task Da...
void ResetImpl(dispatch_tag< AnalogOutData >) override final
void ConfigureParamsImpl(dispatch_tag< AnalogOutParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
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 ExitFuncImpl(dispatch_tag< AnalogOutTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
void InitFuncImpl(dispatch_tag< AnalogOutTasks::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...
void UpdateFuncImpl(dispatch_tag< AnalogOutTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
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...
constexpr static DataStreamInstrumentData::ValueType HardwareMinValue() noexcept
void ResetImpl(dispatch_tag< AnalogOut >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual NumericSampleStreamParamsExtension::ValueType GetNumericSampleStreamParams() const override
Retrieves sample stream settings of the instrument's data stream from the instrument's or from the un...
virtual void Stop(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enqueues a task to make the underlying hardware adapter stop data acquisition or writing data.
virtual void SetDefault(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Writes AnalogOutParams::DefaultValue to the sample stream. CallbackFunc gets called after the task Da...
virtual void OnErrorChild() const override
Derived classes can perform critical shutdown actions after an error has occurred....
virtual Util::OptionalBool HasFinished() const override
Determines whether the underlying hardware adapter finished data acquisition or writing data.
constexpr static DataStreamInstrumentData::ValueType HardwareMaxValue() noexcept
NIDAQAnalogOut(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
virtual StreamSizeParamsExtension::ValueType GetStreamSizeParams() const override
Retrieves the size of the instrument's data stream from the instrument parameters....
virtual void Start(DynExp::TaskBase::CallbackType CallbackFunc=nullptr) const override
Enqueues a task to make the underlying hardware adapter start 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...
std::function< void(const TaskBase &, ExceptionContainer &)> CallbackType
Type of a callback function which is invoked when a task has finished, failed or has been aborted....
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.
Accumulates include statements to provide a precompiled header.