<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/</id><updated>2024-02-20T09:59:35.862000Z</updated><subtitle>Recent posts to Codesys 3.5 SP16 Modbus change port settings.</subtitle><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#5016/5a99" rel="alternate"/><published>2024-02-20T09:59:35.862000Z</published><updated>2024-02-20T09:59:35.862000Z</updated><author><name>jmauer</name><uri>https://forge.codesys.com/u/jmauer/</uri></author><id>https://forge.codesys.com762e0b9da6f9bdb9534da81f52a2b43eb1b5d580</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello, &lt;/p&gt;
&lt;p&gt;I'm coming to you today because I'm trying to make the baudrate and the slave number dynamic. &lt;br/&gt;
I've tried the "updateComPortSettings" method on the slave device but it doesn't work and gives the "Modbus_COM_Port" an error. &lt;/p&gt;
&lt;p&gt;Can you tell me how you got this method to work? &lt;/p&gt;
&lt;p&gt;Thanks in advance for your help &lt;/p&gt;
&lt;p&gt;jérémy&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#8410/3566" rel="alternate"/><published>2021-01-12T14:31:36.842000Z</published><updated>2021-01-12T14:31:36.842000Z</updated><author><name>hence.persson</name><uri>https://forge.codesys.com/u/hence-persson/</uri></author><id>https://forge.codesys.comccbcb5712c01ddd6d5c3fa3d30fc9967454b65c2</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for your time trying to help really appreciated.&lt;/p&gt;
&lt;p&gt;I used to do it like that but the opening of the comport isnt needed that is handled by the modbus server but with the new Codesys you should be able to use the configured Device according to the changelog. But apparently someone missed the possibility to change the number of stop bits. So guessing I will have to revert back to my old implementation..&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;byInternalUnitID&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;10&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ulBaudrate&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;SysCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_COM_BAUDRATE&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_BR_9600&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;byParity&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;SysCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_COM_PARITY&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_NOPARITY&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;byStopBits&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;SysCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_COM_STOPBITS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_TWOSTOPBITS&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;sPort&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;SysCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_COM_PORTS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;SYS_COMPORT4&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ulBufferSize&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;1024&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;fbModbusServer&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="nt"&gt;byUnitID&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;byInternalUnitID&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;comPortSettings&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;stInternalComPortSettingsNew&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;pInputData&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;BMS_GVLmodbusRTUdata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;aInputRegisters&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;pOutputData&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;BMS_GVLmodbusRTUdata&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;aHoldingRegisters&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt; 
    &lt;span class="nt"&gt;uiInputDataSize&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;10&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;uiOutputDataSize&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;2048&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xEnable&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xReset&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;tTimeout&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;EOFDetectionTimeout&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;0&lt;/span&gt; &lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xError&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#8410" rel="alternate"/><published>2021-01-12T13:52:28.163000Z</published><updated>2021-01-12T13:52:28.163000Z</updated><author><name>Thomas</name><uri>https://forge.codesys.com/u/thk/</uri></author><id>https://forge.codesys.comd31c6d1afeaa4329d2c95a5d17229cd44e0f9e61</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
I am not able to test my code today.! I hope the ModbusServer will answer a request (see attachment)&lt;/p&gt;
&lt;p&gt;Basic is the FAQ (https://faq.codesys.com/display/CDSFAQ/Modbus+RTU%3A+Dynamic+Configuration)&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#b498" rel="alternate"/><published>2021-01-12T11:46:15.551000Z</published><updated>2021-01-12T11:46:15.551000Z</updated><author><name>hence.persson</name><uri>https://forge.codesys.com/u/hence-persson/</uri></author><id>https://forge.codesys.com4184b408b65dc34c3ffd4e4b1f62bfc922f1a664</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Interesting but I am configured as an Device then I cant change that setting..&lt;br/&gt;
&lt;img src="./attachment/Update.PNG" width="50%"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#5204" rel="alternate"/><published>2021-01-12T11:31:24.445000Z</published><updated>2021-01-12T11:31:24.445000Z</updated><author><name>Thomas</name><uri>https://forge.codesys.com/u/thk/</uri></author><id>https://forge.codesys.coma9043da6e27df44dc756f3e493c051081f45c331</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi, &lt;br/&gt;
it lokk like that the docu is wrong&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Codesys 3.5 SP16 Modbus change port settings.</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/61f6bc1d4e/?limit=25#5016" rel="alternate"/><published>2021-01-12T08:57:35.943000Z</published><updated>2021-01-12T08:57:35.943000Z</updated><author><name>hence.persson</name><uri>https://forge.codesys.com/u/hence-persson/</uri></author><id>https://forge.codesys.com03fd2fcfd9454e88f55461624938975c204a7bc1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;According to the documentation there is now the possibility to change port settings.&lt;br/&gt;
And so I found the method UpdateComPortSettings which works fine but i cannot change the number of stopbits.. Is this a miss from the Codesys gang or am I missing something?&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>