It is possible to create custom modbus slaves, both TCP and RTU with varying levels of customisation.
At the simplest it is possible to have a custom device descriptor with a name associated with some or all of the registers and coils on the slave making integration easier - no more looking up register addresses.
The next level of integration can pre-define channels. i.e. as soon as the device is added to a project then the Channels are already defined, all thet is required is for the parameters to be mapped into the application.
A further level of integration allows the installation of the device to add a library to the Library Manager, and create a function block in the IOConfigGlobals and map parameters from the defined channels into the function block. If this is done for all required parameters then all that is required to use the device is to add it to the project and then use variables directly in the application.
In all of these cases it is then possible to modify the pre-defined channels and mappings and to add more channels as required in the same way as for any CODESYS device.
The effort to create a custom modbus slave varies significantly depending on the level of customisation, the number of registers and coils, and how the address space of the slave device is specified. I have created custom modbus devices for several device vendors already. If you wish to discuss this further please contact me https://www.cososo.co.uk/contact/