Example Code (C) - Scanlab RTC6 PCIe Board Installation And Operation Manual

Real time control of scan systems and lasers rtc6 software package v1.16.0
Table of Contents

Advertisement

6.2.5 Example Code (C)

The following C source code for a console
user program (environment: Win32) illustrates the
programming fundamentals of
RTC6 PCIe Board initialization (for complete demo
programs, see
Chapter 11 "Demo Programs",
page
866).
Necessary sources: RTC6impl.h,
implicit linking) or RTC6expl.h,
linking) to link the
RTC6 DLL
Chapter 6.2.1 "DLL Calling Convention", page
the operating system does not find the
on user program startup, it produces a
corresponding error message and terminates the
program.
// System header files
#include <windows.h>
#include <stdio.h>
#include <conio.h>
// RTC6 header file for implicitly linking to the
// with the (Visual C++) import library RTC6DLL.lib):
#include "RTC6impl.h"
// Alternatively: RTC6 header file for explicitly linking to the
// (for building the executable, link with the file RTC6expl.obj, which you can generate
// from the
RTC6expl.c
source code):
//#include "RTC6expl.h"
void __cdecl main( void*, void* )
{
// only for explicitly linking:
// if ( RTC6open() ) // error detected, RTC6open returns 0 for no error
// {
// printf( "Error:
RTC6DLL.dll
// terminateDLL();
// return;
// }
printf( "Initializing the DLL\n\n" );
UINT ErrorCode;
// Initializing the
RTC6 DLL
ErrorCode = init_rtc6_dll();
// Following
init_rtc6_dll
// initialization, for example, for the case the desired board is not detected, access is denied
// or for another error (for example, a version mismatch).
// See
Chapter 6.8.3 "Example Code (C)", page 133
RTC6 boards
Doc. Rev. 1.0.21 en-US
6 Developing RTC6-User Programs
RTC6 DLL
and
RTC6DLL.lib
(for
RTC6expl.c
(for explicit
to the program, see
95. If
RTC6DLL.dll
RTC6DLL.dll
not found\n" );
(the following command must be called as the first RTC6 command)
you should include a program code to catch an error during
(for building the executable, also link
RTC6DLL.dll
.
100

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RTC6 PCIe Board and is the answer not in the manual?

Questions and answers

Related Products for Scanlab RTC6 PCIe Board

This manual is also suitable for:

Rtc6 ethernet board

Table of Contents

Save PDF