<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Usage of Modbus RTU Master and Modbus RTU Client simultaneously</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110342/usage-of-modbus-rtu-master-and-modbus-rtu-client-simultaneously</link><description>Hello, 
 We want to use a nrf52840 as a logic controller which reads data from Modbus RTU Sensors (as Modbus RTU Master) and simultaneously is the Modbus RTU Server for an higher unit, which reads calculated values and process values from a bunch of nrf52840</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 May 2024 10:27:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110342/usage-of-modbus-rtu-master-and-modbus-rtu-client-simultaneously" /><item><title>RE: Usage of Modbus RTU Master and Modbus RTU Client simultaneously</title><link>https://devzone.nordicsemi.com/thread/486377?ContentTypeID=1</link><pubDate>Wed, 29 May 2024 10:27:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33ae2595-bb50-4e84-be9a-69cbd2d3f4ab</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;We have very limited experience with&amp;nbsp;&lt;span&gt;Modbus&amp;nbsp;on Devzone. I suggest asking about this on the Zephyr Discord:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://docs.zephyrproject.org/latest/develop/getting_started/index.html#asking-for-help"&gt;https://docs.zephyrproject.org/latest/develop/getting_started/index.html#asking-for-help&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Modbus RTU Master and Modbus RTU Client simultaneously</title><link>https://devzone.nordicsemi.com/thread/486262?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 17:51:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d0441d0-08aa-4d77-a2ac-2f0b392b0cde</guid><dc:creator>Subu Muthu</dc:creator><description>&lt;p&gt;Hi, I would like to implement&amp;nbsp; the same. I tried the above recommendation with the client and server examples from Nordic on 2X&amp;nbsp; nRF52840 DK, one for client and 2nd one for the server.&amp;nbsp; I changed to CONFIG_MODBUS_ROLE_CLIENT_SERVER = y.&amp;nbsp; Both the Client and sever examples worked.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I would like to add the server capabilities to the client. Primarily the callback functions needs to be registered so that when the 2nd client sends a message, it is processed. How do we do this?&lt;/p&gt;
&lt;p&gt;If I tried to initialize the server, modbus_init_server, after initializing the modbus_init_client&amp;nbsp; using the same iface, the server does not get initialized for obvious reasons - because it the same uart1 interface. The interface is already used.&lt;/p&gt;
&lt;p&gt;Looking at the code from modbus_init_server(iface, param) and the modbus_init_client(...) and comparing, they are identical,&amp;nbsp; except that the server include modbus_user_fc and registering the callback functions.&lt;/p&gt;
&lt;p&gt;I did search for a combination call back and could not find.&lt;/p&gt;
&lt;p&gt;Can you please help?&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Modbus RTU Master and Modbus RTU Client simultaneously</title><link>https://devzone.nordicsemi.com/thread/479601?ContentTypeID=1</link><pubDate>Fri, 19 Apr 2024 07:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bb48e2c-c1c7-4bb0-8342-cad298437ebb</guid><dc:creator>tomtomtom2401</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Modbus RTU Master and Modbus RTU Client simultaneously</title><link>https://devzone.nordicsemi.com/thread/479390?ContentTypeID=1</link><pubDate>Thu, 18 Apr 2024 10:52:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3ab1e74-a839-42e7-a22f-a641b2e6c73e</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I took a look at the configs.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.5.99-ncs1/subsys/modbus/Kconfig#L17"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v3.5.99-ncs1/subsys/modbus/Kconfig#L17&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Looks like if you want both client and server, you should not set&amp;nbsp;CONFIG_MODBUS_ROLE_CLIENT and&amp;nbsp;CONFIG_MODBUS_ROLE_SERVER. But instead set&amp;nbsp;&lt;span&gt;CONFIG_&lt;/span&gt;MODBUS_ROLE_CLIENT_SERVER=y&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>