<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus TCP Slave Data Model Memory Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80c9cd5063/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80c9cd5063/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/80c9cd5063/</id><updated>2022-07-21T20:40:03.381000Z</updated><subtitle>Recent posts to Modbus TCP Slave Data Model Memory Mapping</subtitle><entry><title>Modbus TCP Slave Data Model Memory Mapping</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/80c9cd5063/?limit=25#9411" rel="alternate"/><published>2022-07-21T20:40:03.381000Z</published><updated>2022-07-21T20:40:03.381000Z</updated><author><name>rckalex</name><uri>https://forge.codesys.com/u/rckalex/</uri></author><id>https://forge.codesys.comfbc440bcfc876265337d4ecf42662c48781b8236</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Devices Tested: Opto 22 Groov Epic PR 1 (3.5.17.10) and Codesys Control Win V3 x64 (3.5.18.0)&lt;br/&gt;
Codesys Version: 3.5 SP18 64bit&lt;br/&gt;
Configuration: &lt;br/&gt;
Codesys is acting as a Modbus Slave (ModbusTCP Slave Device). &lt;br/&gt;
General Configured Parameters:&lt;br/&gt;
Holding Registers: 500 (%QW) Writeable&lt;br/&gt;
Input Registers: 2 (%QW)&lt;br/&gt;
Coils: 200 (%QX)&lt;br/&gt;
Discrete Inputs: 0&lt;br/&gt;
Data Model: 0/0/0/0&lt;br/&gt;
[-img src=2022-07-21 13_21_42-Window.png width=50%: missing =-]&lt;/p&gt;
&lt;p&gt;Modbus Configurator automatically configured variables visible in the I/O Mapping section. Holding Registers beginning at %QW14. Coils beginning at %QB1032&lt;br/&gt;
[-img src=2022-07-21 13_22_15-Window.png width=50%: missing =-]&lt;/p&gt;
&lt;p&gt;Behavior:&lt;br/&gt;
As configured, testing shows the Holding Registers and Coils overlap in the same memory space. Changing the Start Address in the Data Model for the Coils to have an appropriate offset (relative to the configured Holding Registers) "fixes" the overlap. &lt;/p&gt;
&lt;p&gt;From my reading of the help documentation, linked below, it wasn't clear that this was the expected behavior. I expected Coils to follow Registers just like the automatic mapping laid out. Could someone from Codesys please confirm that this is the intended behavior? &lt;/p&gt;
&lt;p&gt;&lt;a href="https://content.helpme-codesys.com/en/CODESYS%20Modbus/_mod_edt_slave_device_tcp.html" rel="nofollow"&gt;https://content.helpme-codesys.com/en/CODESYS%20Modbus/_mod_edt_slave_device_tcp.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>