I'm using the following setup:
- Raspberrry Pi 3 as Modbus RTU Master (MODBUS_COM_Port_1)
- Arduino UNO as Modbus RTU Slave
both are connected via USB
I use ModbusSerial library for Arduino from here:
I tested the Arduino with qModMaster on my Windows-PC via USB port. This worked well as you can see in the screenshots. Therefore I assume that the Arduino setup and code are correct.
Further, I also assigned the RaspberryPi USB Com Port described here:
But as you can see in the screenshot, the Modbus slave is not running (red triangle) and status of Modbus Slave is 'Bus error'.
Thank you for your help!
rKtiC
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"
/Martin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Bifogad hat geschrieben:
I added this. [SysCom]
Linux.Devicefile=/dev/ttyACM
There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"
/Martin
Did you have a problem with the loss of communication between Raspberry and Arduino after the reboot?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I'm using the following setup:
- Raspberrry Pi 3 as Modbus RTU Master (MODBUS_COM_Port_1)
- Arduino UNO as Modbus RTU Slave
both are connected via USB
I use ModbusSerial library for Arduino from here:
https://github.com/andresarmento/modbus ... /libraries
I tested the Arduino with qModMaster on my Windows-PC via USB port. This worked well as you can see in the screenshots. Therefore I assume that the Arduino setup and code are correct.
Further, I also assigned the RaspberryPi USB Com Port described here:
l viewtopic.php?f=21&t=6755&p=14284&hilit=modbus+rtu#p14284 l
But as you can see in the screenshot, the Modbus slave is not running (red triangle) and status of Modbus Slave is 'Bus error'.
Thank you for your help!
rKtiC
Hi
I used this code
sudo nano /etc/CODESYSControl.cfg
[SysCom]
Linux.Devicefile=/dev/ttyUSB
portnum := COM.SysCom.SYS_COMPORT1;
sudo /etc/init.d/codesyscontrol restart
try it
also make sure that in the point of updating the variables you have a mode (always in the task of the bus cycle) number 2.
But this will not be the only problem with the modbus rtu
After the reboot, you will have a loss of communication between Arduino and Raspberry
I have not been able to solve this problem yet.
If you find solutions please let me know
Good luck
I added this.
[SysCom]
Linux.Devicefile=/dev/ttyACM
There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"
/Martin
Did you have a problem with the loss of communication between Raspberry and Arduino after the reboot?