Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninterruptible CRC error cycle during ModbusIpMaster work #61

Closed
GoogleCodeExporter opened this issue Oct 2, 2015 · 0 comments
Closed

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. CreateIpMaster object
2. Connect remote device using RTUSerial
3. Generate some packet that contains CRC error and size of response must be 
greater than expected
4. After this steps CRC errors will be produced until TcpClient closes 
connection

This problem take place because method DiscardInBuffer() of TcpClientAdapter 
contains code that not clears input buffer. Read manul carefuly for Flush 
method. (code _tcpClient.GetStream().Flush(); - just do nothing at all), 
instead of Flush you must use something like this:

 if (_tcpClient.Available > 0)
 {
   while (_tcpClient.GetStream().ReadByte() > -1 &&
          _tcpClient.Available > 0)
                    ;
 }

What is the expected output? What do you see instead?
I expect only one CRC error and normal work after, instead i see unending 
stream of CRC error exceptions.

What version of the product are you using? On what operating system?
1.11.0.0, any OS

Please provide any additional information below.
please notify me about this bug to my second mail: taiwan@ya.ru

Original issue reported on code.google.com by taiwan....@gmail.com on 27 Apr 2012 at 3:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants