<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Multiple Modbus Read Registers Access by an Array of Elements</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/935eecc26c/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/935eecc26c/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/935eecc26c/</id><updated>2020-02-27T16:18:42.840000Z</updated><subtitle>Recent posts to Multiple Modbus Read Registers Access by an Array of Elements</subtitle><entry><title>Multiple Modbus Read Registers Access by an Array of Elements</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/935eecc26c/?limit=25#332f" rel="alternate"/><published>2020-02-27T16:18:42.840000Z</published><updated>2020-02-27T16:18:42.840000Z</updated><author><name>mikeardy</name><uri>https://forge.codesys.com/u/mikeardy/</uri></author><id>https://forge.codesys.com1f82e304b143e6c7e45be990657b074b4fae7a6c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I need to read about 250 UDINT via Modbus in Slave mode. A SCADA manages this data and write via Modbus remotely to my controller.&lt;br/&gt;
So inizially I configured on my controller a modbus slave device. Due to Modbus limitations I configured 4 channel in Read Holding Registers mode with an array of 125 elements (500 elements in total of WORD type).&lt;br/&gt;
In a GVL I defined an array of 250 elements of UDINT type poiting at the starting address of the input registers, beginning at %IW60.&lt;br/&gt;
Finally in my application program I used the array poiting values I need directly by index.&lt;br/&gt;
Is it the right way or maybe there is a quite simpler or "more readable" and canonical method?&lt;br/&gt;
See pictures I added to this post.&lt;br/&gt;
Many thanks&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CODESYS_ModbusSlave_3.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3655"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CODESYS_ModbusSlave_2.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3654"/&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: CODESYS_ModbusSlave_1.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3653"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>