DLL SUPPORT
The AMU2.x boards can be addressed from other programs and LabView
TM
by calling functions
provided in a DLL. In order to make the use of these functions as transparent as possible, the
following files are provided:
–
source code of the DLL written in Delphi 6.0 (./DLL/Lockin.dpr)
–
example in Borland C++ Builder 5.0 for using the DLL (./DLL/cpp/Project1.bpr)
–
example in Delphi 6.0 fro using the DLL (./DLL/Delphi/Demo.dpr)
–
current version of the DLL (<WINDIR>/Lockin.dll)
This DLL is compatible with C calling conventions. The convention of the functions in C++ need
an underline in front of function names.
The 'lockin.dll' (and 'lockin.ini' for older versions) have to be located in '
' .
W
ORKING
WITH
THE
DLL
IN
C++
PROJECTS
Add the lib-file genarated from the
DLL to the project in Borland C++
Builder 5.0 by opening 'Project / Add
to Project' (see figure).
Chose the
lockin.lib
as the file to be
added.
If the lockin.lib does not exist, it can be
created from the command line:
–
open the command prompt by
running 'cmd' in 'Start/Run..' under
the Windows Start Menu.
–
Go to the directory in which the lockin.dll is located (e.g. '
' )
–
type: 'implib lockin lockin.dll'
The lockin.lib is created in the same directory based on the lockin.dll.
To call functions residing in the DLL, headers are necessary, so add 'import.cpp' also to the project,
which contains:
extern "C"{
double _declspec(dllimport) cdecl SetLockInFreq (double freq): double;
void _declspec(dllimport) cdecl SetLockInAmpl (double Ampl);
Manual Anfatec PCI-Lockin Amplifier AMU5.0 – Rev. 1.01
Page 25 (34)