irioCoreCpp Library Module  2.1.0
irio::TerminalsDigital Class Reference

Class managing all terminals related to the digital functionality of the RIO device. More...

#include <terminalsDigital.h>

Inheritance diagram for irio::TerminalsDigital:

Public Member Functions

 TerminalsDigital (ParserManager *parserManager, const NiFpga_Session &session, const Platform &platform)
 Manages finding the related digital terminals in the parsed bitfile and reading their values from the FPGA if required. More...
 
bool getDI (const std::uint32_t n) const
 Returns the value of an DI terminal. More...
 
bool getDO (const std::uint32_t n) const
 Returns the value of an DO terminal. More...
 
size_t getNumDI () const
 Returns number of DI terminals found. More...
 
size_t getNumDO () const
 Returns number of DO terminals found. More...
 
void setDO (const std::uint32_t n, const bool value) const
 Writes to a specific DO terminal a value. More...
 
- Public Member Functions inherited from irio::TerminalsBase
 TerminalsBase (std::shared_ptr< TerminalsBaseImpl > impl)
 Base class used for terminals. More...
 

Additional Inherited Members

- Protected Attributes inherited from irio::TerminalsBase
std::shared_ptr< TerminalsBaseImpl > m_impl
 Smart pointer with the terminal implementation.
 

Detailed Description

Class managing all terminals related to the digital functionality of the RIO device.

Definition at line 12 of file terminalsDigital.h.

Constructor & Destructor Documentation

◆ TerminalsDigital()

irio::TerminalsDigital::TerminalsDigital ( ParserManager parserManager,
const NiFpga_Session &  session,
const Platform platform 
)

Manages finding the related digital terminals in the parsed bitfile and reading their values from the FPGA if required.

Parameters
parserManagerPointer to class managing parsing the bitfile and finding its resources
sessionNiFpga_Session to be used in NiFpga related functions
platformPlatform that is using the terminals. Used to know the maximum number of terminals that can be found.

Member Function Documentation

◆ getDI()

bool irio::TerminalsDigital::getDI ( const std::uint32_t  n) const

Returns the value of an DI terminal.

Exceptions
irio::errors::NiFpgaErrorError occurred in an FPGA operation
irio::errors::ResourceNotFoundErrorResource specified not found
Parameters
nNumber of the DI terminal to read
Returns
Value read from the DI terminal

◆ getDO()

bool irio::TerminalsDigital::getDO ( const std::uint32_t  n) const

Returns the value of an DO terminal.

Exceptions
irio::errors::NiFpgaErrorError occurred in an FPGA operation
irio::errors::ResourceNotFoundErrorResource specified not found
Parameters
nNumber of the DO terminal to read
Returns
Value read from the DO terminal

◆ getNumDI()

size_t irio::TerminalsDigital::getNumDI ( ) const

Returns number of DI terminals found.

Returns
Number of DI terminals found

◆ getNumDO()

size_t irio::TerminalsDigital::getNumDO ( ) const

Returns number of DO terminals found.

Returns
Number of DO terminals found

◆ setDO()

void irio::TerminalsDigital::setDO ( const std::uint32_t  n,
const bool  value 
) const

Writes to a specific DO terminal a value.

Exceptions
irio::errors::NiFpgaErrorError occurred in an FPGA operation
irio::errors::ResourceNotFoundErrorResource specified not found
Parameters
nNumber of the DO terminal to write
valueValue to write to the terminal

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