Ich habe das IO-Warrior28 StarterKit und habe gedacht, wenn ich abwechselnd HIGH bzw. LOW auf die Ausgänge gebe , müsste die LED an- und ausgehen. Leider klappt das nicht, habe ich da einen Denk- oder Codefehler?
Dies ist der Code:
Code: Select all
Public Class Form1
    Dim ioHandle As Int32  'Nummer des IO Ws
    ' Data buffer
    ' Basic data buffer is 5 bytes long: 1 byte for report id, max 4 bytes for data
    Dim ioWrite(5) As Byte
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        ' Set up report id
        ioWrite(0) = 0
        ' Setup bytes  255
        ioWrite(1) = &HFFS
        ioWrite(2) = &HFFS
        ioWrite(3) = &HFFS
        ioWrite(4) = &HFFS
        IowKitWrite(ioHandle, IOW_PIPE_IO_PINS, ioWrite(0), 5)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim ioHandle = IowKitOpenDevice()
        Debug.WriteLine(" ioHandle: " & ioHandle)
        If (ioHandle = 0) Then
            Debug.WriteLine(" Connection zu ioWarrior failed")
            Close() 'Exit Application
        End If
        ' Ab hier ist es ok
    End Sub
    Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles MyBase.FormClosed
        IowKitCloseDevice(ioHandle) 'Never forget To close iowkit.dll !
    End Sub