irioCoreCpp Library Module
2.1.0
|
National Instruments RIO devices are data acquisition devices implemented using field-programmable gate arrays (FPGAs). This project aims to facilitate their use by providing a series of classes and methods to simplify the interface with these devices.
There are three RIO devices: FlexRIO, compactRIO and RSeries. Each of these devices has a XILINX FPGA at its core, which can be reconfigured in virtually an infinite number of implementations. This renders it challenging, if not impossible, to entirely abstract the user from the specific implementation being used. While designing the C++ library, efforts were made to avoid possible problems. However, no all cases were to fully covered.
The recommended way is to download the appropiate packages from the release section.
The requires packages for compiling the project are:
If the generation of the documentation is required, it is also necessary to have installed the following packages:
To compile the project go to the root folder and execute:
This will compile the libraries, unittests, functional tests and examples.
rpm
).alien
(See Converting RPM packages to deb), but this has not been tested throughly.To genearte the rpm go to the root folder and execute:
This will generate rpm files in target/packages/
/usr/local/lib
: Libraries/usr/local/include
: Header filesIt is also possible to set the installation directory for the files once the rpm are installed by using the parameter InstallDir
Libraries will be placed in <InstallDir>/lib
and headers in <InstallDir>/include
. If InstallDir
is not set, it defaults to /usr/local
, unless CODAC_ROOT
is set, in which case InstallDir
will use the value of CODAC_ROOT
alien
package. target/packages/x86_64
alien
command: ``` sudo alien -c *.rpm ``
The
.deb` packages will be generated in the same folderIn order toaccess and install the required packages of National Instrument, it is recommended to add the pacakge repository. The following list explains how to do this:
The project contains several tests to try to test irioCoreCpp and its C wrapper. It has unit tests, to check each part of the application, as wll as functional tests, to verify the functionality of the entire application.
There are two ways to execute these tests, thorugh the use of XML and a Python script or running the GoogleTest manually
Tests can be automatically executed with a Python application. By default, the target/test/test-suites
folder contains the unitary tests that do not run on the real hardware.
The functional tests that run on actual hardware must be generated with the generateFunctional.py
application located in the target/test/test-suites
folder. This application can be run in two ways:
-h
flag.This application supports the selection of the input and output folders with the -i
and -o
flags, but the default behaviour (input from test-suites/templates
and output to test-suites
) is recommended.
Custom test suites can also be created following the schema on target/test/testSchema.xsd
. For example, to create a test that runs all the FlexRIO tests of the irioCore Funcional binary on a FlexRIO-7966 that has the serial 0x12345678 and no module attached is:
A testplan is a collection of tests to be run. The different tests inside will be run independently and the results are reported separetely. Each test contains the following fields:
7966
is used.0x00000000
is used.Once the test is defined on the XML file, from the root of the project, run:
Either -a
or -o <Output file>
can be used to select the output destination for the tests. -a
will append the results to the input file and -o
will create or rewrite the destination file with the results.
The test output will be printed as specified on the verbose field of the test. If only a final summary is required, use the -S flag to supress test output and display a final count only.
The same python application can be used to execute tests with custom filters. Use the help of the executable to get the possible arguments for the test:
--input-file
or -i
flag is present, the custom run arguments will be ignored and the tests from the XML will be run.A test report can be generated with the -o <FILE>
argument, and it will be generated on the same format as the XML files on the previous section.
For example, in order to run the functional FlexRIO tests from the irioCore library on a 7966 with the serial number 0x1234ABCD with full verbosity and creating a report on test.xml, use:
Test are in the following folder. Test should be run from this directory.
To execute all the tests, run:
To execute specific tests use gtest filter functionality
--gtest_list_tests
Test are in the following folder. Test should be run from this directory.
To execute all the tests, run:
To execute specific tests use gtest filter functionality
--gtest_list_tests
Test are in the following folder. Test should be run from this directory.
To execute all the tests, run:
To execute specific tests use gtest filter functionality
--gtest_list_tests
Variable Name | Description | Example |
---|---|---|
RIODevice | Type of RIO device | 7966 |
RIOSerial | Serial of the device. Can be obtained by using "lsni -v -e ni-rio" | 0177A2AD |
VerboseTest | Print info test messages (not used by irioCoreCpp tests) | 0 or 1 |
VerboseInit | Print info of driver initialization (not used by irioCoreCpp tests) | 0 or 1 |
maxCounter | Maximum counter used when acquiring images (only for IMAQ tests where images are acquired) | 65536 |
Test are in the following folder. Test should be run from this folder.
To execute all the tests, run:
To execute specific tests use gtest filter functionality
--gtest_list_tests
Test are in the following folder. Test should be run from this folder.
To execute all the tests, run:
To execute specific tests use gtest filter functionality
--gtest_list_tests
This project makes use of third-party libraries. These include: