irioCoreCpp Library Module
2.1.0
|
irioCoreCpp main class. More...
#include <irioCoreCpp.h>
Public Member Functions | |
Irio (const std::string &bitfilePath, const std::string &RIOSerialNumber, const std::string &FPGAVIversion, const bool parseVerbose=false) | |
Constructor. More... | |
~Irio () | |
Destructor. More... | |
std::uint32_t | getID () const |
Returns unique identifier. More... | |
void | startFPGA (std::uint32_t timeoutMs=5000) const |
Starts the VI downloaded in the FPGA. More... | |
Platform | getPlatform () const |
Returns the platform detected. More... | |
PROFILE_ID | getProfileID () const |
Returns the selected profile's ID. More... | |
std::string | getRIOSerial () const |
Returns RIO Serial of the device in use. More... | |
std::string | getDeviceModel () const |
Return the device model of the RIO device in use. More... | |
std::string | getLibraryVersion () const |
Return the library version. More... | |
void | setCloseAttribute (std::uint32_t attribute) |
Sets the attribute used when closing the FPGA session. More... | |
std::uint32_t | getCloseAttribute () const |
Gets the attribute used when closing the FPGA session. More... | |
TerminalsCommon | getTerminalsCommon () const |
Terminals. More... | |
TerminalsAnalog | getTerminalsAnalog () const |
Access to the analog group terminals. More... | |
TerminalsDigital | getTerminalsDigital () const |
Access to the digital group terminals. More... | |
TerminalsAuxAnalog | getTerminalsAuxAnalog () const |
Access to the aux analog group terminals. More... | |
TerminalsAuxDigital | getTerminalsAuxDigital () const |
Access to the aux digital group terminals. More... | |
TerminalscRIO | getTerminalsCRIO () const |
Access to the cRIO group terminals. More... | |
TerminalsFlexRIO | getTerminalsFlexRIO () const |
Access to the FlexRIO group terminals. More... | |
TerminalsSignalGeneration | getTerminalsSignalGeneration () const |
Access to the signal generation group terminals. More... | |
TerminalsDMADAQ | getTerminalsDAQ () const |
Access to the DAQ group terminals. More... | |
TerminalsDMAIMAQ | getTerminalsIMAQ () const |
Access to the IMAQ group terminals. More... | |
TerminalsIO | getTerminalsIO () const |
Access to the cRIO IO group terminals. More... | |
Private Member Functions | |
void | initDriver () const |
Initializes the low level library. More... | |
void | closeSession () noexcept |
Closes the session if it has been opened. | |
void | finalizeDriver () const noexcept |
Finalizes the low level library. More... | |
void | openSession (const std::string &bitfilePath, const std::string &signature) |
Opens a session with the specified bitfile and signature. More... | |
void | searchPlatform (ParserManager *parserManager) |
Searches for the TERMINAL_PLATFORM terminal and reads its value. More... | |
void | selectDevProfile (ParserManager *parserManager) |
Searches for the TERMINAL_DEVPROFILE terminals and reads its value. More... | |
Private Attributes | |
const std::string | m_rioSerialNumber |
RIO Serial of the device used. | |
std::string | m_deviceModel |
Device model of the RIO device. | |
std::unique_ptr< Platform > | m_platform |
Platform of the RIO device. | |
std::unique_ptr< ProfileBase > | m_profile |
Profile specified in the bitfile. | |
std::string | m_resourceName |
Name of the RIO device used. Obtained through the serialNumber specified. | |
NiFpga_Session | m_session = 0 |
Session obtained when opening a session using the NiFpga library. | |
std::uint32_t | m_closeAttribute = 0 |
Attribute to use when closing the session with the RIO device. More... | |
irioCoreCpp main class.
Hides the complexity of using the National Instruments low level driver by abstracting several elements from the user. It parses the specified Bitfile and downloads it to the selected RIO device. It also provides the user function to access the terminals and perform read/write operations.
Definition at line 41 of file irioCoreCpp.h.
irio::Irio::Irio | ( | const std::string & | bitfilePath, |
const std::string & | RIOSerialNumber, | ||
const std::string & | FPGAVIversion, | ||
const bool | parseVerbose = false |
||
) |
Constructor.
bitfilePath
)RIOSerialNumber
)irio::errors::RIODeviceNotFoundError | Unable to found a device with the specified RIOSerialNumber |
irio::errors::BFPParseBitfileError | Unable to parse bitfilePath |
irio::errors::ResourceNotFoundError | Some of the necessary resources were not found in the bitfile |
irio::errors::FPGAVIVersionMismatchError | Parsed FPGAVIversion does not match the one specified |
irio::errors::UnsupportedDevProfileError | The DevProfile read does not match any of the supported profiles |
irio::errors::UnsupportedPlatformError | The platform read does not match any of the supported platforms |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
bitfilePath | Bitfile to parse and download |
RIOSerialNumber | RIO Serial Number of the device to use |
FPGAVIversion | Version of the Bitfile. If it does not match the one parsed and exception will be thrown |
parseVerbose | Print discovered resources |
irio::Irio::~Irio | ( | ) |
Destructor.
Closes the session if there is one open and finalizes the low level library.
|
privatenoexcept |
Finalizes the low level library.
If system is CCS, does nothing.
std::uint32_t irio::Irio::getCloseAttribute | ( | ) | const |
Gets the attribute used when closing the FPGA session.
This function retrieves the attribute used in the NiFpga_Close function. This occurs at class destruction.
std::string irio::Irio::getDeviceModel | ( | ) | const |
Return the device model of the RIO device in use.
std::uint32_t irio::Irio::getID | ( | ) | const |
Returns unique identifier.
std::string irio::Irio::getLibraryVersion | ( | ) | const |
Return the library version.
Platform irio::Irio::getPlatform | ( | ) | const |
Returns the platform detected.
The object returned has information about the type of platform along with the max number of resources for such platform
PROFILE_ID irio::Irio::getProfileID | ( | ) | const |
Returns the selected profile's ID.
std::string irio::Irio::getRIOSerial | ( | ) | const |
Returns RIO Serial of the device in use.
TerminalsAnalog irio::Irio::getTerminalsAnalog | ( | ) | const |
Access to the analog group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsAuxAnalog irio::Irio::getTerminalsAuxAnalog | ( | ) | const |
Access to the aux analog group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsAuxDigital irio::Irio::getTerminalsAuxDigital | ( | ) | const |
Access to the aux digital group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsCommon irio::Irio::getTerminalsCommon | ( | ) | const |
Terminals.
Access to the common group terminals
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalscRIO irio::Irio::getTerminalsCRIO | ( | ) | const |
Access to the cRIO group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsDMADAQ irio::Irio::getTerminalsDAQ | ( | ) | const |
Access to the DAQ group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsDigital irio::Irio::getTerminalsDigital | ( | ) | const |
Access to the digital group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsFlexRIO irio::Irio::getTerminalsFlexRIO | ( | ) | const |
Access to the FlexRIO group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsDMAIMAQ irio::Irio::getTerminalsIMAQ | ( | ) | const |
Access to the IMAQ group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsIO irio::Irio::getTerminalsIO | ( | ) | const |
Access to the cRIO IO group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
TerminalsSignalGeneration irio::Irio::getTerminalsSignalGeneration | ( | ) | const |
Access to the signal generation group terminals.
The user must call it to be able to read/write the related terminals.
irio::errors::TerminalNotImplementedError | The selected profile does not have the terminals |
|
private |
Initializes the low level library.
If system is CCS, does nothing.
|
private |
Opens a session with the specified bitfile and signature.
Opens a session to the FPGA, downloading the bitfile if necessary. It does not run the VI, until startFPGA has been called
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
bitfilePath | The path to the bitfile. |
signature | The signature for the session. |
|
private |
Searches for the TERMINAL_PLATFORM terminal and reads its value.
Checks that is a valid value and assigns the equivalent Platform to a variable.
irio::errors::UnsupportedPlatformError | The platform read does not match any of the supported platforms |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
|
private |
Searches for the TERMINAL_DEVPROFILE terminals and reads its value.
Checks that is a valid value for the selected platform and assigns the corresponding profile to a variable. This determines which terminals can the user access.
irio::errors::ResourceNotFoundError | Some of the necessary resources were not found in the bitfile |
irio::errors::UnsupportedDevProfileError | The DevProfile read does not match any of the supported profiles |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
void irio::Irio::setCloseAttribute | ( | std::uint32_t | attribute | ) |
Sets the attribute used when closing the FPGA session.
This function sets the attribute used in the NiFpga_Close function. This occurs at class destruction.
attribute | The attribute value to set. |
void irio::Irio::startFPGA | ( | std::uint32_t | timeoutMs = 5000 | ) | const |
Starts the VI downloaded in the FPGA.
irio::errors::InitializationTimeoutError | InitDone is not ready after a timeout |
irio::errors::ModulesNotOKError | At initialization, the modules are not ready |
irio::errors::NiFpgaFPGAAlreadyRunning | Specified bitfile is already running in the FPGA |
irio::errors::NiFpgaError | Error occurred in an FPGA operation |
timeoutMs | Max time to wait for InitDone to be ready |
|
private |
Attribute to use when closing the session with the RIO device.
By default is 0
Definition at line 375 of file irioCoreCpp.h.