Author Topic: Modbus timeout handling  (Read 576 times)

peer

  • Newbie
  • *
  • Posts: 22
    • View Profile
Modbus timeout handling
« on: December 22, 2014, 06:53:22 pm »
How do I know which request (or address) did timeout in the TimeOut event when registers are polled?
What is the best way to handle a timeout ? Because now a timeout  on one address slows down everything.

peer

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Modbus timeout handling
« Reply #1 on: February 10, 2015, 01:59:55 pm »
Support in winter sleep ??

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: Modbus timeout handling
« Reply #2 on: March 02, 2015, 10:33:26 am »
Hello

We are still alive :-)

The timeout is handled by following internal code:

Code: [Select]
procedure TnrModbus.DoTimeoutError;
begin
  inherited DoTimeoutError;
  if stackRequests.Count > 0
    then ConnectedDeviceRemove(TnrModbusPacket(stackRequests[0]).Address);
  PopNextRequest;
end;

But unfortunately stackRequests items are not PUBLIC for access from external.
We will resolve this issue asap.

By the way .NET version of nrComm already provides necessary functionality:
ModBus.GetCurrentRequest()

We will repeat this method in VCL release soon.

Sorry.

Roman Novgorodov
DeepSoftware llc
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.