RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
101
// Initializing the
RTC6 PCIe Board
:
// - Selecting the board number 1 as the active board in this user program.
// - If desired: Selecting the RTC4 Compatibility Mode as operation mode
// (Default: RTC6 Standard Mode)
// - Optional: stopping any list running on
RTC6 PCIe Board
number 1 (if it has been used
// previously by another user program, a list might still be running). load_program_file does this
// automatically itself. Otherwise, load_correction_file cannot be executed before
// load_program_file.
// - Calling load_program_file for initializing the board, loading the program file, etc.
// (here also a program code should be included to catch possible errors – for example, file or
// system errors – during initialization, see Chapter 6.8.3 ”Example Code (C)”, page 133).
// - Clearing all previous error codes
// - (stop_execution might have created an RTC6_TIMEOUT or RTC6_BUSY error).
// - Configuring the RTC6 List Memory. Default: 4,194,304 for list 1 and list 2 each).
(void) select_rtc( 1 );
set_rtc4_mode();
// Optional: stop_execution();
ErrorCode = load_program_file( 0 ); // Path = 0: path of current working directory
if ( ErrorCode )
{
printf(
"
Program file loading error: %d\n
"
, ErrorCode );
free_rtc6_dll();
return;
}
reset_error( -1 );
config_list( 4000, 4000 );
// Following the above initialization code you can include the program code defining
// the laser scan process. An example code is in Chapter 7.1.4 ”Example Code (C)”, page 142.
// End of main program
terminateDLL();
return;
}
void terminateDLL()
{
printf(
"
- Press any key to shut down \n
"
);
while( !kbhit() );
(void) getch();
printf(
"
\n
"
);
// Close the RTC6 DLL
free_rtc6_dll();
// only for explicitly linking:
// RTC6close();
}