<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Modbus Read/Write Function 23 Problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/857aa1af10/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/857aa1af10/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/857aa1af10/</id><updated>2020-08-12T18:52:54.828000Z</updated><subtitle>Recent posts to Modbus Read/Write Function 23 Problem</subtitle><entry><title>Modbus Read/Write Function 23 Problem</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/857aa1af10/?limit=25#b392" rel="alternate"/><published>2020-08-12T18:52:54.828000Z</published><updated>2020-08-12T18:52:54.828000Z</updated><author><name>yannickasselin</name><uri>https://forge.codesys.com/u/yannickasselin/</uri></author><id>https://forge.codesys.come43c33e0106d8c149617c181f4c1b88dc1d279fd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I noticed that when using Codesys as a Modbus Master there seem to be a problem when using function 23 (Read/Write Multiple Registers).&lt;/p&gt;
&lt;p&gt;It seems that the offset for the write has to be set in number of bytes instead of number of registers like all the other functions. For the read, it is working fine.&lt;/p&gt;
&lt;p&gt;For example, if my slave has 60 registers and from my master I want to write 10 registers starting at the 20th register, I would have to set the offset at 40 instead of 20.&lt;/p&gt;
&lt;p&gt;I also noticed that if the slave has just enough registers, it does not work.&lt;/p&gt;
&lt;p&gt;For example, if you take my previous example but only have 40 registers it does not work. 50 registers does not work either. You need at least 60 registers in the previous example for it to work.&lt;/p&gt;
&lt;p&gt;I am testing it on Codesys 3.5 SP16 on a raspberry pi. Both my master and slave are in the same codesys project. I only tested it with modbus TCP. I don't know if it behaves the same with modbus RTU.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>