' Delcom Engineering - Copyright 2005 ' Delcom Dll VB declare file ' Constant and Function declaration ' 02/12/07 Version 0.6 Public Const USBIODS = 1 Public Const USBDELVI = 2 Public Const USBNDSPY = 3 Public Const LEDOFF = 0 Public Const LEDON = 1 Public Const LEDFLASH = 2 Public Const GREENLED = 0 Public Const REDLED = 1 Public Const BLUELED = 2 ' For the Delcom USB Traffic lights use the below declarations Public Const TLGREENLED = 0 Public Const TLYELLOWLED = 1 Public Const TLREDLED = 2 Public Const MAXDEVICENAMELEN = 512 Public Type PacketStructure Recipient As Byte DeviceModel As Byte MajorCmd As Byte MinorCmd As Byte DataLSB As Byte DataMSB As Byte Length As Byte DataExt(7) As Byte End Type Public Type DataExtStructure B(7) As Byte End Type ' Declare references to the external procedures in the dynamic-link library (DLL). Public Declare Function DelcomVerboseControl Lib "DelcomDLL.dll" _ (ByVal Mode As Long, ByVal caption As String) As Long Public Declare Function DelcomGetDLLVersion Lib "DelcomDLL.dll" _ () As Double Public Declare Function DelcomGetDLLDate Lib "DelcomDLL.dll" _ (ByVal datestring As String) As Long ' Generic Functions Public Declare Function DelcomGetDeviceCount Lib "DelcomDLL.dll" _ (ByVal ProductType As Long) As Long Public Declare Function DelcomGetNthDevice Lib "DelcomDLL.dll" _ (ByVal ProductType As Long, ByVal NthDevice As Long, ByVal DeviceName As String) As Long Public Declare Function DelcomOpenDevice Lib "DelcomDLL.dll" _ (ByVal DeviceName As String, ByVal Mode As Long) As Long Public Declare Function DelcomCloseDevice Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long) As Long Public Declare Function DelcomReadDeviceVersion Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long) As Long Public Declare Function DelcomReadDeviceSerialNum Lib "DelcomDLL.dll" _ (ByVal DeviceName As String, ByVal DeviceHandle As Long) As Long Public Declare Function DelcomSendPacket Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef PacketOut As PacketStructure, ByRef PacketIn As PacketStructure) As Long ' USBDELVI - Visual Indicator Functions Public Declare Function DelcomLEDControl Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Color As Long, ByVal Mode As Long) As Long Public Declare Function DelcomLoadLedFreqDuty Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Color As Byte, ByVal Low As Byte, ByVal High As Byte) As Long Public Declare Function DelcomEnableAutoConfirm Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Mode As Long) As Long Public Declare Function DelcomEnableAutoClear Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Mode As Long) As Long Public Declare Function DelcomBuzzer Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Mode As Byte, ByVal Freq As Byte, ByVal Repeat As Byte, ByVal OnTime As Byte, ByVal OffTime As Byte) As Long Public Declare Function DelcomLoadInitialPhaseDelay Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Color As Byte, ByVal Delay As Byte) As Long Public Declare Function DelcomSyncLeds Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long) As Long Public Declare Function DelcomLoadPreScalar Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal PreScalar As Byte) As Long Public Declare Function DelcomGetButtonStatus Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long) As Long Public Declare Function DelcomLEDPower Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, Color As Long, Power As Long) As Long ' USBIODS - USB IO Functions Public Declare Function DelcomWritePin Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Port As Byte, ByVal Pin As Byte, ByVal Value As Byte) As Long Public Declare Function DelcomWritePorts Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Port0 As Byte, ByVal Port1 As Byte) As Long Public Declare Function DelcomReadPorts Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef Port0 As Byte, ByRef Port1 As Byte) As Long Public Declare Function DelcomWrite64Bit Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomRead64Bit Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomWriteI2C Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal CmdAdd As Byte, ByVal Length As Byte, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomReadI2C Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal CmdAdd As Byte, ByVal Length As Byte, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomSelReadI2C Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal SetAddCmd As Byte, ByVal Address As Byte, ByVal ReadCmd As Byte, ByVal Length As Byte, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomReadI2CEEPROM Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Address As Long, ByVal Size As Long, ByVal CtrlCode As Byte, ByRef Data As String) As Long Public Declare Function DelcomWriteI2CEEPROM Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Address As Long, ByVal Size As Long, ByVal CtrlCode As Byte, ByVal WriteDelay As Byte, ByRef Data As String) As Long Public Declare Function DelcomRS232Ctrl Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Mode As Long, ByVal Value As Long) As Long Public Declare Function DelcomWriteRS232 Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Length As Long, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomReadRS232 Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef DataExt As DataExtStructure) As Long Public Declare Function DelcomSPIWrite Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal ClockCount As Long, ByRef Data As String) As Long Public Declare Function DelcomSPISetClock Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal ClockCount As Long) As Long Public Declare Function DelcomSPIRead Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByRef Data As String) As Long Public Declare Function DelcomSPIWr8Read64 Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal WrData As Long, ByVal ClockCount As Long, ByRef Data As String) As Long ' USBNDSPY Functions Public Declare Function DelcomNumericMode Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Mode As Byte, ByVal Rate As Byte) As Long Public Declare Function DelcomNumericScanRate Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal ScanRate As Byte) As Long Public Declare Function DelcomNumericSetup Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Digits As Byte) As Long Public Declare Function DelcomNumericRaw Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Str As String) As Long Public Declare Function DelcomNumericInteger Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Number As Long, ByVal Base As Long) As Long Public Declare Function DelcomNumericHexaDecimal Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Number As Long, ByVal Base As Long) As Long Public Declare Function DelcomNumericDouble Lib "DelcomDLL.dll" _ (ByVal DeviceHandle As Long, ByVal Number As Double, ByVal Base As Long) As Long