'
' Header file for interfacing with the functions in "ArcX.DLL".
'
Option Strict Off
Option Explicit On 
Module Module2
    '
    ' Values for 'HardwareType'.
    '
    Public Const USB22 As Integer = 0
    Public Const PCI20 As Integer = 1
    Public Const AI_SRVR As Integer = 2
    '
    ' Values for 'ClockPrescaler'.
    '
    Public Const SPEED_156KHZ As Integer = 4
    Public Const SPEED_312KHZ As Integer = 3
    Public Const SPEED_625KHZ As Integer = 2
    Public Const SPEED_1250KHZ As Integer = 1
    Public Const SPEED_2500KHZ As Integer = 0
    Public Const SPEED_5MHZ As Integer = 5
    Public Const SPEED_7MHZ As Integer = 7
    Public Const SPEED_10MHZ As Integer = 10
    '
    ' Values for 'Timeout'.
    '
    Public Const STANDARD_TIMEOUT As Integer = 24 '0x18
    Public Const QUAD_TIMEOUT As Integer = 16 '0x10
    Public Const EIGHT_TIMEOUT As Integer = 8 '0x08
    Public Const SIXTEEN_TIMEOUT As Integer = 0 '0x00
    '
    ' Function prototypes.
    '
    Declare Function VbInit Lib "ArcX.dll" (ByVal DeviceNumber As Byte, ByVal HardwareType As Byte, ByVal Timeout As Byte, ByVal NodeID As Byte, ByVal _128NAKs As Byte, ByVal ReceiveAll As Byte, ByVal ClockPrescaler As Byte, ByVal SlowArbitration As Byte, ByVal ReceiveBroadcasts As Byte) As Integer
    '
    Declare Function VbInitSrvr Lib "ArcX.dll" (ByRef hostname As Byte, ByVal port As Short, ByRef cf_node As Byte, ByRef cf_intf As Byte, ByRef cf_speed As Byte, ByRef cf_timeout As Byte, ByRef cf_rcntm As Byte, ByRef cf_rcvall As Byte, ByRef cf_nltim As Short, ByRef cr_fifo As Short, ByRef cr_hwver As Short, ByRef cr_swver As Short) As Integer
    '
    Declare Function VbRegister Lib "ArcX.dll" (ByVal Write As Byte, ByVal Register As Byte, ByRef Value As Byte) As Integer
    '
    Declare Function VbStatus Lib "ArcX.dll" (ByRef ReceiveActivity As Byte, ByRef PowerOnReset As Byte, ByRef Recon As Byte, ByRef Token As Byte, ByRef ReceivedMessages As Long, ByRef TransmissionComplete As Byte, ByRef TransmissionAcknowledged As Byte, ByRef ExcessiveNAKs As Byte) As Integer
    '
    Declare Function VbCancelTX Lib "ArcX.dll" () As Integer
    '
    Declare Function VbFlushRX Lib "ArcX.dll" () As Integer
    '
    Declare Function VbTransmit Lib "ArcX.dll" (ByVal DestinationID As Byte, ByVal NumberOfBytes As Short, ByRef DataBuffer As Byte) As Integer
    '
    Declare Function VbTransmitWait Lib "ArcX.dll" (ByVal DestinationID As Byte, ByVal NumberOfBytes As Short, ByRef DataBuffer As Byte, ByVal Timeout As Long) As Integer
    '
    Declare Function VbReceive Lib "ArcX.dll" (ByRef SourceID As Byte, ByRef DestinationID As Byte, ByRef NumberOfBytes As Short, ByRef DataBuffer As Byte, ByRef NumberOfFilledBuffers As Long) As Integer
    '
    Declare Function VbReceiveWait Lib "ArcX.dll" (ByRef SourceID As Byte, ByRef DestinationID As Byte, ByRef NumberOfBytes As Short, ByRef DataBuffer As Byte, ByRef NumberOfFilledBuffers As Long, ByVal Timeout As Long) As Integer
    '
    Declare Function VbWaitForRecon Lib "ArcX.dll" (ByVal Timeout As Long) As Integer
    '
    Declare Function VbGetOverflowTotal Lib "ArcX.dll" (ByRef packets As Long, ByRef data As Long) As Integer
    '
    Declare Function VbGetFirmwareRevision Lib "ArcX.dll" (ByRef rev As Short) As Integer
    '
    Declare Function VbGetUsbVersion Lib "ArcX.dll" (ByRef version As Short) As Integer
    '
    Declare Function VbExit Lib "ArcX.dll" () As Integer

End Module
