10 auto InstrParams = DynExp::dynamic_Params_cast<NIDAQDigitalIn>(Instance.
ParamsGetter());
11 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
13 Instance.
LockObject(InstrParams->HardwareAdapter, InstrData->HardwareAdapter);
14 InstrData->ChannelHandle = InstrData->HardwareAdapter->InitializeDigitalInChannel(InstrParams->ChannelName.Get(), 0);
23 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
25 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
36 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
39 SampleStream->
WriteSamples(InstrData->HardwareAdapter->ReadDigitalValues(InstrData->ChannelHandle));
46 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
48 InstrData->HardwareAdapter->StartTask(InstrData->ChannelHandle);
55 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
57 InstrData->HardwareAdapter->StopTask(InstrData->ChannelHandle);
64 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(Instance.
InstrumentDataGetter());
66 InstrData->HardwareAdapter->RestartTask(InstrData->ChannelHandle);
82 :
DigitalIn(OwnerThreadID, std::move(Params))
88 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(
GetInstrumentData());
89 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
91 return HardwareParams->StreamSizeParams.Values();
96 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(
GetInstrumentData());
97 auto HardwareParams = dynamic_Params_cast<DynExpHardware::NIDAQHardwareAdapter>(InstrData->HardwareAdapter->GetParams());
99 return HardwareParams->NumericSampleStreamParams.Values();
104 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(
GetInstrumentData());
106 return InstrData->HardwareAdapter->HasFinishedTask(InstrData->ChannelHandle);
111 auto InstrData = DynExp::dynamic_InstrumentData_cast<NIDAQDigitalIn>(
GetInstrumentData());
113 InstrData->HardwareAdapter->DeregisterChannel(InstrData->ChannelHandle);
Implementation of an instrument to control a single digital input of the National Instruments NIDAQmx...
void WriteSamples(const std::vector< T > &Samples)
Writes multiple samples to the stream's buffer StreamBuffer.
Meta instrument for a single digital input port based on the data stream and generic input port meta ...
void ResetImpl(dispatch_tag< DigitalInData >) override final
void ConfigureParamsImpl(dispatch_tag< DigitalInParams >) override final
Called by DynExp::ParamsBase::ConfigureParams() as a starting point for the tag dispatch mechanism to...
void ExitFuncImpl(dispatch_tag< DigitalInTasks::ExitTask >, DynExp::InstrumentInstance &Instance) override final
Deinitializes the respective instrument within the instrument inheritance hierarchy....
void InitFuncImpl(dispatch_tag< DigitalInTasks::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< DigitalInTasks::UpdateTask >, DynExp::InstrumentInstance &Instance) override final
Updates the respective instrument within the instrument inheritance hierarchy. Call UpdateFuncImpl() ...
virtual StreamSizeParamsExtension::ValueType GetStreamSizeParams() const override
Retrieves the size of the instrument's data stream from the instrument parameters....
virtual Util::OptionalBool HasFinished() const override
Determines whether the underlying hardware adapter finished data acquisition or writing data.
virtual NumericSampleStreamParamsExtension::ValueType GetNumericSampleStreamParams() const override
Retrieves sample stream settings of the instrument's data stream from the instrument's or from the un...
NIDAQDigitalIn(const std::thread::id OwnerThreadID, DynExp::ParamsBasePtrType &&Params)
void ResetImpl(dispatch_tag< DigitalIn >) override final
Refer to DynExp::Object::Reset(). Using tag dispatch mechanism to ensure that ResetImpl() of every de...
virtual void OnErrorChild() const override
Derived classes can perform critical shutdown actions after an error has occurred....
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.
Accumulates include statements to provide a precompiled header.