EasyManua.ls Logo

Scanlab RTC 5 PC Interface Board - 7.1.4 Example Code

Scanlab RTC 5 PC Interface Board
622 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
RTC
®
5 PC Interface Board
Rev. 1.9 e
7 Basic Functions for Scan Head and Laser Control
97
innovators for industry
7.1.4 Example Code
The following example C source code shows the
commands of a simple laser scan application:
A point, a square and a circle are marked in CO
2
mode. Here it is assumed that the RTC
®
4 compati-
bility mode is activated.
The code must be included in a user program (see
page 67).
// Scan system initialization:
// Loading and assigning a correction file
ErrorCode = load_correction_file( 0, // initialize like "D2_1to1.ct5",
1, // table (#1 is used by default)
2 ); // use 2D only
if ( ErrorCode )
{
printf( "Correction file loading error: %d\n", ErrorCode );
free_rtc5_dll();
return;
}
select_cor_table( 1, 0 ); // assigning table #1 to the primary scan head connector (default)
// Laser control initialization (see page 128):
// Setting the CO
2
laser mode
set_laser_mode( 0 );
// Setting and enabling the “laser active” laser control signals
set_laser_control( 0x18 ); // All laser signals LOW active (Bit #3 and #4)
// This command must be called at least once to activate laser signals. Later on enable_laser/disable_laser would be
//sufficient.
//
The following are list commands
// Opens List 1
set_start_list( 1 );
// Setting the standby pulses
set_standby( 800, 8 );
// In RTC
®
4 compatibility mode the standby parameters are specified in units of 1/8 µs as with the RTC
®
4 and the
// RTC
®
5 multiplies the specified values by 8 to convert in integer-multiple of 1/64 µs.
// Half of the standby output period = 100 µs
// Pulse length of the standby pulses = 1 µs
// Timing, delay and speed preset
// Setting the scanner delays (see page 100):
set_scanner_delays( 25, 10, 5 );
// Jump delay = 250 µs (specified in [10 µs])
// Mark delay = 100 µs (specified in [10 µs])
// Polygon delay = 50 µs (specified in [10 µs])
// Setting the jump and marking speed:
set_jump_speed( 1000.0 );
set_mark_speed( 250.0 );
// In RTC
®
4 compatibility mode the speed values are specified as with the RTC
®
4 and the RTC
®
5 multiplies the specified
// values by 16.
// Jump speed = 1000.0 bits/ms
// Marking speed = 250.0 bits/ms
// Setting the laser timing (see page 128):
set_laser_pulses( 800, 400 );
// In RTC
®
4 compatibility mode the timing parameters are specified in units of 1/8 µs as with the RTC
®
4 and the RTC
®
5
// multiplies the specified values by 8 to convert in integer-multiple of 1/64 µs.
// Laser HalfPeriod = 100 µs
// Laser PulseLength = 50 µs
// Setting the laser delays (see page 99):
set_laser_delays( 100, 100 );
// In RTC
®
4 compatibility mode the laser delays are specified in units of 1 µs as with the RTC
®
4 and the RTC
®
5
// multiplies the specified values by 2 to convert in integer-multiple of 0.5 µs.
// LaserOn delay = 100 µs
// LaserOff delay = 100 µs

Table of Contents

Related product manuals