RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
Public Member Functions
DAQ::Device Class Referenceabstract

#include <daq.hpp>

Inheritance diagram for DAQ::Device:
Inheritance graph
Collaboration diagram for DAQ::Device:
Collaboration graph

Public Member Functions

 Device (const std::string &dev_name, const std::vector< IO::channel_t > &channels)
 
virtual size_t getChannelCount (ChannelType::type_t type) const =0
 
virtual bool getChannelActive (ChannelType::type_t type, index_t index) const =0
 
virtual int setChannelActive (ChannelType::type_t type, index_t index, bool state)=0
 
virtual size_t getAnalogRangeCount (index_t index) const =0
 
virtual size_t getAnalogReferenceCount (index_t index) const =0
 
virtual size_t getAnalogUnitsCount (index_t index) const =0
 
virtual size_t getAnalogDownsample (ChannelType::type_t type, index_t index) const =0
 
virtual std::string getAnalogRangeString (ChannelType::type_t type, index_t index, index_t range) const =0
 
virtual std::string getAnalogReferenceString (ChannelType::type_t type, index_t index, index_t reference) const =0
 
virtual std::string getAnalogUnitsString (ChannelType::type_t type, index_t index, index_t units) const =0
 
virtual double getAnalogGain (ChannelType::type_t type, index_t index) const =0
 
virtual double getAnalogZeroOffset (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogRange (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogReference (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogUnits (ChannelType::type_t type, index_t index) const =0
 
virtual index_t getAnalogOffsetUnits (ChannelType::type_t type, index_t index) const =0
 
virtual int setAnalogGain (ChannelType::type_t type, index_t index, double gain)=0
 
virtual int setAnalogRange (ChannelType::type_t type, index_t index, index_t range)=0
 
virtual int setAnalogZeroOffset (ChannelType::type_t type, index_t index, double offset)=0
 
virtual int setAnalogReference (ChannelType::type_t type, index_t index, index_t reference)=0
 
virtual int setAnalogUnits (ChannelType::type_t type, index_t index, index_t units)=0
 
virtual int setAnalogOffsetUnits (ChannelType::type_t type, index_t index, index_t units)=0
 
virtual int setAnalogDownsample (ChannelType::type_t type, index_t index, size_t downsample)=0
 
virtual int setAnalogCounter (ChannelType::type_t type, index_t index)=0
 
virtual int setAnalogCalibrationValue (ChannelType::type_t type, index_t index, double value)=0
 
virtual double getAnalogCalibrationValue (ChannelType::type_t type, index_t index) const =0
 
virtual int setAnalogCalibrationActive (ChannelType::type_t type, index_t index, bool state)=0
 
virtual bool getAnalogCalibrationActive (ChannelType::type_t type, index_t index) const =0
 
virtual bool getAnalogCalibrationState (ChannelType::type_t type, index_t index) const =0
 
virtual int setDigitalDirection (index_t index, direction_t direction)=0
 
- 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
 
virtual void read ()=0
 
virtual void write ()=0
 
- 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

Object that represents a single DAQ card.

Definition at line 130 of file daq.hpp.

Constructor & Destructor Documentation

◆ Device()

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

The constructor needs to be provided with a specification of its channels that will be passed to the inherited IO::Block.

See also
IO::Block

Definition at line 139 of file daq.hpp.

Member Function Documentation

◆ getAnalogCalibrationActive()

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

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.

Implemented in Device.

◆ getAnalogCalibrationState()

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

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.

Implemented in Device.

◆ getAnalogCalibrationValue()

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

Get the calibration of the selected channel.

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

Implemented in Device.

◆ getAnalogDownsample()

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

Implemented in Device.

◆ getAnalogGain()

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

Get the gain of the selected channel.

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

Implemented in Device.

◆ getAnalogOffsetUnits()

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

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.

Implemented in Device.

◆ getAnalogRange()

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

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.

Implemented in Device.

◆ getAnalogRangeCount()

virtual size_t DAQ::Device::getAnalogRangeCount(index_t index)const
pure virtual

Get the number of available ranges for the specified channel.

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

Implemented in Device.

◆ getAnalogRangeString()

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

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.

Implemented in Device.

◆ getAnalogReference()

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

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.

Implemented in Device.

◆ getAnalogReferenceCount()

virtual size_t DAQ::Device::getAnalogReferenceCount(index_t index)const
pure virtual

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.

Implemented in Device.

◆ getAnalogReferenceString()

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

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.

Implemented in Device.

◆ getAnalogUnits()

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

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.

Implemented in Device.

◆ getAnalogUnitsCount()

virtual size_t DAQ::Device::getAnalogUnitsCount(index_t index)const
pure virtual

Get the number of available units for the channel.

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

Implemented in Device.

◆ getAnalogUnitsString()

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

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.

Implemented in Device.

◆ getAnalogZeroOffset()

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

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.

Implemented in Device.

◆ getChannelActive()

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

Get the channel's active state.

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

Implemented in Device.

◆ getChannelCount()

virtual size_t DAQ::Device::getChannelCount(ChannelType::type_t type)const
pure virtual

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.

Implemented in Device.

◆ setAnalogCalibrationActive()

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

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.

Implemented in Device.

◆ setAnalogCalibrationValue()

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

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.

Implemented in Device.

◆ setAnalogCounter()

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

Implemented in Device.

◆ setAnalogDownsample()

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

Implemented in Device.

◆ setAnalogGain()

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

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.

Implemented in Device.

◆ setAnalogOffsetUnits()

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

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.

Implemented in Device.

◆ setAnalogRange()

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

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.

Implemented in Device.

◆ setAnalogReference()

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

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.

Implemented in Device.

◆ setAnalogUnits()

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

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.

Implemented in Device.

◆ setAnalogZeroOffset()

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

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.

Implemented in Device.

◆ setChannelActive()

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

Set the channel's active state.

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

Implemented in Device.

◆ setDigitalDirection()

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

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.

Implemented in AnalogyDevice, and Device.


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