wewa00 / modbus-tk

Automatically exported from code.google.com/p/modbus-tk
Other
0 stars 0 forks source link

Error while handling request, Exception occurred: WriteFile failed ([Error 995].... #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using 0.4.0, RTU server

Have a virtual com port - COM11  (Windows XP PC, Python 2.6)

Server starts up ok and when its receives a request it then tries to reply. See 
the following screen capture...

Open com11 19200 N
RtuServer com11 is opened
running...
enter 'quit' for closing the server
-->1-3-0-0-0-2-196-11
<--1-3-4-67-3-15-90-154-124
Error while handling request, Exception occurred: WriteFile failed ([Error 995]
The I/O operation has been aborted because of either a thread exit or an 
application request.)

No other application is using this com port. Hyper terminal works with the 
virtual com port. The following test code works ok...

import serial

print "Test 1"
s = serial.Serial(port="COM11", baudrate=19200, timeout=1)
print "s= %r" % (s)
rx = s.read(10)        # read up to ten bytes (timeout)
print "rx= %r" % (rx)
tx = s.write("hello\n")
print "tx= %r" % (tx)
s.close()

Thank you
Regards
Michael

Original issue reported on code.google.com by michael....@gmail.com on 8 Dec 2010 at 2:56

GoogleCodeExporter commented 8 years ago
Hello Michael,
Which kind of virtual port do you use?
Can you try to put the serial example you gave in a loop and see if you can 
reproduce the problem?
Which Rtu master do you use to query the server?
Best
luc

Original comment by luc.jean@gmail.com on 10 Dec 2010 at 8:56

GoogleCodeExporter commented 8 years ago
Hello Luc

I am using a device server from Oring Networking IDS-5042

see: 
http://www.oring-networking.com/product/view/cate_sn/114/product_sn/19/IDS-5042%
20/%205042+ 

I tried a loop on the test code and all is ok
I also mapped the virtual com port to COM3 and this made no difference

I am using my own RTU master
All works ok on a real comport (even USB to serial ones)

Is it something to with threading?

Thank you
Regards
Michael

Original comment by michael....@gmail.com on 10 Dec 2010 at 4:04

GoogleCodeExporter commented 8 years ago
Hello Michael,
It seems that this is a serialcom issue.
Can you try to reproduce the error with pyserial by building the modbus answer 
manually?
Would be interesting if it comes from the serial stack or from the Modbus stack.
I would also recommend to ask for help on pyserial discussion list
I hope it helps
Best

Original comment by luc.jean@gmail.com on 10 Dec 2010 at 4:32

GoogleCodeExporter commented 8 years ago
Thank you

Added a question to pyserial list
http://sourceforge.net/tracker/?func=detail&aid=3136562&group_id=46487&atid=4463
03

Original comment by michael....@gmail.com on 15 Dec 2010 at 8:24

GoogleCodeExporter commented 8 years ago

Original comment by luc.jean@gmail.com on 29 Apr 2015 at 10:11