BiancoRoyal/node-red-contrib-modbus

[Modbus Flex Getter] Queue is reset on timeout

AdrienAdB opened this issue · 2 comments

Which node-red-contrib-modbus version are you using?

5.25

What happened?

  • Enable queuing
  • Send messages by polling multiple unitIds (from 1 to 4)
const registers = [
    {
        'fc': 4,
        'unitid': 1,
        'address': 0xD010,
        'quantity': 2,
    },
    {
        'fc': 4,
        'unitid': 2,
        'address': 0xD010,
        'quantity': 2,
    },
    {
        'fc': 4,
        'unitid': 3,
        'address': 0xD010,
        'quantity': 2,
    },
    {
        'fc': 4,
        'unitid': 4,
        'address': 0xD010,
        'quantity': 2,
    }
]

for (let index = 0; index < registers.length; index++) {
    msg.payload = registers[index];
    node.send(msg);    
}
  • In normal conditions, devices will reply and data can be processed. OK.
  • But if unitId 2 fails on timeout, client reconnects, but queue messages are being reset. Devices 3,4 won't be called.

I found way to quick fix by adding rate limiter before the modbus getter, however polling becomes too slow, expecially when you have 30+ devices on the bus.

Anyway to prevent queue reset on reconnect?

Server

Modbus-Server Node

How can this be reproduced?

Described above.

What did you expect to happen?

Queue to no reset on timeout error

Other Information

No response

It gets a reset from the problem complexity of what is actual happened. You can handle it via your own queue in Node-RED in that case.

This issue is stale because it has been open 60 days with no activity. It will be closed in 30 days, but can be saved by removing the stale label or commenting.