<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to Serial Comm Issues on Beckhoff CX5120</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ccb869409/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ccb869409/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/6ccb869409/</id><updated>2020-02-27T15:17:17.476000Z</updated><subtitle>Recent posts to Serial Comm Issues on Beckhoff CX5120</subtitle><entry><title>Serial Comm Issues on Beckhoff CX5120</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ccb869409/?limit=25#51c6" rel="alternate"/><published>2020-02-27T15:17:17.476000Z</published><updated>2020-02-27T15:17:17.476000Z</updated><author><name>Omar Ampyx</name><uri>https://forge.codesys.com/u/omar-ampyx/</uri></author><id>https://forge.codesys.com47335c5b696593bba2af6847661126fd0d8c9350</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I finally found the causes of the problem.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Cause 1: the CAA function block ComRead sometimes reads less bytes than expected (actual number of bytes read are outputted in szSize). It is very important to react to this otherwise the data will be shifted from that point on!&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Cause 2: USB ports in windows have lower priority that system tasks and the OS will definitely cut CPU resources to USB related tasks if needed. We have experienced that this leads to the incoming serial data to be heavily corrupted!!&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Further tests need to be carried out with a dedicated serial port instead of via USB converter.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Serial Comm Issues on Beckhoff CX5120</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/6ccb869409/?limit=25#3d27" rel="alternate"/><published>2020-02-27T15:17:15.548000Z</published><updated>2020-02-27T15:17:15.548000Z</updated><author><name>Omar Ampyx</name><uri>https://forge.codesys.com/u/omar-ampyx/</uri></author><id>https://forge.codesys.comacfd3852b86d2ad0ce327255c4986308d4b2ba74</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I am trying to run 422 serial communications on a Beckhoff CX5120 running WES7 and the Codesys RTE. For that I am using a USB to Serial converter with an FTDI chip.&lt;/p&gt;
&lt;p&gt;Writing data is flawless but reading data is not. Every now and then the acquired data gets corrupted in two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Bytes on the read buffer shift positions&lt;/li&gt;
&lt;li&gt;Bytes values go to 0&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Around the same time the RTE reports the following system errors in a recurrent way:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;Entry&lt;/span&gt; &lt;span class="na"&gt;severity=&lt;/span&gt;&lt;span class="s"&gt;"warning"&lt;/span&gt; &lt;span class="na"&gt;component=&lt;/span&gt;&lt;span class="s"&gt;"CmpOPCUAStack"&lt;/span&gt; &lt;span class="na"&gt;user=&lt;/span&gt;&lt;span class="s"&gt;"nobody"&lt;/span&gt; &lt;span class="na"&gt;timestamp=&lt;/span&gt;&lt;span class="s"&gt;"24-Sep-19 14:55:30"&lt;/span&gt; &lt;span class="na"&gt;infoId=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;OpcUa_TcpListener_ReadEventHandler: Process Request returned an error (0x800B0000)!&lt;span class="nt"&gt;&amp;lt;/Entry&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;Entry&lt;/span&gt; &lt;span class="na"&gt;severity=&lt;/span&gt;&lt;span class="s"&gt;"error"&lt;/span&gt; &lt;span class="na"&gt;component=&lt;/span&gt;&lt;span class="s"&gt;"CmpOPCUAStack"&lt;/span&gt; &lt;span class="na"&gt;user=&lt;/span&gt;&lt;span class="s"&gt;"nobody"&lt;/span&gt; &lt;span class="na"&gt;timestamp=&lt;/span&gt;&lt;span class="s"&gt;"24-Sep-19 14:55:30"&lt;/span&gt; &lt;span class="na"&gt;infoId=&lt;/span&gt;&lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;OpcUa_SecureListener_ProcessRequest: Closing channel due error 0x800B0000!&lt;span class="nt"&gt;&amp;lt;/Entry&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;Entry&lt;/span&gt; &lt;span class="na"&gt;severity=&lt;/span&gt;&lt;span class="s"&gt;"error"&lt;/span&gt; &lt;span class="na"&gt;component=&lt;/span&gt;&lt;span class="s"&gt;"CmpOPCUAStack"&lt;/span&gt; &lt;span class="na"&gt;user=&lt;/span&gt;&lt;span class="s"&gt;"nobody"&lt;/span&gt; &lt;span class="na"&gt;timestamp=&lt;/span&gt;&lt;span class="s"&gt;"24-Sep-19 14:55:30"&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;I also observed that the PLC load fluctuates around the same time it reads corrupted data, on the other hand, the incoming data is just fine when the CPU stays at a steady value.&lt;/p&gt;
&lt;p&gt;Could you help me please?&lt;/p&gt;
&lt;p&gt;PS: I have the same codesys application running on a raspberri Pi and all data is perfect.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>