I have a problem with Modbus RTU usage. My hardware is a custom board raspberry pi cm4 based and serial works with generic python code but with codesys the SerialPort at Modbus_COM stays "Not running".
I configured /etc/CODESYSControl.cfg and /etc/CODESYSControl_User.cfg with:
[SysCom]Linux.Devicefile=/dev/ttyS or [SysCom]Linux.Devicefile=/dev/ttyAMA
I added the portnum := COM.SysCom.SYS_COMPORT1; line too.
but neither of them works.
The config of Modbus_COM is:
[-img src=Modbus Config.PNG width=50%: missing =-]
[-img src=Modbus Tree.PNG width=50%: missing =-]
[-img src=Modbus Status.PNG width=50%: missing =-]
Can anyone help me? Is urgent.
green curcle at comport indicates that comopen works - so check wiring/baudrate to the slave
you could even add 'Modbus_Master_com_Port'to the watchlist ( the name of the instance in the device tree) to get more diagnostic info
thank you for your reply.
I checked it. With simple python code I can communicate normally. But with Codesys no. I found it strange because despite green circle the SerialPort Status are "not running" like not was open. So I think it might be related with some configuration of serial on Codesys files but I make all of I found to make and not works.
do you have any more ideas?
I fixed the problem removing all SysCom configuration at /etc/CODESYSControl.cfg and removing the "portnum := COM.SysCom.SYS_COMPORT1;" at /etc/CODESYSControl_User.cfg remaining just "[SysCom]Linux.Devicefile=/dev/ttyS" at /etc/CODESYSControl_User.cfg
Thank you for your help.
Hello sir I have the same problem with codesys how do you manage to troubleshoot the problem. And what is that Syscom configuration are you saying. Hopefully you see my message. Im using Revolution Pi RevPi Connects.
Example for doing this ( I assume you have connected a USB serial device for this example)
Log in to post a comment.