<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Modbus RTU connection to multiple slaves in LabVIEW</title>
    <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286319#M1250737</link>
    <description>&lt;P&gt;How can I change the Unit ID on the fly so that I can address another unit and keep the information separate? What I have now does well for one unit and graphs the temperature every second.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Feb 2023 17:47:32 GMT</pubDate>
    <dc:creator>Sparkman2</dc:creator>
    <dc:date>2023-02-23T17:47:32Z</dc:date>
    <item>
      <title>Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286317#M1250735</link>
      <description>&lt;P&gt;I can connect to a single Modbus RTU slave with no problem. However, how can I expand this to communicate with multiple slaves using the same COM port?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:36:44 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286317#M1250735</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-02-23T17:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286318#M1250736</link>
      <description>&lt;P&gt;Change the addresses to be different. I cannot open your code as I don't have LV 2023. You may want to save for previous version code posted here. However, if you can talk to one slave device, the address is part of the communication for Modbus RTU. You will need a way to change it on your slave device. (I've had to connect one at a time and set the address before integrating into a bigger project).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:43:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286318#M1250736</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2023-02-23T17:43:19Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286319#M1250737</link>
      <description>&lt;P&gt;How can I change the Unit ID on the fly so that I can address another unit and keep the information separate? What I have now does well for one unit and graphs the temperature every second.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:47:32 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286319#M1250737</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-02-23T17:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286321#M1250739</link>
      <description>&lt;P&gt;To better see what I have so far, I am attaching a Word document with the VI.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 17:54:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286321#M1250739</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-02-23T17:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286329#M1250742</link>
      <description>&lt;P&gt;Save for a previous version is the preferred method. Posting a png image also works. Using a proprietary Word document to insert an image is something I am not going to look at.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:11:19 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286329#M1250742</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2023-02-23T18:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286331#M1250744</link>
      <description>&lt;P&gt;Didn't know what version to save as, so here is the png file. Sorry!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:26:03 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286331#M1250744</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-02-23T18:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286338#M1250747</link>
      <description>&lt;P&gt;Ok. It looks like you are using NI's Modbus library, but honestly I am a little confused as to why they have a yellow border. Maybe a newer feature I am not familiar with.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;At any rate, you want two Create Master functions. Both have the same com port and baud rate, but with different ID's. Use the two instance wires the same as how you have done with one. If they are the same type of device and you want the same data you can bundle the instance wires and use a for loop (see the picture).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="modbus-multiple-slaves.png" style="width: 999px;"&gt;&lt;img src="https://ip1.i.lithium.com/237b482c2eb79f3fa4406558044b6121d50ee161/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33313430343369304142384444314541374644463836412f696d6167652d73697a652f6c617267653f763d76322670783d393939" role="button" title="modbus-multiple-slaves.png" alt="modbus-multiple-slaves.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 18:57:26 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286338#M1250747</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2023-02-23T18:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286342#M1250749</link>
      <description>&lt;P&gt;Thank you! I will try that. The yellow borders are because I unchecked "View as Icon" as it is easier on my old eyes that way. Not sure if trying to create two instances using the same COM port will cause a conflict when trying to open the second one. With what I have now, in order to see the&amp;nbsp; second unit, I have to stop it, change the ID, then start it again. I have to stop it as the COM port isn't released until the While Loop completes execution. Thanks again for the assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 19:06:01 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286342#M1250749</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-02-23T19:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286344#M1250751</link>
      <description>&lt;P&gt;I&amp;nbsp;&lt;EM&gt;think&amp;nbsp;&lt;/EM&gt;I have used two devices on the same COM port. The NI Modbus Library should be smart enough to deal with it as multidrop is part of the Modbus specification (assuming it is 485 wiring, not 232). If you do have issues with it, there is another Modbus Library other people on the forums use called Plasmionique&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.vipm.io/package/mb_master/" target="_self"&gt;https://www.vipm.io/package/mb_master/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 19:14:52 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286344#M1250751</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2023-02-23T19:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286363#M1250757</link>
      <description>&lt;P&gt;You can just change the address with Set Unit ID.vi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cordm_0-1677184099173.png" style="width: 400px;"&gt;&lt;img src="https://ip1.i.lithium.com/6632507ab30c65f131b378c95b54474af00b00b9/68747470733a2f2f6e692e6c69746869756d2e636f6d2f74352f696d6167652f736572766572706167652f696d6167652d69642f33313430353069303232333432444130353436443941332f696d6167652d73697a652f6d656469756d3f763d76322670783d343030" role="button" title="cordm_0-1677184099173.png" alt="cordm_0-1677184099173.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 20:29:04 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286363#M1250757</guid>
      <dc:creator>cordm</dc:creator>
      <dc:date>2023-02-23T20:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286370#M1250764</link>
      <description>&lt;P&gt;That seems to be the correct way. My apologies.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Feb 2023 21:01:56 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4286370#M1250764</guid>
      <dc:creator>StevenD</dc:creator>
      <dc:date>2023-02-23T21:01:56Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4288266#M1251502</link>
      <description>&lt;P&gt;Do you mean that I should switch back and forth between the addresses? Read one, change address, read the next?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 12:59:42 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4288266#M1251502</guid>
      <dc:creator>Sparkman2</dc:creator>
      <dc:date>2023-03-03T12:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4288312#M1251521</link>
      <description>&lt;P&gt;Yes, exactly. In principle, you can also set the unit ID once and create an array of Modbus Master instances.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 15:24:43 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4288312#M1251521</guid>
      <dc:creator>cordm</dc:creator>
      <dc:date>2023-03-03T15:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: Modbus RTU connection to multiple slaves</title>
      <link>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4343076#M1273581</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://ni.lithium.com/t5/user/viewprofilepage/user-id/108457"&gt;@StevenD&lt;/a&gt;&amp;nbsp; escreveu:&lt;BR /&gt;
&lt;P&gt;I&amp;nbsp;&lt;EM&gt;think&amp;nbsp;&lt;/EM&gt;I have used two devices on the same COM port. The NI Modbus Library should be smart enough to deal with it as multidrop is part of the Modbus specification (assuming it is 485 wiring, not 232). If you do have issues with it, there is another Modbus Library other people on the forums use called Plasmionique&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.vipm.io/package/mb_master/" target="_self"&gt;https://www.vipm.io/package/mb_master/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you aware if this is true for slaves too?&lt;/P&gt;
&lt;P&gt;For example, multiple LabVIEW modbus slaves in the same COM port?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2023 21:33:25 GMT</pubDate>
      <guid>https://ni.lithium.com/t5/LabVIEW/Modbus-RTU-connection-to-multiple-slaves/m-p/4343076#M1273581</guid>
      <dc:creator>felipefoz</dc:creator>
      <dc:date>2023-12-04T21:33:25Z</dc:date>
    </item>
  </channel>
</rss>

