Omega Engineering EN-EIC-325-PCI manual Introduction to the Functions

Page 15

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

Image 15
Contents User’s Guide Servicing North America Model Table of Contents Section Each Encoder Interface includes the following elements Encoder InterfaceCards Hardware I/O Software InputsPIN LAY-OUT Encoder InputsEncoders Event Signals and General Outputs Logical InputsFunction Type Pin No CPP InstallationVB folders Page WinSysPath folder WinSysPath is Page Page Introduction to the Functions Chip Level Functions Card Level FunctionsGetActiveChip Brief Name Arguments in C Syntax Full DescriptionSetActiveChip All the following functions refer to that active chipInputs Brief Description NameShort EncoderNumber BriefArguments in C Syntax Full Description Short EncoderNumber Short ClocksPerCycleCounter SetIndexPulsePolarityShort Polarity GetIndexPulsePolarityGetSetPoint SetSetPointLong SetPoint SetPointPolarity SetEncoderEventFlagSource GetEncoderEventFlagClearEncoderEvent SetHoldEncoderEventFlag GetHoldEncoderEventLong* PositionCounter ResetPositionCounterShort OutputsMirror ReadPositionCounterAvailable only for RequestPositionCounter Polarity Encoder Counters IntroductionGeneral Input Signals from the EncodersSquare wave signal Sine wave signalGeneral SoftwareConnector Wiring for the Inputs Connector Wiring for the Outputs Yes NextFinish WinNTPage Page Page Page Page Page Page Appendix D Product Development WARRANTY/DISCLAIMER Shop online at omega.com