This Video will guide you through the configuration of Modbus RTU in #raspberrypi using USB to Serial Chipset and connect with #codesys.
command to open configuration file :sudo nano /etc/CODESYSControl.cfg
setting to change
[SysCom]
Linux.Devicefile=/dev/ttyUSB
portnum := COM.SysCom.SYS_COMPORT1;
you can buy the hardware from amazon
USB to Modbus : https://amzn.eu/d/9SQfH9v , https://amzn.eu/d/ccBQrLO