Hi Eberhard, Hi Robert,
Eclipse is a real showstopper on startup (another other one is Staroffice).
Do you still get the error when you don't do anything like the above, do you fail when your machine is "normal" operation?
Yes, i still get error sometimes even when I do nothing.
What happens if you increase the timeout to some rediculous value like 60 seconds?
the same result.
If you could mail the python-testapp to me I could try a few runs on my machine. I case there is a problem with the allover systemload.
here is my short Python code. In order to run it you must have installed ctypes from
http://starship.python.net/crew/theller/ctypes/
Code: Select all
import time
import os
import sys
from string import *
from ctypes import *
class IowReadResult56(Structure):
_fields_ = [("ReportId", c_ubyte), ("IowReadResult", c_ubyte*63 )]
DeviceHandle = windll.Iowkit.IowKitOpenDevice()
windll.Iowkit.IowKitSetTimeout(DeviceHandle, 5000)
datac = IowReadResult56()
datac.ReportId = 8
datac.IowReadResult[0] = 1
datac.IowReadResult[1] = 0
datac.IowReadResult[2] = 1
#configure the IoWarrior56 with "enable"=1; "mode"=1; "clock"=1
BytesWritten = windll.IowKit.IowKitWrite(DeviceHandle, 1, pointer(datac), sizeof(IowReadResult56))
if BytesWritten != sizeof(IowReadResult56):
print BytesWritten
raise "IoWarrior: Not all bytes written!"
datac.ReportId = 9
datac.IowReadResult = (61, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60)
for i in range(1, 3000):
BytesWritten = windll.IowKit.IowKitWrite(DeviceHandle, 1, pointer(datac), sizeof(IowReadResult56))
if BytesWritten != sizeof(IowReadResult56):
raise "IoWarrior: Not all bytes written!"
ReturnLength = windll.Iowkit.IowKitRead(DeviceHandle, 1, pointer(datac), sizeof(IowReadResult56))
if ReturnLength != sizeof(IowReadResult56):
print "ReturnLength:", ReturnLength
print "GetLastError():", windll.kernel32.GetLastError()
raise "IoWarrior: Not all bytes read!"
ReturnList = []
for k in range(1, datac.IowReadResult[0]+1):
ReturnList.append(datac.IowReadResult[k])
print ReturnList
#time.sleep(0.05)
windll.Iowkit.IowKitCloseDevice(DeviceHandle)
del DeviceHandle
I just did some tests though the playback function of SimpleHIDWrite and i did no lose any read reports even when starting StarOffice or Eclipse.
I have the same result. By the way, is there some difference between using IowKit.dll and using HID API?
Many thanks for your kind help so far!
regards,
Ligang