Dag allemaal,
Ik heb vorige week een USB ir-receiver in elkaar gestoken.
Het gaat om Deze .
Via de igorUSB.dll zou ik deze ir codes moeten doorkrijgen naar vb6. Dit lukt me echt niet. Steeds krijg ik waarde 1 terug (Device_not_present).
Als ik via girder3.3 werk met de IgorPlug.dll dan werkt het wel behoorlijk, hieruit besluit ik dat de hardware werkt, maar mijn software niet.
Hulp over de dll vindt u hier
In een module heb ik deze code geplaatst
Public Const IgorUSBDLL = "IgorUSB.dll"
'return values from IgorUSBDLL functions:
Public Const NO_ERROR = 0
Public Const DEVICE_NOT_PRESENT = 1
Public Const NO_DATA_AVAILABLE = 2
Public Const INVALID_BAUDRATE = 3
Public Const OVERRUN_ERROR = 4
Public Declare Function DoGetInfraCode Lib "IgorUSB.dll" (ByRef TimeCodeDiagram As Any, ByVal DummyInt As Long, ByRef DiagramLength As Long) As Long
Public Declare Function DoSetDataPortDirection Lib "IgorUSB.dll" (ByVal DirectionByte As Byte) As Long
Public Declare Function DoGetDataPortDirection Lib "IgorUSB.dll" (ByRef DataDirectionByte As Byte) As Long
Public Declare Function DoSetOutDataPort Lib "IgorUSB.dll" (ByVal DataOutByte As Byte) As Long
Public Declare Function DoGetOutDataPort Lib "IgorUSB.dll" (ByRef DataOutByte As Byte) As Long
Public Declare Function DoGetInDataPort Lib "IgorUSB.dll" (ByRef DataInByte As Byte) As Long
Public Declare Function DoEEPROMRead Lib "IgorUSB.dll" (ByVal Address As Byte, ByRef DataInByte As Byte) As Long
Public Declare Function DoEEPROMWrite Lib "IgorUSB.dll" (ByVal Address As Byte, ByVal DataOutByte As Byte) As Long
Public Declare Function DoRS232Send Lib "IgorUSB.dll" (ByVal DataOutByte As Byte) As Long
Public Declare Function DoRS232Read Lib "IgorUSB.dll" (ByRef DataInByte As Byte) As Long
Public Declare Function DoSetRS232Baud Lib "IgorUSB.dll" (ByVal BaudRate As Long) As Long
Public Declare Function DoGetRS232Baud Lib "IgorUSB.dll" (ByRef BaudRate As Long) As Long
In het formulier dit:
Private Sub Command1_Click()
Dim bte As Byte, bb As Byte
Dim rate As Long
Dim str As String
Dim getal As Integer
bte = CByte(3)
getal = DoEEPROMRead(bte, bb)
str1 = DoGetDataPortDirection(bte)
str2 = DoSetOutDataPort(bte)
str = DoGetRS232Baud(rate)
MsgBox (str1 & " " & getal & " " & str2 & " " & str & " " & rate)
End Sub
Weet er iemand wat ik fout gedaan heb?
mvg
Av