<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys 3.5 Modbus TCP Slave illegal data address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/</id><updated>2022-04-27T07:16:00.561000Z</updated><subtitle>Recent posts to Codesys 3.5 Modbus TCP Slave illegal data address</subtitle><entry><title>Codesys 3.5 Modbus TCP Slave illegal data address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/?limit=250#5285" rel="alternate"/><published>2022-04-27T07:16:00.561000Z</published><updated>2022-04-27T07:16:00.561000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com635a2a9ec5e9ef9341c8ae2a0af8b2ebef491ef8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Unit ID feels wrong also, even if it seems to work.&lt;br/&gt;
Recall that serial Modbus uses addresses 1 to 247 decimal, and reserves 0 as a broadcast address.&lt;/p&gt;
&lt;p&gt;Even if some modbus TCP devices just ignore the address and echoes it back, 255 is generally used for a single device.&lt;br/&gt;
So if this device is a gateway, 1-247 is generally used with a gateway(TCP/SL) to point a device on SL.&lt;/p&gt;
&lt;p&gt;Exception &lt;br/&gt;
&lt;em&gt; Code MODBUS name Comments &lt;br/&gt;
&lt;/em&gt; 01 - Illegal Function Code - The function code is unknown by the server &lt;br/&gt;
&lt;em&gt; 02 - Illegal Data Address - Dependant on the request &lt;br/&gt;
&lt;/em&gt; 03 - Illegal Data Value - Dependant on the request &lt;br/&gt;
&lt;em&gt; 04 - Server Failure - The server failed during the execution &lt;br/&gt;
&lt;/em&gt; 05 - Acknowledge - The server accepted the service invocation but the service requires a relatively long time to execute. The server therefore returns only an acknowledgement of the service invocation receipt. &lt;br/&gt;
&lt;em&gt; 06 Server Busy - The server was unable to accept the MB Request PDU. The client application has the responsibility of deciding if and when to re-send the request. &lt;br/&gt;
&lt;/em&gt; 0A Gateway problem - Gateway paths not available. &lt;br/&gt;
* 0B Gateway problem - The targeted device failed to respond. The gateway generates this exception.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 Modbus TCP Slave illegal data address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/?limit=25#502a" rel="alternate"/><published>2022-04-26T11:59:15.353000Z</published><updated>2022-04-26T11:59:15.353000Z</updated><author><name>timvh</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.com195e9a3cfc35edc740acfc20ac74ebc1bbd72adf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Keep in mind that Modbus starts with address 1, but this is actually register 0. CODESYS uses a 0 based offset. So what you can try is to read 3200, because maybe your device uses a 1 based offset.&lt;/p&gt;
&lt;p&gt;Additionally maybe you can set the length to only one register just to see if this works.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 Modbus TCP Slave illegal data address</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/7f859f63b5/?limit=25#309d" rel="alternate"/><published>2022-04-14T09:35:28.462000Z</published><updated>2022-04-14T09:35:28.462000Z</updated><author><name>gerber</name><uri>https://forge.codesys.com/u/gerber/</uri></author><id>https://forge.codesys.comee40997c6bff72e36f3b5257afc38ab7c41df200</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I’m trying to establisch communicate with a Modbus TCP slave.&lt;br/&gt;
I need to reed address 3201 by using FC3. For some reason I always get error “illegal data address”.&lt;br/&gt;
I have double checked the addressing (Unit ID = 0, FC3, offset 3201) with an external Modbus TCP tool and this works. &lt;/p&gt;
&lt;p&gt;Do I miss something within the Codesys configuration&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>