ich hatte bisher ein python-script, welches pyserial verwendet unter linux und
winXP (32) am laufen. Habe ich eine Chance das unter win7 (64bit) zum laufen
zu bekommen? Erstmal bekomme ich, obwohl COM50 existiert und sendet (HTERM):
code:Traceback (most recent call last):
File "C:\Program Files (x86)\Wing IDE 101 4.0\src\debug\tserver\_sandbox.py", line 32, in <module>
File "C:\Python26\Lib\site-packages\serial\serialwin32.py", line 236, in read
raise SerialException("ReadFile failed (%s)" % ctypes.WinError())
serial.serialutil.SerialException: ReadFile failed ([Error 6] Das Handle ist ungültig.)
>>>
Code: Alles auswählen
import serial
try:
s1=serial.Serial('COM50',
baudrate=115200, #baudrate
bytesize=8, #number of databits
parity=serial.PARITY_NONE, #disable parity checking
stopbits=serial.STOPBITS_ONE, #number of stopbits
timeout=2 #in sek., None: wait for ever
)
except (serial.serialutil.SerialException, AttributeError, IndexError):
print 'mist'
if __name__=='__main__':
str3=s1.read(12)
print str3