<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Problem with Serial communication</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f4aac19c9d/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f4aac19c9d/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/f4aac19c9d/</id><updated>2020-02-27T22:29:39.278000Z</updated><subtitle>Recent posts to Problem with Serial communication</subtitle><entry><title>Problem with Serial communication</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/f4aac19c9d/?limit=25#5499" rel="alternate"/><published>2020-02-27T22:29:39.278000Z</published><updated>2020-02-27T22:29:39.278000Z</updated><author><name>hcchin</name><uri>https://forge.codesys.com/u/hcchin/</uri></author><id>https://forge.codesys.com103fbca7a4c25d9eedcb01522332c018b19c3721</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;May i know what hardware are you using for this SysLibCom library ?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Problem with Serial communication</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/f4aac19c9d/?limit=25#aa36" rel="alternate"/><published>2020-02-27T22:29:37.680000Z</published><updated>2020-02-27T22:29:37.680000Z</updated><author><name>Faucheuse</name><uri>https://forge.codesys.com/u/faucheuse/</uri></author><id>https://forge.codesys.com10f80bad992d6d6e26a8652382f08653fbb966ae</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I tried recently to use the SysLibCom library in CoDeSys with that program : &lt;/p&gt;
&lt;p&gt;IF(result=0)&lt;/p&gt;
&lt;p&gt;THEN&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;PortTest&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;SysComOpen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;



&lt;span class="nt"&gt;ParamCom&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;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;ParamCom&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;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;ParamCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dwBaudRate&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;9600&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;ParamCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dwScan&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;ParamCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dwTimeout&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;ParamCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Port&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nt"&gt;ParamCom&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;dwBufferSize&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;result&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;SysComSetSettings&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;PortTest&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;ParamCom&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="o"&gt;;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;END_IF&lt;/p&gt;
&lt;p&gt;b:='BONJOUR';&lt;/p&gt;
&lt;p&gt;c:=SysComWrite(PortTest,ADR(b),LEN(b), 100) ;&lt;/p&gt;
&lt;p&gt;resultClose:=SysComClose(PortTest);&lt;/p&gt;
&lt;p&gt;But it doesn't work : when I try to access the system, it's write "ParamCom.Port:= ***INVALID : 0", but I can run the program normally.&lt;/p&gt;
&lt;p&gt;What's the matter here ?&lt;/p&gt;
&lt;p&gt;Thanks for your help.&lt;/p&gt;
&lt;p&gt;EDIT : I saw that the matter is the handle returns by the SysComOpen functiun.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>