-
Notifications
You must be signed in to change notification settings - Fork 281
Port.Read Timeout on a SerialPort #173
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
Comments
You have rewritten its settings here.
|
OK, so those values are just a higher layer abstraction of the actual serial port values. That makes sense. |
The last value will win.
The line:
master.Transport.ReadTimeout = 1000
Just calls serialPort.ReadTimeout under the covers.
…On Thu, Feb 1, 2024 at 4:10 AM Dylan ***@***.***> wrote:
Good day,
I would like to understand how the library works with serial timeouts?
I have the following test code:
` var serialPort = new SerialPort("COM1", 9600, Parity.None, 8,
StopBits.One);
//Set Serial Timeouts
serialPort.ReadTimeout = 500;
serialPort.WriteTimeout = 100;
var factory = new ModbusFactory();
IModbusMaster master = factory.CreateRtuMaster(serialPort);
//Change settings
master.Transport.Retries = 0;
master.Transport.ReadTimeout = 1000;
master.Transport.WriteTimeout = 200;
//Read device which is offline.
master.ReadHoldingRegisters(1, 1, 1);`
Which timeout values will be applied to the actual physical rs485 serial
port?
A: 550 & 100
or
B: 1000 & 200
—
Reply to this email directly, view it on GitHub
<#173>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABAYJ3VBR3JZSTENS7OGTCTYRNLX7AVCNFSM6AAAAABCUQK6VCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTCOJVHA3TCNY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Good day,
I would like to understand how the library works with serial timeouts?
I have the following test code:
` var serialPort = new SerialPort("COM1", 9600, Parity.None, 8, StopBits.One);
//Set Serial Timeouts
serialPort.ReadTimeout = 500;
serialPort.WriteTimeout = 100;
var factory = new ModbusFactory();
IModbusMaster master = factory.CreateRtuMaster(serialPort);
//Change settings
master.Transport.Retries = 0;
master.Transport.ReadTimeout = 1000;
master.Transport.WriteTimeout = 200;
//Read device which is offline.
master.ReadHoldingRegisters(1, 1, 1);`
Which timeout values will be applied to the actual physical rs485 serial port?
A: 550 & 100
or
B: 1000 & 200
The text was updated successfully, but these errors were encountered: