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

GatewayTargetDeviceFailedToRespond with Modbus TCP Client #82

Open
skykep opened this issue Jan 3, 2025 · 0 comments
Open

GatewayTargetDeviceFailedToRespond with Modbus TCP Client #82

skykep opened this issue Jan 3, 2025 · 0 comments

Comments

@skykep
Copy link

skykep commented Jan 3, 2025

If I have my polling interval too fast, I get this error. The client/server (master/slave) are in very close proximity on an uncongested network.

    modbus.tcp.connect(502, "192.168.2.165", { debug: null, retries: 0, retry: 3000 }, (err, connection) => {
        // do something with connection
        setInterval(function () {
            connection.readHoldingRegisters({ address: (sqlResult[0].MBAddr - 40000), quantity: 2 * sqlResult.length, extra: { unitId: 1 } }, (err, res) => {
                if (err) {
                    console.log(Date.now() + ": " + err);
                }
                    for (i = 0; i < sqlResult.length; i++) {
                        convert_to_32(res.response.data[2 * i].readUIntBE(0, 2), res.response.data[2 * i + 1].readUIntBE(0, 2), 'ModbusData[' + i + ']');
                    }
            });
        }, 200);
    });

Very randomly, I get "Error: GatewayTargetDeviceFailedToRespond:"

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

No branches or pull requests

1 participant