RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
Public Member Functions
Device Class Referencefinal
Inheritance diagram for Device:
Inheritance graph
Collaboration diagram for Device:
Collaboration graph

Public Member Functions

 Device (const Device &)=default
 
 Device (Device &&)=delete
 
Deviceoperator= (const Device &)=delete
 
Deviceoperator= (Device &&)=delete
 
 Device (const std::string &dev_name, const std::vector< IO::channel_t > &channels, std::string internal_name)
 
 ~Device () final
 
size_t getChannelCount (DAQ::ChannelType::type_t type) const final
 
bool getChannelActive (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
int setChannelActive (DAQ::ChannelType::type_t type, DAQ::index_t index, bool state) final
 
size_t getAnalogRangeCount (DAQ::index_t index) const final
 
size_t getAnalogReferenceCount (DAQ::index_t index) const final
 
size_t getAnalogUnitsCount (DAQ::index_t index) const final
 
size_t getAnalogDownsample (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
std::string getAnalogRangeString (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t range) const final
 
std::string getAnalogReferenceString (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t reference) const final
 
std::string getAnalogUnitsString (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t units) const final
 
double getAnalogGain (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
double getAnalogZeroOffset (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
DAQ::index_t getAnalogRange (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
DAQ::index_t getAnalogReference (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
DAQ::index_t getAnalogUnits (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
DAQ::index_t getAnalogOffsetUnits (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
int setAnalogGain (DAQ::ChannelType::type_t type, DAQ::index_t index, double gain) final
 
int setAnalogRange (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t range) final
 
int setAnalogZeroOffset (DAQ::ChannelType::type_t type, DAQ::index_t index, double offset) final
 
int setAnalogReference (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t reference) final
 
int setAnalogUnits (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t units) final
 
int setAnalogOffsetUnits (DAQ::ChannelType::type_t type, DAQ::index_t index, DAQ::index_t units) final
 
int setAnalogDownsample (DAQ::ChannelType::type_t type, DAQ::index_t index, size_t downsample) final
 
int setAnalogCounter (DAQ::ChannelType::type_t type, DAQ::index_t index) final
 
int setAnalogCalibrationValue (DAQ::ChannelType::type_t type, DAQ::index_t index, double value) final
 
double getAnalogCalibrationValue (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
int setAnalogCalibrationActive (DAQ::ChannelType::type_t type, DAQ::index_t index, bool state) final
 
bool getAnalogCalibrationActive (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
bool getAnalogCalibrationState (DAQ::ChannelType::type_t type, DAQ::index_t index) const final
 
int setDigitalDirection (DAQ::index_t index, DAQ::direction_t direction) final
 
void read () final
 
void write () final
 
- Public Member Functions inherited from DAQ::Device
 Device (const std::string &dev_name, const std::vector< IO::channel_t > &channels)
 
- Public Member Functions inherited from RT::Device
 Device (std::string n, const std::vector< IO::channel_t > &c)
 
 Device (const Device &)=default
 
Deviceoperator= (const Device &)=default
 
 Device (Device &&)=delete
 
Deviceoperator= (Device &&)=delete
 
 ~Device () override=default
 
- Public Member Functions inherited from IO::Block
 Block (std::string blockname, const std::vector< channel_t > &channels, bool isdependent)
 
 Block (const Block &block)=default
 
Blockoperator= (const Block &block)=default
 
 Block (Block &&)=delete
 
Blockoperator= (Block &&)=delete
 
virtual ~Block ()=default
 
std::string getName () const
 
size_t getCount (flags_t type) const
 
std::string getChannelName (IO::flags_t type, size_t index) const
 
std::string getChannelDescription (IO::flags_t type, size_t index) const
 
void writeinput (size_t index, const double &data)
 
const double & readPort (IO::flags_t direction, size_t index)
 
bool dependent () const
 
bool getActive () const
 
void setActive (bool act)
 
void assignID (size_t block_id)
 
size_t getID () const
 

Additional Inherited Members

- Protected Member Functions inherited from IO::Block
double & readinput (size_t index)
 
void writeoutput (size_t index, const double &data)
 

Detailed Description

Definition at line 200 of file nidaq_driver.cpp.

Constructor & Destructor Documentation

◆ Device() [1/3]

Device::Device(const Device)
default

◆ Device() [2/3]

Device::Device(Device && )
delete

◆ Device() [3/3]

Device::Device(const std::string & dev_name,
const std::vector< IO::channel_t > & channels,
std::string internal_name 
)

Definition at line 311 of file nidaq_driver.cpp.

Here is the call graph for this function:

◆ ~Device()

Device::~Device()
final

Definition at line 373 of file nidaq_driver.cpp.

Member Function Documentation

◆ getAnalogCalibrationActive()

bool Device::getAnalogCalibrationActive(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the channel's active state of using its calibration.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state of using its calibration.

Implements DAQ::Device.

Definition at line 681 of file nidaq_driver.cpp.

◆ getAnalogCalibrationState()

bool Device::getAnalogCalibrationState(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the channel's state of calibration.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state of using its calibration.

Implements DAQ::Device.

Definition at line 686 of file nidaq_driver.cpp.

◆ getAnalogCalibrationValue()

double Device::getAnalogCalibrationValue(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the calibration of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
the calibration value for the channel.

Implements DAQ::Device.

Definition at line 670 of file nidaq_driver.cpp.

◆ getAnalogDownsample()

size_t Device::getAnalogDownsample(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Implements DAQ::Device.

Definition at line 475 of file nidaq_driver.cpp.

◆ getAnalogGain()

double Device::getAnalogGain(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the gain of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The gain of the selected channel.

Implements DAQ::Device.

Definition at line 535 of file nidaq_driver.cpp.

◆ getAnalogOffsetUnits()

DAQ::index_t Device::getAnalogOffsetUnits(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the index of the units for the selected channel zero offset.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's offset units or INVALID on error.

Implements DAQ::Device.

Definition at line 581 of file nidaq_driver.cpp.

◆ getAnalogRange()

DAQ::index_t Device::getAnalogRange(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the index of the range for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's range or INVALID on error.

Implements DAQ::Device.

Definition at line 553 of file nidaq_driver.cpp.

◆ getAnalogRangeCount()

size_t Device::getAnalogRangeCount(DAQ::index_t index)const
finalvirtual

Get the number of available ranges for the specified channel.

Parameters
indexThe channel's index.
Returns
The number of available ranges for the channel.

Implements DAQ::Device.

Definition at line 460 of file nidaq_driver.cpp.

◆ getAnalogRangeString()

std::string Device::getAnalogRangeString(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t range 
)const
finalvirtual

Get a string representation of the specified range.

Parameters
typeThe channel's type.
indexThe channel's index.
rangeThe index of the channel's range.
Returns
The string representation of the selected range.

Implements DAQ::Device.

Definition at line 481 of file nidaq_driver.cpp.

◆ getAnalogReference()

DAQ::index_t Device::getAnalogReference(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the index of the reference for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's reference or INVALID on error.

Implements DAQ::Device.

Definition at line 562 of file nidaq_driver.cpp.

◆ getAnalogReferenceCount()

size_t Device::getAnalogReferenceCount(DAQ::index_t index)const
finalvirtual

Get the number of available reference for the specified channel.

\patam index The channel's index.

Returns
The number of available references for the channel.

Implements DAQ::Device.

Definition at line 465 of file nidaq_driver.cpp.

◆ getAnalogReferenceString()

std::string Device::getAnalogReferenceString(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t reference 
)const
finalvirtual

Get a string representation of the specified reference.

Parameters
typeThe channel's type.
indexThe channel's index.
referenceThe index of the channel's reference.
Returns
The string representation of the selected reference.

Implements DAQ::Device.

Definition at line 495 of file nidaq_driver.cpp.

◆ getAnalogUnits()

DAQ::index_t Device::getAnalogUnits(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the index of the units for the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The index of the channel's units or INVALID on error.

Implements DAQ::Device.

Definition at line 572 of file nidaq_driver.cpp.

◆ getAnalogUnitsCount()

size_t Device::getAnalogUnitsCount(DAQ::index_t index)const
finalvirtual

Get the number of available units for the channel.

Parameters
indexThe channel's index.
Returns
The number of available units for the channel.

Implements DAQ::Device.

Definition at line 470 of file nidaq_driver.cpp.

◆ getAnalogUnitsString()

std::string Device::getAnalogUnitsString(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)const
finalvirtual

Get a string representation of the specified units.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe index of the channel's units.
Returns
The string representation of the selected units.

Implements DAQ::Device.

Definition at line 524 of file nidaq_driver.cpp.

◆ getAnalogZeroOffset()

double Device::getAnalogZeroOffset(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the offset of the selected channel that makes the signal zero

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The zero offset of the selected channel.

Implements DAQ::Device.

Definition at line 544 of file nidaq_driver.cpp.

◆ getChannelActive()

bool Device::getChannelActive(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)const
finalvirtual

Get the channel's active state.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
The channel's active state.

Implements DAQ::Device.

Definition at line 386 of file nidaq_driver.cpp.

◆ getChannelCount()

size_t Device::getChannelCount(DAQ::ChannelType::type_t type)const
finalvirtual

Get the number of channels of the specified type.

Parameters
typeThe type of the channels to be counted.
Returns
The number of channels of the specified type.

Implements DAQ::Device.

Definition at line 381 of file nidaq_driver.cpp.

◆ operator=() [1/2]

Device& Device::operator=(const Device)
delete

◆ operator=() [2/2]

Device& Device::operator=(Device && )
delete

◆ read()

void Device::read(void )
finalvirtual

Function called by the realtime task at the beginning of each period.

See also
RT::System

Implements RT::Device.

Definition at line 698 of file nidaq_driver.cpp.

Here is the call graph for this function:

◆ setAnalogCalibrationActive()

int Device::setAnalogCalibrationActive(DAQ::ChannelType::type_t type,
DAQ::index_t index,
bool state 
)
finalvirtual

Set the calibration active state of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 675 of file nidaq_driver.cpp.

◆ setAnalogCalibrationValue()

int Device::setAnalogCalibrationValue(DAQ::ChannelType::type_t type,
DAQ::index_t index,
double value 
)
finalvirtual

Set the calibration of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
valueThe calibration value.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 664 of file nidaq_driver.cpp.

◆ setAnalogCounter()

int Device::setAnalogCounter(DAQ::ChannelType::type_t type,
DAQ::index_t index 
)
finalvirtual

Implements DAQ::Device.

Definition at line 659 of file nidaq_driver.cpp.

◆ setAnalogDownsample()

int Device::setAnalogDownsample(DAQ::ChannelType::type_t type,
DAQ::index_t index,
size_t downsample 
)
finalvirtual

Implements DAQ::Device.

Definition at line 652 of file nidaq_driver.cpp.

◆ setAnalogGain()

int Device::setAnalogGain(DAQ::ChannelType::type_t type,
DAQ::index_t index,
double gain 
)
finalvirtual

Set the gain of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
gainThe channel's new gain.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 590 of file nidaq_driver.cpp.

◆ setAnalogOffsetUnits()

int Device::setAnalogOffsetUnits(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)
finalvirtual

Set the offset units of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe channel's new offset units index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 645 of file nidaq_driver.cpp.

◆ setAnalogRange()

int Device::setAnalogRange(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t range 
)
finalvirtual

Set the range of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
rangeThe channel's new range index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 601 of file nidaq_driver.cpp.

◆ setAnalogReference()

int Device::setAnalogReference(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t reference 
)
finalvirtual

Set the reference of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
referenceThe channel's new reference index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 623 of file nidaq_driver.cpp.

◆ setAnalogUnits()

int Device::setAnalogUnits(DAQ::ChannelType::type_t type,
DAQ::index_t index,
DAQ::index_t units 
)
finalvirtual

Set the units of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
unitsThe channel's new units index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 634 of file nidaq_driver.cpp.

◆ setAnalogZeroOffset()

int Device::setAnalogZeroOffset(DAQ::ChannelType::type_t type,
DAQ::index_t index,
double offset 
)
finalvirtual

Set the zero offset of the selected channel.

Parameters
typeThe channel's type.
indexThe channel's index.
offsetThe channel's new zero offset index.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 612 of file nidaq_driver.cpp.

◆ setChannelActive()

int Device::setChannelActive(DAQ::ChannelType::type_t type,
DAQ::index_t index,
bool state 
)
finalvirtual

Set the channel's active state.

Parameters
typeThe channel's type.
indexThe channel's index.
stateThe channel's new state.

Implements DAQ::Device.

Definition at line 392 of file nidaq_driver.cpp.

Here is the call graph for this function:

◆ setDigitalDirection()

int Device::setDigitalDirection(DAQ::index_t index,
DAQ::direction_t direction 
)
finalvirtual

Set the direction of the specified digital channel.

Parameters
indexThe digital channel's index.
directionThe digital channel's new direction.
Returns
0 if successful or a negative value on error.

Implements DAQ::Device.

Definition at line 692 of file nidaq_driver.cpp.

◆ write()

void Device::write(void )
finalvirtual

Function called by the realtime task at the end of each period.

See also
RT::System

Implements RT::Device.

Definition at line 740 of file nidaq_driver.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following file: