Skip to content

connect for different unitId with the same host and port #353

Open

Description

@dyaacov

Hi,

I need to connect to the same host and port, but different unitIds

In the code, it looks like the connection is based on unitId as well.
new Modbus.client.TCP(socket, unitId)

Is there a best practice to reuse the same connection for different unitId?

Thanks
Dekel

Activity

  1. stefanpoeter commented on Aug 27, 2025

    @stefanpoeter
    Member

    Hi @dyaacov

    I guess you could writte a wrapper for node.js net module. That should not be to hard, the methods and events are used in the code and you can simply forward messages to the same target port.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions