User manual
3Page
Velleman Projects
Introduction
General
The VM167 interface board has 8 digital input/output channels, five analog input channels and two
PWM outputs. The number of inputs/outputs can be expanded by connecting two VM167 cards to the
PC. Both of the cards has its own identification number (card address) by means of the jumper setting.
All communication routines are contained in a Dynamic Link Library VM167.DLL.
In this manual we will describe each of these functions provided by the DLL in detail. Calling the
functions exported by the DLL, you can write custom Windows applications in Delphi, Visual Basic or
any other 32-bit Windows application development tool that supports calls to a DLL.
A complete overview of the procedures and functions that are exported by the VM167.DLL follows.
Note that all the examples in the function description section are written in C++.
VM167 examples folder includes examples written in Visual Basic 2008 Express, Visual C# 2008
Express, Visual C++ 2008 Express, VB6.0, MS Excel VBA, Delphi 5, Borland C++Builder 6 and Dev-
C++.
Readers should have an understanding of the basic data types as well as basic knowledge of the
Microsoft Windows operating system.
Microsoft Visual Studio users please note: The VM167.DLL is a standard Windows DLL, you
cannot reference it.
Calling convention
A calling convention is a scheme for how functions receive parameters from their caller and how they
return a result. Different programming languages use different calling conventions, so it is important to
know which calling convention is used by your programming language and which calling convention is
used by the VM167 DLL.
The most common calling convention is the stdcall calling convention, and this is also the one we
have used for our DLL.
If you are using .NET (VB.NET or C#) you do not need to worry about this since the calling convention
in .NET is also stdcall. However if you are using C to import the functions provided by the DLL, you will
need to pay special attention to this.
Card Address Setting
J5 Card Address
ON 0
OFF 1
TABLE 1: Jumper J5 Settings
The card address settings must be done before the USB cable is connected to the VM167 card or
before turning the PC on.
If the USB cable is disconnected and reconnected then all the digital terminals are set as inputs and
the PWM outputs are reset to zero.