RTC6 boards
Doc. Rev. 1.0.21 en-US
8 Advanced Functions for Scan Head Control and Laser Control
270
Example Code
The example code must be included in a
user program.
// UINT = uint32_t
// LONG = int32_t
// laser parameters
UINT LaserMode = 0;
UINT LaserControl = 0x0;
LONG LaserOnDelay = (LONG)round(100.0*64.0); // LaserOnDelay = 100 µs
UINT LaserOffDelay = (UINT)round(100.0*64.0); // LaserOffDelay = 100 µs
UINT HalfPeriod = (UINT)round(5.0 * 32.0); // Period = 5 µs, PixelFrequency = 200 kHz
UINT PulseLength = (UINT)round(0.5 * 64.0); // PulseLength = 0.5 µs
// Pixel Output Mode variables
enum E_PixelModes
{
STANDARD = 0, // like RTC5-Mode; up to 400 kHz; 1 pixel per set_pixel command; 2 values of 32 bit per pixel
ENHANCED = 16, // up to 800 kHz; 2 pixel per set_pixel command; 1 value of 32 bit per pixel
FAST = 32, // up to 1.6 MHz; 4 pixel per set_pixel command; 1 value of 16 bit per pixel
ULTRAFAST = 64, // up to 3.2 MHz; 8 pixel per set_pixel command; 1 value of 8 bit per pixel
STANDARD_MOVE = 256 // like STANDARD, but with continuous galvanometer scanner movement
} Mode;
enum E_PixelPorts
{
NO_OUT_PORT = 0,
ANALOG_OUT1 = 1, // LASER Connector ANALOG OUT1
ANALOG_OUT2 = 2, // LASER Connector ANALOG OUT2
DIGITAL_8Bit = 3, // EXTENSION 2 socket connector (8-bit)
DIGITAL_16Bit = 4, // EXTENSION 1 socket connector (16-bit)
PULSE_LENGTH = 5 // not allowed for mode = 0 or mode = 256
} Port;
Port = DIGITAL_8Bit; // pixel output port number
Mode = STANDARD; // Pixel Output Mode
UINT Channel = Port + Mode; // pixel channel
UINT Number = 1; // set_pixel repetition number
UINT PixelArray[17] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; // port output values
UINT PortOutValue1 = PixelArray[0];
UINT PortOutValue2 = PixelArray[0];
LONG dx = (LONG)round(0.01 * CalibrationFactorXY); // 10 um spot distance in x direction
LONG dy = (LONG)round(0.0 * CalibrationFactorXY); // 0 um spot distance in y direction
LONG PixelLineStartPosX = (LONG)round(0.0 * CalibrationFactorXY);
LONG PixelLineStartPosY = (LONG)round(0.0 * CalibrationFactorXY);
// basic configuration
set_laser_mode(LaserMode);
set_laser_control(LaserControl);
// RTC-List
set_start_list_pos(1, 0);
set_laser_delays(LaserOnDelay, LaserOffDelay);
set_default_pixel_list(0); // sets pixel default PulseLength
UINT PortDefault = Port - 1; // CAUTION: port numbers differ between set_port_default/set_port_default_list and
// set_pixel_line
set_port_default_list(PortDefault, PixelArray[0]); // sets default value for specified port