Introduction To The Functions - Omega Engineering EN-EIC-325-PCI User Manual

Four axis pci encoder interface card
Table of Contents

Advertisement

3.2. INTRODUCTION TO THE FUNCTIONS

Each encoders pair is handled by a "chip":
Chip #1 includes Encoder Interfaces A and B.
Chip #2 includes Encoder Interfaces C and D.
The following functions serve the DOS C/C++ programmer as well as the
Windows programmer.
The DOS C/C++ programmer should include EncPci.h in his source file,
and EncPci.obj in his project. This will make all functions available.
The Windows programmer should use an ActiveX control (Win95/98,
WinNT/2K/XP) or a DLL (WinNT/2K/XP). The ActiveX control and
the DLL include all these functions.
At application start, the Active property should be
set to 1, and in the end to 0, as follows:
In VB:
* Using the ActiveX control, it will look like:
Enc.Active = 1
Enc.Active = 0
* Using the DLL, it will look like:
SetActive (1)
SetActive (0)
In VC:
Using either the ActiveX control or the DLL, it will look like:
SetActive (1) ;
SetActive (0) ;
Notes:
Active Chip
The functions in sections 3.4 and 3.5 operate on the active chip as
selected by SetActiveChip (section 3.4.1, function #5).
Set... functions
Each Set... function includes the following steps:
Write required new value onto the card.
Read card's current value.
Compare card's read value with the required new value.
Respond with a "success" return code only if the values are equal.
Therefore, a "success" return code indicates not only correct arguments,
but also verified communication with the card.
However, each Set... function has a corresponding Get... function to
enable the user read the actual value within the card.
Return Code
All functions respond with a return code. 1 indicates success, 0 means
failure due to either wrong arguments or unsuccessful operation.
Arguments
The common arguments, that is, those that are not individual to
specific functions, are described in section 3.6.
13

Advertisement

Table of Contents
loading

Table of Contents