modbus-dart icon indicating copy to clipboard operation
modbus-dart copied to clipboard

Unable to connect multiple clients to the same PLC simultaneously

Open shaileshsaxena1011 opened this issue 11 months ago • 0 comments

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<String> 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

shaileshsaxena1011 avatar Mar 27 '24 03:03 shaileshsaxena1011