Skip to content

Unable to connect multiple clients to the same PLC simultaneously #33

Description

@shaileshsaxena1011

My requirement is to connect multiple simultaneous connections to the same PLC. Below is my code snippet:

import 'package:modbus/modbus.dart' as modbus;
main(List arguments) async {
var client = modbus.createTcpClient(
'192.168.250.40',
port: 502,
mode: modbus.ModbusMode.rtu,
);
try {
await client.connect();
client.setUnitId(100);
client.readHoldingReg(301,1)
} finally {
client.close();
}
}

I can connect a single client to the PLC but when I connect the second client to PLC I get a connection refused error.

I would greatly appreciate it if you could help me out here. I have a strict client deadline to meet

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions