RTU request over RS-232 to Ethernet converter
-
Hello,
I have a scenario where a RTU RS-232 modbus device is connected to PC using a RS-232 to Ethernet converter.
I can only use TCP to comunicate to the device, via the RS-Ethernet converter.
Which kind of ModbusMaster shall I use ?
Is there any way to transparently issue RTU requestes over the TCP connection ?Thanks is advance.
-
I reply to myself.
Simply set encapsulated to true when creating the IpParameters.
IpParameters ip = new IpParameters(); ip.setHost("192.168.15.30"); ip.setEncapsulated(true); ip.setPort(4001); ModbusFactory factory = new ModbusFactory(); ModbusMaster master = factory.createTcpMaster(ip, true);