<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/</id><updated>2020-02-27T14:21:27.094000Z</updated><subtitle>Recent posts to Modbus non-standard addressing FC3</subtitle><entry><title>Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/?limit=25#17dc" rel="alternate"/><published>2020-02-27T14:21:27.094000Z</published><updated>2020-02-27T14:21:27.094000Z</updated><author><name>Scoobler</name><uri>https://forge.codesys.com/u/scoobler/</uri></author><id>https://forge.codesys.comc4652474539c4da6b97e92ecd19447d36aa46ff8</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;dFx that is basically what I was told. This is from the controller manufacturer that set the alarm bells off:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Zitat:&lt;/strong&gt;&lt;br/&gt;
Controllers support the full modbus address range (0-65535 decimal, 0000-FFFF hexadecimal) therefore to address every register in the module, the Modbus Master system must also support this address range.&lt;br/&gt;
All modbus registers are classified as Holding Registers. They can only be read using modbus function code 3 (Read Multiple Registers).&lt;br/&gt;
Some modbus masters use a suffix to the address as a way of specifying the function code to use for the query.&lt;br/&gt;
For example 41,029 is used to instruct the master to query address 1029 using function code 3.&lt;br/&gt;
Some modbus masters also require you to add ‘1’ as previously described.&lt;br/&gt;
This means that in many cases the master can read only up to register 9999 (49999 is last register that will be read using function code 3).&lt;br/&gt;
These modbus masters are therefore limited and cannot read the full list of registers from the module.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As stated I am using a HMI which includes Codesys, the HMI allows tags and can read from modbus devices, however the programming software does prefix the '4' for holding registers.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/?limit=25#787e" rel="alternate"/><published>2020-02-27T14:21:26.669000Z</published><updated>2020-02-27T14:21:26.669000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com1011daa5650905f0b2b055dcd04313a0afb6d94a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;By default, memory maps are 65536 words long. &lt;br/&gt;
There are 4 maps, one for each 1x 2x 3x and 4x codes.&lt;br/&gt;
If everything is in 4x code memory map, then, just use the address provided in the supplier memory map, and it should be fine.&lt;br/&gt;
I Don't really get your concerns. Maybe it will vanish tomorow &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/?limit=25#5a4b" rel="alternate"/><published>2020-02-27T14:21:26.240000Z</published><updated>2020-02-27T14:21:26.240000Z</updated><author><name>Scoobler</name><uri>https://forge.codesys.com/u/scoobler/</uri></author><id>https://forge.codesys.comcd565d24450c5971f620f990ccf0aedbc607c16d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi dFx thanks for the reply.&lt;/p&gt;
&lt;p&gt;The 'problem' in theory is, the new device (which is arriving tomorrow so I can start some testing) holds everything in holding registers.&lt;/p&gt;
&lt;p&gt;There are no coils, discrete coils or input registers.&lt;/p&gt;
&lt;p&gt;So within the device everything from 0 to 65,536 is a holding register.&lt;/p&gt;
&lt;p&gt;I have been informed however Codesys doesn't do anything to add the '4'.&lt;br/&gt;
So for example one controller I normally use follows the standard, holding registers are in the '4' section, so asking for register 1 function code 3, is the same as 40001.&lt;br/&gt;
However Codesys simply asks for register 1 with function code 3, it is the controller that returns the correct register. Because the new controller has everything in holding registers, when Codesys asks for register 1 with function code 3, it will get register 00001.&lt;/p&gt;
&lt;p&gt;My confusion came because the HMI which can access tags prefixes the number with the 4 so would only allow access to 9,999 registers which would miss off 55,537 potential registers. I have been informed Codesys will not do this and nothing special needs to be done to make it work!?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/?limit=25#040d" rel="alternate"/><published>2020-02-27T14:21:25.022000Z</published><updated>2020-02-27T14:21:25.022000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com8ad304b9e36d4664656c3e4559d4e8a6eab046cf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Wikipedia hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
In the traditional standard, numbers for those entities start with a digit, followed by a number of 4 digits in the range 1–9,999: &lt;br/&gt;
coils numbers start with 0 and span from 00001 to 09999,&lt;br/&gt;
discrete input numbers start with 1 and span from 10001 to 19999,&lt;br/&gt;
input register numbers start with 3 and span from 30001 to 39999,&lt;br/&gt;
holding register numbers start with 4 and span from 40001 to 49999.&lt;br/&gt;
This translates into addresses between 0 and 9,998 in data frames. For example, in order to read holding registers starting at number 40001, corresponding address in the data frame will be 0 with a function code of 3 (as seen above). For holding registers starting at number 40100, address will be 99. Etc. &lt;br/&gt;
This limits the number of addresses to 9,999 for each entity. A de facto referencing extends this to the maximum of 65,536.&lt;span&gt;[13]&lt;/span&gt; It simply consists of adding one digit to the previous list: &lt;br/&gt;
coil numbers span from 000001 to 065536,&lt;br/&gt;
discrete input numbers span from 100001 to 165536,&lt;br/&gt;
input register numbers span from 300001 to 365536,&lt;br/&gt;
holding register numbers span from 400001 to 465536.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;source : &lt;a class="" href="https://en.wikipedia.org/wiki/Modbus#Coil,_discrete_input,_input_register,_holding_register_numbers_and_addresses" rel="nofollow"&gt;https://en.wikipedia.org/wiki/Modbus#Coil,_discrete_input,_input_register,_holding_register_numbers_and_addresses&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;EDIT : To make it clear, if a holding register address is told being 0001, then read it as read code 4 then address 1. But if it's told to be 40001, use read code 4 but address may vary depending the constructor (1 or 40001).&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Modbus non-standard addressing FC3</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2654704e/?limit=25#bfed" rel="alternate"/><published>2020-02-27T14:21:24.623000Z</published><updated>2020-02-27T14:21:24.623000Z</updated><author><name>Scoobler</name><uri>https://forge.codesys.com/u/scoobler/</uri></author><id>https://forge.codesys.com2924a03c8f3beef1219810fd49cfdca5e740f93a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am currently using a HMI/Codesys device to talk to multiple Modbus devices - all this works well, not that it makes any difference everything is in ST as this is all fairly new to me and I come from a software programming background.&lt;/p&gt;
&lt;p&gt;I have a new set of devices I need to collect data from however they don't use standard addressing. Everything is in a holding register, from 0-65536. They don't conform to the holding registers being in the 40x range.&lt;/p&gt;
&lt;p&gt;When adding a channel I can either enter the address in decimal and it gets converted or enter the hex value, however if I enter 1 for example using function 3 to read holding registers it assumes 40001 but for this device I actually want 00001.&lt;/p&gt;
&lt;p&gt;Is this possible with the standard library? Is there any other library which can do it?&lt;/p&gt;
&lt;p&gt;Thanks in advance!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>