<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus Slave response -&gt; Timeout and Insufficient bytes received</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/</id><updated>2020-02-27T15:42:18.591000Z</updated><subtitle>Recent posts to Modbus Slave response -&gt; Timeout and Insufficient bytes received</subtitle><entry><title>Modbus Slave response -&gt; Timeout and Insufficient bytes received</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/?limit=25#54b9" rel="alternate"/><published>2020-02-27T15:42:18.591000Z</published><updated>2020-02-27T15:42:18.591000Z</updated><author><name>tramanah</name><uri>https://forge.codesys.com/u/tramanah/</uri></author><id>https://forge.codesys.com5cb94f8c2686ff43f2eccd4c2d762007eaa325b0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Good day,&lt;/p&gt;
&lt;p&gt;I did try out syslink on the following link:&lt;/p&gt;
&lt;p&gt;&lt;a class="" href="https://unix.stackexchange.com/questions/395962/kernels-path-for-usb-device-connected-to-hub" rel="nofollow"&gt;https://unix.stackexchange.com/questions/395962/kernels-path-for-usb-device-connected-to-hub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;after adding in the KERNELS for both USB port accordingly, I did update with the following command:- &lt;/p&gt;
&lt;p&gt;ln -s ttyUSB0 ttyRPI0&lt;br/&gt;
ln -s ttyUSB1 ttyRPI1&lt;/p&gt;
&lt;p&gt;you may check the name will appear on command: ls /dev&lt;/p&gt;
&lt;p&gt;Note: incase if you want to remove the syslink the command is:    rm ttyRPI0  or rm ttyRPI1 than remove the KERNELS&lt;/p&gt;
&lt;p&gt;In raspberry pi setting at: etc/CODESYSControl.cfg&lt;/p&gt;
&lt;p&gt;&lt;span&gt;[SysCom]&lt;/span&gt;&lt;br/&gt;
Linux.Devicefile=/dev/ttyRPI&lt;br/&gt;
I did restart multiple time and the system works well now.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Slave response -&gt; Timeout and Insufficient bytes received</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/?limit=25#71f5" rel="alternate"/><published>2020-02-27T15:42:16.545000Z</published><updated>2020-02-27T15:42:16.545000Z</updated><author><name>tramanah</name><uri>https://forge.codesys.com/u/tramanah/</uri></author><id>https://forge.codesys.com82b5fd5fe0655a81aee2368b84e4c9246f683d3d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi Guys,&lt;/p&gt;
&lt;p&gt;After trying all the chances and went through most of the forums on Modbus communication, finally, manage to resolve. I did test the Modbus slave first. Make sure the connection setting are correct and manage to read data from raspberry pi.&lt;/p&gt;
&lt;p&gt;CODESYS setup as follow:-&lt;br/&gt;
Modbus_COM-&amp;gt;Serial Port Configuration: &amp;lt;&lt;strong&gt;Comport: 1&lt;/strong&gt;&amp;gt;&amp;lt;&lt;strong&gt;Baudrate:9600&lt;/strong&gt;&amp;gt;&amp;lt;parity:none&amp;gt;&amp;lt;databits:8&amp;gt;&amp;lt;stopbits&amp;lt;1&amp;gt;&lt;br/&gt;
Modbus_Serial_Device-&amp;gt;&amp;lt;unitid:1&amp;gt; and the rest up to your setting&amp;lt;/unitid:1&amp;gt;&amp;lt;/stopbits&amp;lt;1&amp;gt;&amp;lt;/databits:8&amp;gt;&amp;lt;/parity:none&amp;gt;&lt;/p&gt;
&lt;p&gt;In raspberry pi setting at: etc/CODESYSControl.cfg&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span&gt;&lt;span&gt;[SysCom]&lt;/span&gt;&lt;/span&gt;Linux.Devicefile=/dev/ttyUSB&lt;/strong&gt;&lt;br/&gt;
while in terminal ls /dev: make sure USB device  are ttyUSB0&lt;/p&gt;
&lt;p&gt;In PC, use any Modbus Master software to pull data. Make sure able to read data.&lt;/p&gt;
&lt;p&gt;Next, set up the Modbus Master in CODESYS to pull data from Tri-PLC&lt;/p&gt;
&lt;p&gt;CODESYS setup as follow:-&lt;br/&gt;
Modbus_COM_1-&amp;gt;Serial Port Configuration: &amp;lt;&lt;strong&gt;Comport: 2&lt;/strong&gt;&amp;gt;&amp;lt;&lt;strong&gt;Baudrate:38400&lt;/strong&gt;&amp;gt;&amp;lt;parity:none&amp;gt;&amp;lt;databits:8&amp;gt;&amp;lt;stopbits&amp;lt;1&amp;gt;&lt;br/&gt;
Modbus_MASTER_COM_Port-&amp;gt; In General tab, enable Auto-restart communication and rest leave as default&lt;br/&gt;
Modbus_Slave_COM_Port -&amp;gt; In General tab, set the tri-plc device id and setup the Modbus channel and Modbus Mapping.&amp;lt;/stopbits&amp;lt;1&amp;gt;&amp;lt;/databits:8&amp;gt;&amp;lt;/parity:none&amp;gt;&lt;/p&gt;
&lt;p&gt;No changes in Raspberry pi setting&lt;br/&gt;
while in terminal ls /dev: make sure USB device  are ttyUSB1&lt;/p&gt;
&lt;p&gt;That's it.  &lt;/p&gt;
&lt;p&gt;But if power reset on raspberrypi than we have issues on ttyUSB0 and ttyUSB1, its been swapped. How to resolve this?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus Slave response -&gt; Timeout and Insufficient bytes received</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/7ecb0598e7/?limit=25#b9c3" rel="alternate"/><published>2020-02-27T15:42:15.826000Z</published><updated>2020-02-27T15:42:15.826000Z</updated><author><name>tramanah</name><uri>https://forge.codesys.com/u/tramanah/</uri></author><id>https://forge.codesys.com7f9ee62d4f9bd02fe112c1e6c006c6cf51cbe1b6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,  good day.&lt;/p&gt;
&lt;p&gt;I did setup raspberry pi 3B+ on Codesys with the interface to TRI plc via RS485. Raspberry pi as master, I do manage pull data from TRI plc on Modbus RTU without any error. While setup Modbus slave on same raspberry pi shows successful but while trying pulling data via pc with using Modbus Poll, an error message shows "Timeout" and "Insufficient bytes received", one after one.&lt;br/&gt;
I did use USB dongle (USB-RS485) 2 units for both communications.&lt;/p&gt;
&lt;p&gt;Modbus Poll : Setup as follow:-&lt;br/&gt;
Serial port setup : COM 1 / 9600 / 8 / None / 1&lt;br/&gt;
Slave id :2&lt;br/&gt;
Function : Read holding Register (4x)&lt;br/&gt;
Address : 0&lt;br/&gt;
Quantity : 4&lt;br/&gt;
Scan Rate : 1000 ms&lt;/p&gt;
&lt;p&gt;Communication Traffice: - &lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Rx: 21 F7&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Tx: 02 03 00 00 00  04 44 3A&lt;br/&gt;
Rx: 21 F7&lt;/p&gt;
&lt;p&gt;so on...&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: pic1.png" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=4815"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>