Anfängerfrage zu IOW28 Starterkit

Dies ist das deutsche Forum für alle Themen um den IO-Warrior. Beiträge bitte nur in Deutsch.

Moderator: Guido Körber

Post Reply
red
Posts: 2
Joined: Fri Jul 22, 2022 1:24 pm

Anfängerfrage zu IOW28 Starterkit

Post by red »

Hallo, komme gerade überhaupt nicht weiter, wäre über jede Hilfe total froh:

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
red
Posts: 2
Joined: Fri Jul 22, 2022 1:24 pm

Re: Anfängerfrage zu IOW28 Starterkit

Post by red »

OMG, got it, einmal "Dim ioHandle" zuviel
Post Reply