6.8.3 Example Code (C)
The following example C source code shows how to
catch an error during initialization. It ensures the
user program terminates with an error message, if:
• An error occurs during initialization with
init_rtc6_dll
(for example, if no RTC6 PCIe Board
has been detected)
• The desired RTC6 PCIe Board (here: the board
with serial number 12345) is not found
• Access is denied to the desired RTC6 PCIe Board
• An error occurs during
example, a version mismatch, file or system error)
The code must be included in a user program, see
Chapter 6.2.5 "Example Code (C)", page
UINT ErrorCode;
ErrorCode = init_rtc6_dll();
if ( ErrorCode )
{
// Reading the number of RTC6 boards detected during initialization with
const UINT RTC6CountCards = rtc6_count_cards();
if ( RTC6CountCards )
{
// Detailed error analysis for all detected boards
UINT AccError( 0 );
for ( UINT i = 1; i <= RTC6CountCards; i++ )
{
// Errors which occurred during execution of
const UINT Error = n_ get_last_error( i );
if ( Error != 0 )
{
AccError |= Error;
const UINT SerialNumber = n_
printf( "RTC6 board number %d (serial number %d): Error %d detected\n",
i, SerialNumber, Error );
n_reset_error( i, Error );
}
}
if ( AccError )
{
free_rtc6_dll();
return;
}
}
RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
load_program_file
(for
100.
get_serial_number
init_rtc6_dll
init_rtc6_dll
( i );
133
Need help?
Do you have a question about the RTC6 PCIe Board and is the answer not in the manual?