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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
regards,
Leonardo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
Regards,
Leonardo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello there
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 =-]
At tree:
[-img src=Modbus Tree.PNG width=50%: missing =-]
The status:
[-img src=Modbus Status.PNG width=50%: missing =-]
Can anyone help me? Is urgent.
Regards,
Leonardo
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
hello there
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?
regards,
Leonardo
Hello there.
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.
Regards,
Leonardo
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)
etc/CODESYSControl_Users.cfg
Last edit: eschwellinger 2023-02-28