RTC
®
5 PC Interface Board
Rev. 1.9 e
6 Developing User Applications
91
innovators for industry
// Selecting the desired RTC
®
5 board as the active RTC
®
5 board for this application
if ( InternalNumberOfDesiredBoard != select_rtc( InternalNumberOfDesiredBoard ) )
{
// Errors which occurred during execution of
ErrorCode = n_get_last_error( InternalNumberOfDesiredBoard );
if ( ErrorCode & 256 ) // RTC5_VERSION_MISMATCH
{
// Here the multi-board command
n_load_program_file
must be used for initializing the board
// (the single-board command
( 0 ) would deny execution).
if ( ErrorCode = n_load_program_file( InternalNumberOfDesiredBoard, 0 ) )
{
printf( "n_load_program_file returned error code %d\n", ErrorCode );
}
}
else
{
printf( "No access to RTC5 board with serial number %d\n", SerialNumberOfDesiredBoard );
free_rtc5_dll();
return;
}
if ( ErrorCode )
{
printf( "No access to RTC5 board with serial number %d\n", SerialNumberOfDesiredBoard );
free_rtc5_dll();
return;
}
else
{
// if
n_load_program_file
was successful, select the desired board
(void) select_rtc( InternalNumberOfDesiredBoard );
}
}
}