Instruction manual
AMPDIO DRIVERS
Page 80
or DIO_TC.vcproj is used to build the DLL using Microsoft Visual C/C++ DIO_TC.IDE is used for
Borland C++.
6.3 Using the Dynamic Link Library
6.3.1 C/C++
Section 6.4 describes the library functions available. Please note that in C/C++, the function call
examples given should always end with a semi-colon. Where arguments to functions are described
as pointers, the address of a user-declared variable is required. This is easily done by using the '&'
reference operator. For example, function TCgetCount requires a pointer to a variable declared as
long, into which the count value result will be placed. A typical 'C' code example for displaying the
Z1 Counter 0 count value would be as follows:
long count; // declare count as long
TCgetCount( h, Z1, 0, &count ); // pass count by reference
printf( "count = %ld", count ); // count now contains new
// value
where h is a handle to a registered board. N.B. The large memory model should be used when
compiling the library and example programs.
6.3.1.1 Microsoft C/C++
1) Ensure that the library DIO_TC.LIB and the header files DIO_TC.H and ADIOCTL.H can be
located by the compiler, either in the project directory or in a path added to the include/library
directory paths. Failure to find these files may cause ‘unresolved external’ compilation errors.
Note that the location of the preinstalled DIO_TC.LIB file changed in AMPDIO v5.00.
2) At the beginning of the application program, add the following lines:
#include <windows.h>
#include "DIO_TC.H"
#include "ADIOCTL.H"
3) Add the library link file DIO_TC.LIB into the project workspace.
4) Build the project.
6.3.1.2 Borland C++
1) Ensure that the header files DIO_TC.H and ADIOCTL.H can be located by the compiler, either
in the project directory or in a path added to the include/library directory paths. Failure to find
these files may cause ‘unresolved external’ compilation errors.
2) At the beginning of the application program, add the following lines:
#include <windows.h>
#include "DIO_TC.H"
#include "ADIOCTL.H"
3) Generate a Borland C compatible version of the library link file DIO_TC.LIB by using the
Borland IMPLIB utility.