<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to RaspberryPi and Arduino Modbus RTU</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/</id><updated>2020-02-27T15:28:10.693000Z</updated><subtitle>Recent posts to RaspberryPi and Arduino Modbus RTU</subtitle><entry><title>RaspberryPi and Arduino Modbus RTU</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/?limit=25#9fc3" rel="alternate"/><published>2020-02-27T15:28:10.693000Z</published><updated>2020-02-27T15:28:10.693000Z</updated><author><name>Ernest</name><uri>https://forge.codesys.com/u/ernest/</uri></author><id>https://forge.codesys.com67c48fe26da399964f03de43058ce6862bcceba6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Bifogad hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
I added this.&lt;br/&gt;
&lt;span&gt;[SysCom]&lt;/span&gt;&lt;br/&gt;
Linux.Devicefile=/dev/ttyACM&lt;br/&gt;
There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.&lt;br/&gt;
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"&lt;br/&gt;
/Martin&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Did you have a problem with the loss of communication between Raspberry and Arduino after the reboot?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>RaspberryPi and Arduino Modbus RTU</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/?limit=25#ea64" rel="alternate"/><published>2020-02-27T15:28:09.991000Z</published><updated>2020-02-27T15:28:09.991000Z</updated><author><name>Bifogad</name><uri>https://forge.codesys.com/u/bifogad/</uri></author><id>https://forge.codesys.comed9a92e4a751975139b4d16863e2a67e7ae164cc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I added this.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[SysCom]&lt;/span&gt;&lt;br/&gt;
Linux.Devicefile=/dev/ttyACM&lt;/p&gt;
&lt;p&gt;There is some command to see the name of the com port but I can't remember. In my case it wasn't ttyUSB.&lt;br/&gt;
I also didn't need to add "portnum := COM.SysCom.SYS_COMPORT1;"&lt;/p&gt;
&lt;p&gt;/Martin&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>RaspberryPi and Arduino Modbus RTU</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/?limit=25#3b49" rel="alternate"/><published>2020-02-27T15:28:09.321000Z</published><updated>2020-02-27T15:28:09.321000Z</updated><author><name>Ernest</name><uri>https://forge.codesys.com/u/ernest/</uri></author><id>https://forge.codesys.comf94f4f8be9d42d101f3be438ea11d6bcf86ca04f</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I used this code&lt;/p&gt;
&lt;p&gt;sudo nano /etc/CODESYSControl.cfg &lt;/p&gt;
&lt;p&gt;&lt;span&gt;[SysCom]&lt;/span&gt;&lt;br/&gt;
Linux.Devicefile=/dev/ttyUSB&lt;br/&gt;
portnum := COM.SysCom.SYS_COMPORT1;&lt;/p&gt;
&lt;p&gt;sudo /etc/init.d/codesyscontrol restart&lt;/p&gt;
&lt;p&gt;try it&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;But this will not be the only problem with the modbus rtu&lt;/p&gt;
&lt;p&gt;After the reboot, you will have a loss of communication between Arduino and Raspberry&lt;/p&gt;
&lt;p&gt;I have not been able to solve this problem yet.&lt;/p&gt;
&lt;p&gt;If you find solutions please let me know&lt;/p&gt;
&lt;p&gt;Good luck&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>RaspberryPi and Arduino Modbus RTU</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/83bab614f1/?limit=25#c883" rel="alternate"/><published>2020-02-27T15:28:07.364000Z</published><updated>2020-02-27T15:28:07.364000Z</updated><author><name>rKtiC</name><uri>https://forge.codesys.com/u/rktic/</uri></author><id>https://forge.codesys.comc6e2b0914826000a71cd14f55aa378b81e8662ed</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi everyone,&lt;/p&gt;
&lt;p&gt;I'm using the following setup:&lt;br/&gt;
- Raspberrry Pi 3 as Modbus RTU Master (MODBUS_COM_Port_1)&lt;br/&gt;
- Arduino UNO as Modbus RTU Slave&lt;br/&gt;
both are connected via USB&lt;br/&gt;
I use ModbusSerial library for Arduino from here:&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://github.com/andresarmento/modbus-arduino/tree/master/libraries" rel="nofollow"&gt;https://github.com/andresarmento/modbus ... /libraries&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;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.&lt;br/&gt;
Further, I also assigned the RaspberryPi USB Com Port described here:&lt;/p&gt;
&lt;p&gt;l &lt;a class="" href="https://forum.codesys.com/viewtopic.php?f=21&amp;amp;t=6755&amp;amp;x=14284&amp;amp;hilit=modbus+rtu&amp;amp;p=14284&amp;amp;lan=en" rel="nofollow"&gt;viewtopic.php?f=21&amp;amp;t=6755&amp;amp;p=14284&amp;amp;hilit=modbus+rtu#p14284&lt;/a&gt; l &lt;/p&gt;
&lt;p&gt;But as you can see in the screenshot, the Modbus slave is not running (red triangle) and status of Modbus Slave is 'Bus error'. &lt;br/&gt;
Thank you for your help!&lt;/p&gt;
&lt;p&gt;rKtiC&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Modbus_Arduino_5.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3561"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Modbus_Arduino_4.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3560"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Modbus_Arduino_3.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3559"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Modbus_Arduino_2.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3558"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Modbus_Arduino_1.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3557"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>