Attribute VB_Name = "Eic325PciOcx"
' Interface to the ImsEncPci.ocx functions.
' You may wonder what is this indirection for; i.e., why the program
' does not call frmImsEncPci.ImsEncPci.xxx directly. The answer is
' that it really may, but the indirection gives modularity: if we
' want to switch to interface via the DLL instead of the OCX, just
' leave out this file and the frmImsEncPci file (ImsEncPci.frm) and
' put instead the Eic325PciDll.bas file, available in the DLL example.
' That's it!

Public Sub SetActive(ByVal Active As Integer)
    frmImsEncPci.ImsEncPci.Active = Active
    If Active = 0 Then Unload frmImsEncPci
End Sub
Public Function GetActive() As Integer
    GetActive = frmImsEncPci.ImsEncPci.Active
End Function
Public Function GetCardHandle(ByRef CardHandle As Long, ByVal CardIndex As Integer) As Integer
    GetCardHandle = frmImsEncPci.ImsEncPci.GetCardHandle(CardHandle, CardIndex)
End Function
Public Function GetRevisionID(ByVal CardHandle As Long, ByRef RevisionID As Integer) As Integer
    GetRevisionID = frmImsEncPci.ImsEncPci.GetRevisionID(CardHandle, RevisionID)
End Function
Public Function SetLed(ByVal CardHandle As Long, ByVal LedNumber As Integer, ByVal OnOffMode As Integer) As Integer
    SetLed = frmImsEncPci.ImsEncPci.SetLed(CardHandle, LedNumber, OnOffMode)
End Function
Public Function GetLed(ByVal CardHandle As Long, ByVal LedNumber As Integer, ByRef OnOffMode As Integer) As Integer
    GetLed = frmImsEncPci.ImsEncPci.GetLed(CardHandle, LedNumber, OnOffMode)
End Function
Public Function SetActiveChip(ByVal CardHandle As Long, ByVal ChipNumber As Integer) As Integer
    SetActiveChip = frmImsEncPci.ImsEncPci.SetActiveChip(CardHandle, ChipNumber)
End Function
Public Function GetActiveChip(ByVal CardHandle As Long, ByRef ChipNumber As Integer) As Integer
    GetActiveChip = frmImsEncPci.ImsEncPci.GetActiveChip(CardHandle, ChipNumber)
End Function
Public Function TestActiveChip(ByVal CardHandle As Long) As Integer
    TestActiveChip = frmImsEncPci.ImsEncPci.TestActiveChip(CardHandle)
End Function
Public Function ReadInputs(ByVal CardHandle As Long, ByRef Inputs As Integer, ByRef EncoderEventFlags As Integer) As Integer
    ReadInputs = frmImsEncPci.ImsEncPci.ReadInputs(CardHandle, Inputs, EncoderEventFlags)
End Function
Public Function WriteOutputs(ByVal CardHandle As Long, ByVal Outputs As Integer) As Integer
    WriteOutputs = frmImsEncPci.ImsEncPci.WriteOutputs(CardHandle, Outputs)
End Function
Public Function SetEncoderResolution(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal ClocksPerCycle As Integer) As Integer
    SetEncoderResolution = frmImsEncPci.ImsEncPci.SetEncoderResolution(CardHandle, EncoderNumber, ClocksPerCycle)
End Function
Public Function GetEncoderResolution(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef ClocksPerCycle As Integer) As Integer
    GetEncoderResolution = frmImsEncPci.ImsEncPci.GetEncoderResolution(CardHandle, EncoderNumber, ClocksPerCycle)
End Function
Public Function SetIndexPulsePolarity(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal Polarity As Integer) As Integer
    SetIndexPulsePolarity = frmImsEncPci.ImsEncPci.SetIndexPulsePolarity(CardHandle, EncoderNumber, Polarity)
End Function
Public Function GetIndexPulsePolarity(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef Polarity As Integer) As Integer
    GetIndexPulsePolarity = frmImsEncPci.ImsEncPci.GetIndexPulsePolarity(CardHandle, EncoderNumber, Polarity)
End Function
Public Function SetIndexResetsPositionCounter(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal EnabledDisabledMode As Integer) As Integer
    SetIndexResetsPositionCounter = frmImsEncPci.ImsEncPci.SetIndexResetsPositionCounter(CardHandle, EncoderNumber, EnabledDisabledMode)
End Function
Public Function GetIndexResetsPositionCounter(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef EnabledDisabledMode As Integer) As Integer
    GetIndexResetsPositionCounter = frmImsEncPci.ImsEncPci.GetIndexResetsPositionCounter(CardHandle, EncoderNumber, EnabledDisabledMode)
End Function
Public Function SetSetPoint(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal SetPoint As Long) As Integer
    SetSetPoint = frmImsEncPci.ImsEncPci.SetSetPoint(CardHandle, EncoderNumber, SetPoint)
End Function
Public Function GetSetPoint(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef SetPoint As Long) As Integer
    GetSetPoint = frmImsEncPci.ImsEncPci.GetSetPoint(CardHandle, EncoderNumber, SetPoint)
End Function
Public Function SetEncoderEventFlagSource(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal EventFlagSource As Integer) As Integer
    SetEncoderEventFlagSource = frmImsEncPci.ImsEncPci.SetEncoderEventFlagSource(CardHandle, EncoderNumber, EventFlagSource)
End Function
Public Function GetEncoderEventFlagSource(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef EventFlagSource As Integer) As Integer
    GetEncoderEventFlagSource = frmImsEncPci.ImsEncPci.GetEncoderEventFlagSource(CardHandle, EncoderNumber, EventFlagSource)
End Function
Public Function SetEncoderEventFlagPolarity(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal Polarity As Integer) As Integer
    SetEncoderEventFlagPolarity = frmImsEncPci.ImsEncPci.SetEncoderEventFlagPolarity(CardHandle, EncoderNumber, Polarity)
End Function
Public Function GetEncoderEventFlagPolarity(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef Polarity As Integer) As Integer
    GetEncoderEventFlagPolarity = frmImsEncPci.ImsEncPci.GetEncoderEventFlagPolarity(CardHandle, EncoderNumber, Polarity)
End Function
Public Function SetHoldEncoderEventFlag(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal OnOffMode As Integer) As Integer
    SetHoldEncoderEventFlag = frmImsEncPci.ImsEncPci.SetHoldEncoderEventFlag(CardHandle, EncoderNumber, OnOffMode)
End Function
Public Function GetHoldEncoderEventFlag(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef OnOffMode As Integer) As Integer
    GetHoldEncoderEventFlag = frmImsEncPci.ImsEncPci.GetHoldEncoderEventFlag(CardHandle, EncoderNumber, OnOffMode)
End Function
Public Function ClearEncoderEventFlag(ByVal CardHandle As Long, ByVal EncoderNumber As Integer) As Integer
    ClearEncoderEventFlag = frmImsEncPci.ImsEncPci.ClearEncoderEventFlag(CardHandle, EncoderNumber)
End Function
Public Function ResetPositionCounter(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal OutputsMirror As Integer) As Integer
    ResetPositionCounter = frmImsEncPci.ImsEncPci.ResetPositionCounter(CardHandle, EncoderNumber, OutputsMirror)
End Function
Public Function RequestPositionCounter(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByVal OutputsMirror As Integer) As Integer
    RequestPositionCounter = frmImsEncPci.ImsEncPci.RequestPositionCounter(CardHandle, EncoderNumber, OutputsMirror)
End Function
Public Function ReadPositionCounter(ByVal CardHandle As Long, ByVal EncoderNumber As Integer, ByRef PositionCounter As Long) As Integer
    ReadPositionCounter = frmImsEncPci.ImsEncPci.ReadPositionCounter(CardHandle, EncoderNumber, PositionCounter)
End Function

