8000 Port.Read Timeout on a SerialPort · Issue #173 · NModbus/NModbus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Open
Zapnologica opened this issue Feb 1, 2024 · 3 comments
Open

Port.Read Timeout on a SerialPort #173

Zapnologica opened this issue Feb 1, 2024 · 3 comments

Comments

@Zapnologica
Copy link

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

@Magniveo
Copy link
Magniveo commented Feb 1, 2024

You have rewritten its settings here.

master.Transport.ReadTimeout = 1000;
master.Transport.WriteTimeout = 200;

@Zapnologica
Copy link
Author

OK, so those values are just a higher layer abstraction of the actual serial port values.

That makes sense.

@rquackenbush
Copy link
Contributor
rquackenbush commented Feb 1, 2024 via email

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

No branches or pull requests

3 participants
0