Variable richtig deklarieren

  • DANKE dir, ich habe bis jetzt noch folgendes gedunden. Das steht in der Anleitung mit C-Beispiel. Ich habe mich mit dem E77, auf den vorherigen Eintrag verlassen. Der Anleitung zur volge, muss es, wenn es klappt ja dem $buffer eine 1 einschrieben. Und die Serialnummer muss ja dann sowas wie 8 stellig sein.

    Spoiler anzeigen
    [autoit]

    O-Warrior Dynamic Library Code Mercenaries
    for Windows V1.5
    IowKitGetSerialNumber
    Declaration:
    BOOL IOWKIT_API IowKitGetSerialNumber(IOWKIT_HANDLE iowHandle, PWCHAR serialNumber);
    function IowKitGetSerialNumber(devHandle: IOWKIT_HANDLE;
    serialNumber: PWideChar): BOOL; stdcall;
    Fills a buffer with the serial number string of the specific IO-Warrior identified by iowHandle.
    All IO-Warriors (for IOW40 only those with firmware V1.0.1.0 and later) contain an 8 digit serial
    number. The serial number is represented as an Unicode string. The buffer pointed to by
    serialNumber must be big enough to hold 9 Unicode characters (18 bytes), because the string is
    terminated in the usual C way with a 0 character.
    On success, this function copies the IO-Warrior serial number string to the buffer and returns TRUE. It
    fails and returns FALSE if the IO-Warrior does not have a serial number or if either iowHandle or
    serialNumber buffer are invalid.
    Sample usage C:
    void ShowSerialNumber(IOWKIT_HANDLE ioHandle)
    {
    WCHAR buffer[9];
    IowKitGetSerialNumber(ioHandle, buffer);
    printf("%ws\n", buffer);
    }
    Sample usage Delphi:
    procedure ShowSerialNumber(ioHandle: IOWKIT_HANDLE);
    var
    Buffer: array [0..8] of WideChar;
    begin
    IowKitGetSerialNumber(ioHandle, @Buffer[0]);
    ShowMessage(Buffer);
    end;
    Sample usage Visual Basic 6:
    Dim N As Long
    Dim S(18) As Byte
    N = IowKitGetSerialNumber(IowKitGetDeviceHandle(1), S(0))
    Label.Caption = S
    IO-Warrior Dynamic Library V1.5 8. Dez 2005 10

    [/autoit]


    Ich bekomme folgende Ergebnisse für folgende Funktionen:

    Spoiler anzeigen
    [autoit]

    ;Seriennummer auslesen
    ; Entweder so ...
    $buffer = DLLStructCreate("WCHAR[9]")
    $res = DllCall($dllIOW, "BOOL", "IowKitGetSerialNumber", "PTR", $hKitIOW, "PTR", DllStructGetPtr ($buffer))
    If (not @error) Then
    $snIOW = $res[0] ; Hier bitte über _Arraydisplay($res) das richtige auswähle, keine Ahnung welches man hier braucht!!!
    Else
    $snIOW = "error code: "&@error
    EndIf

    [/autoit]

    =>

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    NUM 1
    PID 0x00001500
    S/N 1
    >Exit code: 0 Time: 0.323

    [/autoit]

    ;

    Spoiler anzeigen
    [autoit]

    ;Seriennummer auslesen
    ; Entweder so ...
    $buffer = DLLStructCreate("WCHAR[9]")
    $res = DllCall($dllIOW, "BOOL", "IowKitGetSerialNumber", "PTR", $hKitIOW, "PTR", DllStructGetPtr ($buffer))
    If (not @error) Then
    $snIOW = $res[1] ; Hier bitte über _Arraydisplay($res) das richtige auswähle, keine Ahnung welches man hier braucht!!!
    Else
    $snIOW = "error code: "&@error
    EndIf

    [/autoit]

    =>

    Spoiler anzeigen
    [autoit]

    NUM 1
    PID 0x00001500
    S/N 0x03020014

    [/autoit]

    Das selbe auch wenn ich 2 ins Array Schreibe. Das einzig ärgerliche ist es, das ich irgendwie wenn ich das Script Starte mal 0x03020014 oder beim nächsten mal 0x00EE54F3 oder irgendwelche Random zahlen bekomme, was mich stark verwundert. Oder soll es so sein ? Ich denke wenn cih die Seriennummer abfrage muss die doch gleich bleiben. Oder was meint Ihr ? Naja, weiter gehts

    Spoiler anzeigen
    [autoit]

    ;Seriennummer auslesen
    ; Entweder so ...
    $buffer = DLLStructCreate("WCHAR[9]")
    $res = DllCall($dllIOW, "BOOL", "IowKitGetSerialNumber", "PTR", $hKitIOW, "PTR", DllStructGetPtr ($buffer))
    If (not @error) Then
    $snIOW = _ArrayDisplay($res[0]) ; Hier bitte über _Arraydisplay($res) das richtige auswähle, keine Ahnung welches man hier braucht!!!
    Else
    $snIOW = "error code: "&@error
    EndIf

    [/autoit]

    =>

    Spoiler anzeigen
    [autoit]

    NUM 1
    PID 0x00001500
    S/N 0

    [/autoit]

    ;

    Spoiler anzeigen
    [autoit]

    ;Seriennummer auslesen
    ; Entweder so ...
    $buffer = DLLStructCreate("WCHAR[9]")
    $res = DllCall($dllIOW, "BOOL", "IowKitGetSerialNumber", "PTR", $hKitIOW, "PTR", DllStructGetPtr ($buffer))
    If (not @error) Then
    $snIOW = _ArrayDisplay($res[1]) ; Hier bitte über _Arraydisplay($res) das richtige auswähle, keine Ahnung welches man hier braucht!!!
    Else
    $snIOW = "error code: "&@error
    EndIf

    [/autoit]

    =>

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    NUM 1
    PID 0x00001500
    S/N 0
    >Exit code: 0 Time: 0.327

    [/autoit]

    ;

    Spoiler anzeigen
    [autoit]

    ;Seriennummer auslesen
    ; Entweder so ...
    $buffer = DLLStructCreate("WCHAR[9]")
    $res = DllCall($dllIOW, "BOOL", "IowKitGetSerialNumber", "PTR", $hKitIOW, "PTR", DllStructGetPtr ($buffer))
    If (not @error) Then
    $snIOW = _ArrayDisplay($res[2]) ; Hier bitte über _Arraydisplay($res) das richtige auswähle, keine Ahnung welches man hier braucht!!!
    Else
    $snIOW = "error code: "&@error
    EndIf

    [/autoit]

    =>

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    NUM 1
    PID 0x00001500
    S/N 0
    >Exit code: 0 Time: 0.329

    [/autoit]

    ;

    Und ab drei geht nichts mehr, weil es dafür kein Array gibt.
    So, nun bin ich gespannt was Ihr schriebt ;)

    Wenn es hilft, hier noch einmal das C- Beispiel, das nach dem Starten die Led´s meines I/OWarriors blinken lässt ;)

    Spoiler anzeigen
    [autoit]

    //
    // ioblink.cpp - Blinking LEDs sample
    //

    [/autoit] [autoit][/autoit] [autoit]

    #include "stdafx.h"
    #include "time.h"
    #include "iowkit.h"

    [/autoit] [autoit][/autoit] [autoit]

    // Write simple value
    BOOLEAN WriteSimple(IOWKIT_HANDLE devHandle, DWORD value)
    {
    IOWKIT56_IO_REPORT rep;

    [/autoit] [autoit][/autoit] [autoit]

    // Init report
    memset(&rep, 0xff, IOWKIT56_IO_REPORT_SIZE);
    rep.ReportID = 0;
    switch (IowKitGetProductId(devHandle))
    {
    // Write simple value to IOW40
    case IOWKIT_PRODUCT_ID_IOW40:
    rep.Bytes[3] = (BYTE) value;
    return IowKitWrite(devHandle, IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE) == IOWKIT40_IO_REPORT_SIZE;

    [/autoit] [autoit][/autoit] [autoit]

    default:
    return FALSE;
    }
    }

    [/autoit] [autoit][/autoit] [autoit]

    int main(int argc, char* argv[])
    {
    IOWKIT_HANDLE iows[IOWKIT_MAX_DEVICES];
    int i, j;
    ULONG bits;
    int numIows;
    IOWKIT56_IO_REPORT rep;
    WCHAR sn[9];
    ULONG rc;
    DWORD pid;
    IOWKIT_HANDLE devHandle;

    [/autoit] [autoit][/autoit] [autoit]

    // Open device
    devHandle = IowKitOpenDevice();
    if (devHandle == NULL)
    {
    printf("Failed to open device\n");
    goto out;
    }
    // Get number of IOWs in system
    numIows = IowKitGetNumDevs();
    printf("%d IOWs in system\n", numIows);
    // Get all IOW handles
    for (i = 0; i < numIows; i++)
    {
    // Get device handle and init object
    iows[i] = IowKitGetDeviceHandle(i + 1);
    // Get serial number
    IowKitGetSerialNumber(iows[i], sn);
    pid = IowKitGetProductId(iows[i]);
    printf("%d PID %x, S/N \"%ws\"\n", i + 1, pid, sn);
    }
    // Init report
    // Report ID 0 is for writing to 32 input/output pins
    rep.ReportID = 0;
    printf("Blinking LEDs...\n");
    //srand(time(NULL));
    // Blinking'
    for (i = 0; i < 100; i++)
    {
    bits = rand();
    // Make every IOW blink
    for (j = 0; j < numIows; j++)
    {
    // Write to simple endpoint
    rc = WriteSimple(iows[j], bits);
    // Check for error
    if (!rc)
    printf("Cannot write, err %d\n", GetLastError());
    }
    // Sleep for 25ms
    Sleep(25);
    }
    printf("Blinking complete\n");
    // Set LEDs off
    for (i = 0; i < numIows; i++)
    // Write to simple endpoint
    WriteSimple(iows[i], 0xFFFFFFFF);
    for(i = 0; i < 10; i++)
    {

    [/autoit] [autoit][/autoit] [autoit]

    // Read non blocking
    // Init report
    memset(&rep, 0, IOWKIT56_IO_REPORT_SIZE);
    switch (IowKitGetProductId(devHandle))
    {
    case IOWKIT_PRODUCT_ID_IOW40:
    rc = IowKitReadNonBlocking(iows[0], IOW_PIPE_IO_PINS,
    (PCHAR) &rep, IOWKIT40_IO_REPORT_SIZE);
    printf("%2d) ReadNonBl(): rc=%u bits=", i + 1, rc);
    for (j = IOWKIT40_IO_REPORT_SIZE - 1; j >= 0; j--)
    printf("%02x", rep.Bytes[j]);
    printf("\n");
    break;
    }
    Sleep(100);
    }
    // Close device
    IowKitCloseDevice(devHandle);
    out:

    [/autoit] [autoit][/autoit] [autoit]

    return 0;
    }

    [/autoit]

    lg Tim


  • Das selbe auch wenn ich 2 ins Array Schreibe. Das einzig ärgerliche ist es, das ich irgendwie wenn ich das Script Starte mal 0x03020014 oder beim nächsten mal 0x00EE54F3 oder irgendwelche Random zahlen bekomme, was mich stark verwundert. Oder soll es so sein ? Ich denke wenn cih die Seriennummer abfrage muss die doch gleich bleiben. Oder was meint Ihr ? Naja, weiter gehts
    [...]
    Und ab drei geht nichts mehr, weil es dafür kein Array gibt.
    So, nun bin ich gespannt was Ihr schriebt ;)

    Also enthält $res[1] das Handle zu dem USB-Kit und $res[2] den String. ;)

    EDIT:
    Benutzt Du einen Zeiger auf eine durch DllStructCreate erzeugte Zeichenkette (Bsp. zwei), dann wird die Seriennummer in die Zeichenkette geschrieben.

    Gruß


    Einmal editiert, zuletzt von Greenhorn (3. August 2010 um 19:56)

  • Warum verwendest du schon wieder die DLL-Funktionen direkt, wenn du schon UDFs erstellt hast? Damit sollte es so funktionieren:

    Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = IowKitOpenDevice();
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = IowKitGetNumDevs();
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial
    For $i = 1 To $numIows
    ; Get device handle and init object
    $iows[$i-1] = IowKitGetDeviceHandle($i);
    ; Get serial number
    IowKitGetSerialNumber($iows[$i-1], $serial);
    $pid = IowKitGetProductId($iows[$i]);
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial);
    Next
    ; Close device
    IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit]
  • Also, die DllFunktion habe ich verwendet, weil ich den Beitag gefunden habe, und mir gedacht habe, darauf kann ich aufbauen, und wenn es geht, dann kann ich sie abwandeln, und meine au3 einbinden. Nun folgendes, ich habe dein Script auf meinem Desktop, habe die dll udn meine IOWKIT.au3 daneben, aber wenn ich es starte, kommt folgendes:

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    C:\Users\User\Desktop\test2.au3 (11) : ==> Unknown function name.:
    Global $devHandle = IowKitOpenDevice()
    Global $devHandle = ^ ERROR
    >Exit code: 1Time: 0.208

    [/autoit]

    Ich konnte keinen Fehler im Script finden. Habe ich etwas übersehen ?

    lg Tim

    PS: Das ist meine IOWKIT.au3 :

    Spoiler anzeigen
    [autoit]

    #include-once
    ;~ IO-Warrior vendor & product IDs
    Global Const $IOWKIT_VENDOR_ID = 0x07c0
    Global Const $IOWKIT_VID = $IOWKIT_VENDOR_ID
    ;~ IO-Warrior 40
    Global Const $IOWKIT_PRODUCT_ID_IOW40 = 0x1500
    Global Const $IOWKIT_PID_IOW40 = $IOWKIT_PRODUCT_ID_IOW40
    ;~ IO-Warrior 24
    Global Const $IOWKIT_PRODUCT_ID_IOW24 = 0x1501
    Global Const $IOWKIT_PID_IOW24 = $IOWKIT_PRODUCT_ID_IOW24
    ;~ IO-Warrior PowerVampire
    Global Const $IOWKIT_PRODUCT_ID_IOWPV1 = 0x1511
    Global Const $IOWKIT_PID_IOWPV1 = $IOWKIT_PRODUCT_ID_IOWPV1
    Global Const $IOWKIT_PRODUCT_ID_IOWPV2 = 0x1512
    Global Const $IOWKIT_PID_IOWPV2 = $IOWKIT_PRODUCT_ID_IOWPV2
    ;~ IO-Warrior 56
    Global Const $IOWKIT_PRODUCT_ID_IOW56 = 0x1503
    Global Const $IOWKIT_PID_IOW56 = $IOWKIT_PRODUCT_ID_IOW56

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Max number of pipes per IOW device
    Global Const $IOWKIT_MAX_PIPES = 2

    [/autoit] [autoit][/autoit] [autoit]

    ;~ pipe names
    Global Const $IOW_PIPE_IO_PINS = 0
    Global Const $IOW_PIPE_SPECIAL_MODE = 1

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Max number of IOW devices in system
    Global Const $IOWKIT_MAX_DEVICES = 16
    ;~ IOW Legacy devices open modes
    Global Const $IOW_OPEN_SIMPLE = 1
    Global Const $IOW_OPEN_COMPLEX = 2

    [/autoit] [autoit][/autoit] [autoit]

    ;~ first IO-Warrior revision with serial numbers
    Global Const $IOW_NON_LEGACY_REVISION = 0x1010

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Don't forget to pack it!
    ;~ #pragma pack(push, 1)

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $tagIOWKIT_REPORT = "align 1;byte ReportID; DWORD Value;"
    Global Const $tagIOWKIT40_IO_REPORT = "align 1;byte ReportID; DWORD Value;"
    Global Const $tagIOWKIT24_IO_REPORT = "align 1;byte ReportID; WORD Value;"
    Global Const $tagIOWKIT_SPECIAL_REPORT = "align 1;byte ReportID; byte Bytes[7];"
    Global Const $tagIOWKIT56_IO_REPORT = "align 1;byte ReportID; byte Bytes[7];"
    Global Const $tagIOWKIT56_SPECIAL_REPORT = "align 1;byte ReportID; byte Bytes[63];"

    [/autoit] [autoit][/autoit] [autoit]

    Global Const $IOWKIT_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT_REPORT, 1))
    Global Const $IOWKIT40_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT40_IO_REPORT, 1))
    Global Const $IOWKIT24_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT24_IO_REPORT, 1))
    Global Const $IOWKIT_SPECIAL_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT_SPECIAL_REPORT, 1))
    Global Const $IOWKIT56_IO_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT56_IO_REPORT, 1))
    Global Const $IOWKIT56_SPECIAL_REPORT_SIZE = DllStructGetSize(DllStructCreate($tagIOWKIT56_SPECIAL_REPORT, 1))

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _IowKitDWORDToBytes($dword)
    ; Author: ProgAndy
    Return BinaryMid($dword, 1, 4)
    EndFunc
    Func _IowKitWORDToBytes($word)
    ; Author: ProgAndy
    Return BinaryMid($word, 1, 2)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    ;~ #pragma pack(pop)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Opaque IO-Warrior handle
    Global $ghIOWkitDll = -1
    Func _IowKitStartUp($sDLL = "iowkit.dll") ; DLL laden, für alle anderen Funktionen wichtig
    If $ghIOWkitDll = -1 Then
    $ghIOWkitDll = DllOpen($sDLL)
    EndIf
    Return $ghIOWkitDll <> -1
    EndFunc ;==>_IowKitStartUp

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Function prototypes

    [/autoit] [autoit][/autoit] [autoit]

    ;~ #ifdef __cplusplus
    ;~ extern "C" {
    ;~ #endif // __cplusplus

    [/autoit] [autoit][/autoit] [autoit]

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitOpenDevice(void);
    Func _IowKitOpenDevice()
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitOpenDevice")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitOpenDevice

    [/autoit] [autoit][/autoit] [autoit]

    ;~ void IOWKIT_API IowKitCloseDevice(IOWKIT_HANDLE devHandle);
    Func _IowKitCloseDevice($devHandle)
    DllCall($ghIOWkitDll, "none", "IowKitCloseDevice", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    EndFunc ;==>_IowKitCloseDevice

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;--------------------------------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitWrite(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitWrite($devHandle, $numPipe, $buffer, $length=-1)
    ; Author: ProgAndy
    Local $pBuffer
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf IsPtr($buffer) Then
    If $length < 0 Then Return SetError(2,0,0)
    $pBuffer = $buffer
    Else
    If $length < 1 Then $length = BinaryLen($buffer)
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    DllStructSetData($tBuffer, 1, Binary($buffer))
    $buffer = 0 ; Speicher freigeben
    $pBuffer = DllStructGetPtr($tBuffer)
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitWrite", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitWrite

    [/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitRead(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitRead($devHandle, $numPipe, ByRef $buffer, $length)
    ; Author: ProgAndy
    Local $pBuffer, $fInternal=False
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf $length < 1 Then
    Return SetError(2,0,0)
    ElseIf IsPtr($buffer) Then
    $pBuffer = $buffer
    Else
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    $pBuffer = DllStructGetPtr($tBuffer)
    $buffer = Binary('')
    $fInternal = True
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitRead", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    If $fInternal Then
    $buffer = DllStructGetData($tBuffer,1)
    $tBuffer = 0
    EndIf
    Return $aResult[0]
    EndFunc ;==>_IowKitRead

    [/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitReadNonBlocking(IOWKIT_HANDLE devHandle, ULONG numPipe,
    ;~ PCHAR buffer, ULONG length);
    Func _IowKitReadNonBlocking($devHandle, $numPipe, ByRef $buffer, $length)
    ; Author: ProgAndy
    Local $pBuffer, $fInternal=False
    If IsDllStruct($buffer) Then
    $pBuffer = DllStructGetPtr($buffer)
    If $length < 1 Or $length > DllStructGetSize($buffer) Then $length = DllStructGetSize($buffer)
    ElseIf $length < 1 Then
    Return SetError(2,0,0)
    ElseIf IsPtr($buffer) Then
    $pBuffer = $buffer
    Else
    Local $tBuffer = DllStructCreate("byte[" & $length & "]")
    $pBuffer = DllStructGetPtr($tBuffer)
    $buffer = Binary('')
    $fInternal = True
    EndIf
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitReadNonBlocking", "ptr", $devHandle, "ULONG", $numPipe, "ptr", $pBuffer, "ULONG", $length)
    If @error Then Return SetError(1, @error, 0)
    If $fInternal Then
    $buffer = DllStructGetData($tBuffer,1)
    $tBuffer = 0
    EndIf
    Return $aResult[0]
    EndFunc ;==>_IowKitReadNonBlocking

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitReadImmediate(IOWKIT_HANDLE devHandle, PDWORD value);
    Func _IowKitReadImmediate($devHandle, ByRef $value)
    ; Author: ProgAndy
    $value = 0
    Local $aResult = DllCall($ghIOWkitDll, "none", "IowKitReadImmediate", "ptr", $devHandle, "dword*", 0)
    If @error Then Return SetError(1, @error, 0)
    $value = $aResult[2]
    Return $aResult[0]
    EndFunc ;==>_IowKitReadImmediate

    [/autoit] [autoit][/autoit] [autoit]

    ;--------------------------------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitGetNumDevs(void);
    Func _IowKitGetNumDevs()
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetNumDevs")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetNumDevs

    [/autoit] [autoit][/autoit] [autoit]

    ;~ IOWKIT_HANDLE IOWKIT_API IowKitGetDeviceHandle(ULONG numDevice);
    Func _IowKitGetDeviceHandle($numDevice)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetDeviceHandle", "ulong", $numDevice)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetDeviceHandle

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitSetLegacyOpenMode(ULONG legacyOpenMode);
    Func _IowKitSetLegacyOpenMode($legacyOpenMode)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetLegacyOpenMode", "ulong", $legacyOpenMode)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitSetLegacyOpenMode

    [/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitGetProductId(IOWKIT_HANDLE devHandle);
    Func _IowKitGetProductId($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetProductId", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetProductId

    [/autoit] [autoit][/autoit] [autoit]

    ;~ ULONG IOWKIT_API IowKitGetRevision(IOWKIT_HANDLE devHandle);
    Func _IowKitGetRevision($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ulong", "IowKitGetRevision", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetRevision

    [/autoit] [autoit][/autoit] [autoit]

    ;~ HANDLE IOWKIT_API IowKitGetThreadHandle(IOWKIT_HANDLE devHandle);
    Func _IowKitGetThreadHandle($devHandle)
    Local $aResult = DllCall($ghIOWkitDll, "ptr", "IowKitGetThreadHandle", "ptr", $devHandle)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitGetThreadHandle

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;--------------------------------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitGetSerialNumber(IOWKIT_HANDLE devHandle, PWCHAR serialNumber);
    Func _IowKitGetSerialNumber($devHandle, ByRef $serialNumber)
    $serialNumber = ''
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitGetSerialNumber", "ptr", $devHandle, "wstr", '')
    If @error Then Return SetError(1, @error, 0)
    $serialNumber = $aResult[2]
    Return $aResult[0]
    EndFunc ;==>_IowKitGetSerialNumber

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitSetTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    Func _IowKitSetTimeout($devHandle, $timeout)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetTimeout", "ptr", $devHandle, "ULONG", $timeout)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitSetTimeout

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitSetWriteTimeout(IOWKIT_HANDLE devHandle, ULONG timeout);
    Func _IowKitSetWriteTimeout($devHandle, $timeout)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitSetWriteTimeout", "ptr", $devHandle, "ULONG", $timeout)
    If @error Then Return SetError(1, @error, 0)
    EndFunc ;==>_IowKitSetWriteTimeout

    [/autoit] [autoit][/autoit] [autoit]

    ;~ BOOL IOWKIT_API IowKitCancelIo(IOWKIT_HANDLE devHandle, ULONG numPipe);
    Func _IowKitCancelIo($devHandle, $numPipe)
    Local $aResult = DllCall($ghIOWkitDll, "bool", "IowKitCancelIo", "ptr", $devHandle, "ULONG", $numPipe)
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitCancelIo

    [/autoit] [autoit][/autoit] [autoit]

    ;--------------------------------------------------------------------------------------------------

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ PCSTR IOWKIT_API IowKitVersion(void);
    Func _IowKitVersion()
    Local $aResult = DllCall($ghIOWkitDll, "str", "IowKitVersion")
    If @error Then Return SetError(1, @error, 0)
    Return $aResult[0]
    EndFunc ;==>_IowKitVersion

    [/autoit]
  • Ich hab die Funktionsnamen nicht ganz korrekt geschrieben. Da hat es ein paar Unterstriche zu wenig oder so ;)

  • Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = _IowKitOpenDevice();
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = _IowKitGetNumDevs();
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial
    For $i = 1 To $numIows
    ; Get device handle and init object
    $iows[$i-1] = _IowKitGetDeviceHandle($i);
    ; Get serial number
    _IowKitGetSerialNumber($iows[$i-1], $serial);
    $pid = _IowKitGetProductId($iows[$i]);
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial)); Habe hier noch eine Zweite klammer dazu gemacht ;)
    Next
    ; Close device
    _IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Und alle unterstriche gesetzt...

    [/autoit] [autoit][/autoit] [autoit]

    Das bekomme ich zurück:
    ==========================
    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    Device Opened
    1 IOWs in system

    [/autoit] [autoit][/autoit] [autoit]

    ===========================

    [/autoit] [autoit][/autoit] [autoit]

    Es passiert auch nicht mehr, als würde er wo stehen bleiben. Hm... Die Befehle sind richtig geschrieben, sonnst würde er wohl meckern ;(

    [/autoit]
  • Ja, ich konnte den Code nicht testen. Schau dir mal Zeile 28 an
    $pid = _IowKitGetProductId($iows[$i]);
    fällt dir was auf, vor allem im Vergleich zur vorherigen Zeile?

  • Ich meine bei $i-1 (das fehlt bei der ID-Zeile)
    Du kannst ja ein paar MsgBoxen einbauen und schauen, wo es hängen bleibt.

  • Also, ich komme mir absolut doof vor. Ich lese die Hilfsdatei von meinem Warrior, und habe mein Script mit meinen Boxen:

    Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = _IowKitOpenDevice();
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = _IowKitGetNumDevs();
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial
    For $i = 1 To $numIows
    Msgbox(0,"1",$i)
    ; Get device handle and init object
    $iows[$i-1] = _IowKitGetDeviceHandle($i);
    Msgbox(0,"2",)
    ; Get serial number
    _IowKitGetSerialNumber($iows[$i-1], $serial);
    $pid = _IowKitGetProductId($iows[$i]);
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial));
    Next
    ; Close device
    _IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit]

    Und die 1 Box kommt, aber nicht mehr die zweite. Und ich begreife einfach nicht wieso. Es wird ja zuzusagen 0 für $i eingetragen, weil oben $i als 1 deklariert wird, und dann wider eines abgezogen wird.

  • Meinst du als ID die Zeile 23 ?

    Ich habe

    Spoiler anzeigen
    [autoit]

    For $i-1 = 1 To $numIows

    [/autoit]

    und

    Spoiler anzeigen
    [autoit]

    For [$i-1] = 1 To $numIows

    [/autoit]

    versucht. Klappt leider nicht. Ich bekomme in meiner ersten Msgbox wenn ich nur For $i = 1 To $numIows stehen habe einen "1" zurück, udn wenn ich For $i-1 = 1 To $numIows schreibe ein True.

    lg Tim

  • ... Ich habe mir jetzt mal ie Dokumentation durchgelesen, finde aber keinen Grund, warum AutoIt sich ohne Fehlermeldung aufhängt.
    Bei genauerer Betrachtung sieht man, dass ich die Array-Variable umbenannt habe, aber im folgenden Skript die Änderungen nicht übernommen habe. Das sollte AutoIt eigentlich melden ...

    PS: das -1 fehlte hier: $pid = _IowKitGetProductId($ahIOW[$i-1]);

    Ihne Testlauf kann ich jetzt keine Fehler mehr finden. Hab extra 3x drübergeschaut.

    Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = _IowKitOpenDevice();
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = _IowKitGetNumDevs();
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial
    For $i = 1 To $numIows
    ConsoleWrite("+Loop " & $i & '/' & $numIows & @CRLF)
    ; Get device handle and init object
    $ahIOW[$i-1] = _IowKitGetDeviceHandle($i)
    ConsoleWrite("-after _IowKitGetDeviceHandle" & @CRLF)
    ; Get serial number
    _IowKitGetSerialNumber($ahIOW[$i-1], $serial);
    ConsoleWrite("-after _IowKitGetSerialNumber" & @CRLF)
    $pid = _IowKitGetProductId($ahIOW[$i-1]);
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial));
    Next
    ; Close device
    _IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit]
  • ES GEHT !!!!

    DANKE DIR MEISTER

    Ich bekomme nun folgendes zurück :

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    Device Opened
    1 IOWs in system
    +Loop 1/1
    -after _IowKitGetDeviceHandle
    -after _IowKitGetSerialNumber
    1 PID 1500, S/N "0000387C"
    Device closed
    >Exit code: 0 Time: 0.207

    [/autoit]

    lg Tim

  • So, nun sind 90% geschaft. Nun habe ich nurnoch 1 Problem. Undzwar das schreiben von Daten. Ich weis folgendes:

    Die Daten werden in Form eines 32-Bit wortes geschrieben z.B. (0x00FF00FF00)
    Es wird die Funktion _IOWKITWRITE benötigt.
    Wenn ich 0x00000000 an meinen Warrior schicke, leuten alle Test-LED´s.

    Vorraussetztungen sind diverse Handles und Variablen, die wir in den letzten 2 Wochen geschaft haben zu gewinnen.

    Nun bleibt noch die Frage, was kommt wohin. Ich habe volgenden Ansatz, bei deinem Script. Das habe ich hier nochmal gepostet, um die Variablen und Arrays besser zu erkennen:

    Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = _IowKitOpenDevice();
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = _IowKitGetNumDevs();
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial
    For $i = 1 To $numIows
    ConsoleWrite("+Loop " & $i & '/' & $numIows & @CRLF)
    ; Get device handle and init object
    $ahIOW[$i-1] = _IowKitGetDeviceHandle($i)
    ConsoleWrite("-after _IowKitGetDeviceHandle" & @CRLF)
    ; Get serial number
    _IowKitGetSerialNumber($ahIOW[$i-1], $serial);
    ConsoleWrite("-after _IowKitGetSerialNumber" & @CRLF)
    $pid = _IowKitGetProductId($ahIOW[$i-1]);
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial));
    Next
    ; Close device
    _IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit]
    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    IowKitWrite($ahIOW[$i-1], 0 - wegen den normalen I/O Pins - siehe der Beschreibung , Was als Report kommt kann ich mir nicht erklären, hier z.B. 0x00000000 - das was geschrieben werden soll)

    [/autoit]

    Auszug aus der Beschreibung:

    Spoiler anzeigen
    [autoit]

    IowKitWrite
    Declaration:
    ULONG IOWKIT_API IowKitWrite(IOWKIT_HANDLE devHandle, ULONG numPipe,
    PCHAR buffer, ULONG length);
    function IowKitWrite(devHandle: IOWKIT_HANDLE; numPipe: ULONG;
    buffer: PChar; length: ULONG): ULONG; stdcall;
    Write length bytes of data to pipe numPipe of IO-Warrior. The return value is the number of bytes
    written. Writing something else than a single report of the correct size and a valid report ID for the pipe
    fails for Windows. The function allows writing to the I/O pins through pipe 0 and Special Mode functions
    through pipe 1. To be completely compatible with the Windows version libiowkit.so expects a ReportID 0
    for pipe 0 (I/O pins) even if Linux does not have a ReportID on pipe 0. The ReportID is stripped from the
    data sent to the device.
    Sample write to pipe 0 of an IO-Warrior 40:
    DWORD value consists of 32 bits, which correspond to the 32 IO-Warrior 40 I/O pins. Each bit has the
    following meaning:
    When a 1 is written to a pin the output driver of that pin is off and the pin is pulled high by an internal
    resistor. The pin can now be used as an input or an output with high state.
    When a 0 is written to a pin the output driver is switched on pulling the pin to ground. The pin is now a
    output driving low.
    For example, writing 0 (all 32 bits are zero) to IO-Warrior sets all pins as outputs driving low (so if you
    have LEDs connected to them they will be on).
    Reading the status of the pins does always return the logic level on the pins, not the value written to the
    pin drivers.
    Writing 0xFFFFFFFF (value in hex, all 32 bits set) sets all pins as inputs.
    Note that if you want to use a pin as an input, you must first set it up as input, in other words, you must
    write 1 to it. For connected LEDs this means they go off.
    Sample usage C:
    IOWKIT40_IO_REPORT report;
    ULONG res;
    // Write IO pins of IO-Warrior 40
    report.ReportID = 0;
    report.Value = 0; // all LEDs *on*
    res = IowKitWrite(ioHandle, IOW_PIPE_IO_PINS,
    &report, IOWKIT40_IO_REPORT_SIZE);
    if (res != IOWKIT40_IO_REPORT_SIZE)
    {
    // Didn't write, handle error
    ...
    }

    [/autoit]

    lg Tim

  • Also das meiste müsstest du jetzt selbst können.
    Für den report solltest du dir noch die DLLStruct-Funktionen ansehen.

  • So, also soweit bin ich nun:

    Spoiler anzeigen
    [autoit]

    #include "iowkit.au3"

    [/autoit] [autoit][/autoit] [autoit]

    Global $ahIOW[$IOWKIT_MAX_DEVICES]

    [/autoit] [autoit][/autoit] [autoit]

    If Not _IowKitStartUp() Then ; Die Dll wird geladen
    ConsoleWrite("Failed to load iowkit dll" & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Open device
    Global $devHandle = _IowKitOpenDevice() ; Die Verbindung zum Warrior wird hergestellt
    If Not $devHandle Then
    ConsoleWrite("Failed to open device" & @CRLF)
    Exit
    EndIf
    ConsoleWrite("Device Opened" & @CRLF)

    [/autoit] [autoit][/autoit] [autoit]

    ; Get number of IOWs in system
    $numIows = _IowKitGetNumDevs() ; Gibt die Anzahl an IOW´s im System wider
    ConsoleWrite(StringFormat("%d IOWs in system\n", $numIows))
    ; Get all IOW handles
    Dim $serial ; Variable wird deklariert
    For $i = 1 To $numIows
    ;~ ConsoleWrite("+Loop " & $i & '/' & $numIows & @CRLF)
    ; Get device handle and init object
    $ahIOW[$i-1] = _IowKitGetDeviceHandle($i) ; Gibt ein Handle für einen der IOW´s zurück
    ;~ ConsoleWrite("-after _IowKitGetDeviceHandle" & @CRLF)
    ; Get serial number
    _IowKitGetSerialNumber($ahIOW[$i-1], $serial); Schreibt die Seriennummer in einen buffer ( serial )
    ;~ ConsoleWrite("-after _IowKitGetSerialNumber" & @CRLF)
    $pid = _IowKitGetProductId($ahIOW[$i-1]) ; Gibt die Produkt ID des IOW´s zurück. Bei den 40ern ist es meist die 1500
    ConsoleWrite(StringFormat('%d PID %x, S/N "%s"\n', $i, $pid, $serial));
    Next

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    $write = _IowKitWrite($ahIOW[$i-1],"IOW_PIPE_IO_PINS",0x00000000, "IOWKIT40_IO_REPORT_SIZE");
    If Not $write = "IOWKIT40_IO_REPORT_SIZE" Then
    ConsoleWrite("Fail to send some Data to IOW " & $serial & @CRLF)
    Exit
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    ; Close device
    _IowKitCloseDevice($devHandle);
    ConsoleWrite("Device closed" & @CRLF)

    [/autoit]


    Das ist meine Antwort:

    Spoiler anzeigen
    [autoit]

    >"D:\Programme\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "C:\Users\User\Desktop\test2.au3"
    Device Opened
    1 IOWs in system
    1 PID 1500, S/N "0000387C"
    Fail to send some Data to IOW 0000387C

    [/autoit]

    Ich weis nur nicht, ob ich nun IOW_PIPE_IO_PINS durch eine 0 ersetzten soll oder nicht. So steht es in der Beschreibung, aber in den Beispielen finde ich immer IOW_PIPE_IO_PINS.
    Das selbe auch bei IOWKIT40_IO_REPORT_SIZE. Ich habe shcon gegoogelt, aber ich finde auch nur Beispiele, in denen der Text steht, und kein Wert.

    lg Tim

  • In AutoIt musst du das als Variable schreiben ;)

    [autoit]

    $tIOWKIT40_IO_REPORT = DLLStructCreate($IOWKIT40_IO_REPORT)
    DLLStructSetData($tIOWKIT40_IO_REPORT, ...)
    $write = _IowKitWrite($ahIOW[$i-1], $IOW_PIPE_IO_PINS, $tIOWKIT40_IO_REPORT , $IOWKIT40_IO_REPORT_SIZE);

    [/autoit]