<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Assigning Modbus addresses to a structure in a dynamic way</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c8dcc979b2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c8dcc979b2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c8dcc979b2/</id><updated>2025-10-21T09:16:11.466000Z</updated><subtitle>Recent posts to Assigning Modbus addresses to a structure in a dynamic way</subtitle><entry><title>Assigning Modbus addresses to a structure in a dynamic way</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/c8dcc979b2/?limit=25#ff84" rel="alternate"/><published>2025-10-21T09:16:11.466000Z</published><updated>2025-10-21T09:16:11.466000Z</updated><author><name>andrea199403</name><uri>https://forge.codesys.com/u/andrea199403/</uri></author><id>https://forge.codesys.com93f0a8b12fb01ac4c777286da4f9116e7f505479</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello everyone, I am new to this forum and I am also new to Codesys programming.&lt;br/&gt;
My problem is this:&lt;br/&gt;
I have a STRUCT of 64 bool and 30 real, this STRUCT is assigned in the programme 9 times.&lt;br/&gt;
Now I need to communicate with an HMI via Modbus and I have defined the slave device and created the holding registers for communication.&lt;br/&gt;
I would like to declare the first call of the STRUCT on the Modbus registers %QX2000.0 to %QX2007.7&lt;br/&gt;
for the booleans and on the registers %QW1004 to %QW1034 for the real registers.&lt;br/&gt;
That said, I would like to change an index and set an offset of 100 bytes for the calls of the other 8 assignments, so that the result is:&lt;br/&gt;
%QX2100.0 to %QX2107.7&lt;br/&gt;
for the booleans and on the %QW1104 to %QW1134 registers for the Real registers, etc. Is there a way to declare this?&lt;br/&gt;
Thank you very much.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>