I attached an image that shows that when I create ModbusTCPSlave instance via code, it doesn't connect, but when I create a Slave in my device tree, it connects and works.
Unfortunately I can't update to SP17 and use the ModbusFB function block due to manufacturer constraints,
Does anyone of you know how to get my ModbusTCPSlave to connect?π
The ModbusFB library was written precisely because it is not possible to get your ModbusTCPSlave to connect - this only works when added to the device tree.
I would first try to open a project archive of your PLC in SP17 Patch 1 and get the ModbusFB library to work. So old runtime device description + compiler version 3.5.17.10 + IDE SP17 Patch 1. If it doesn't work, ask your PLC manufacturer to support you to use that library.
If that doesn't work, use a different PLC for your Modbus TCP Master purposes.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello folks, I'm trying to create a Modbus TCP client directly from code, but I'm having some issues...
to do this I imported the library IoDrvModbusTCP, and both a ModbusRequest instance and a ModbusTCPSlave instance. I set the ModbusTCPSlave configuration using the UpdateCommunicationSettings method, but can't get it to connect. I followed the instructions at this link:
https://help.codesys.com/webapp/_mod_lib_modbustcpslave;product=core_modbus_configuration_editor;version=3.5.12.0
where it tells to use the property xEnable, which doesn't exist.
I attached an image that shows that when I create ModbusTCPSlave instance via code, it doesn't connect, but when I create a Slave in my device tree, it connects and works.
Unfortunately I can't update to SP17 and use the ModbusFB function block due to manufacturer constraints,
Does anyone of you know how to get my ModbusTCPSlave to connect?π
Thanks
The ModbusFB library was written precisely because it is not possible to get your ModbusTCPSlave to connect - this only works when added to the device tree.
I would first try to open a project archive of your PLC in SP17 Patch 1 and get the ModbusFB library to work. So old runtime device description + compiler version 3.5.17.10 + IDE SP17 Patch 1. If it doesn't work, ask your PLC manufacturer to support you to use that library.
If that doesn't work, use a different PLC for your Modbus TCP Master purposes.