<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to VisuSerialCom Project suffering from severe lag</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/</id><updated>2020-02-27T16:55:48.177000Z</updated><subtitle>Recent posts to VisuSerialCom Project suffering from severe lag</subtitle><entry><title>VisuSerialCom Project suffering from severe lag</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/?limit=25#2ffa" rel="alternate"/><published>2020-02-27T16:55:48.177000Z</published><updated>2020-02-27T16:55:48.177000Z</updated><author><name>Matt-Engels</name><uri>https://forge.codesys.com/u/matt-engels/</uri></author><id>https://forge.codesys.comd13c1cef0f257fe78bf2119e3b0e987f932de878</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Never mind - I think the problem is gone now.  I reduced the read delay from 1000 ms to 250 ms and the delay appears gone, even after running the application for two hours.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VisuSerialCom Project suffering from severe lag</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/?limit=25#60ff" rel="alternate"/><published>2020-02-27T16:55:47.239000Z</published><updated>2020-02-27T16:55:47.239000Z</updated><author><name>Matt-Engels</name><uri>https://forge.codesys.com/u/matt-engels/</uri></author><id>https://forge.codesys.comfdd88ec37ed34c8109cf722488d67d6a639d9768</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For what it is worth, the delay in the read block is set to 1000 ms.  The Arduino writes a new value to its serial port every 1000 ms.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VisuSerialCom Project suffering from severe lag</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/81e23e0378/?limit=25#1157" rel="alternate"/><published>2020-02-27T16:55:44.625000Z</published><updated>2020-02-27T16:55:44.625000Z</updated><author><name>Matt-Engels</name><uri>https://forge.codesys.com/u/matt-engels/</uri></author><id>https://forge.codesys.com58e1ef09f4e9ac0e73d48687caa18acec3098e54</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I am using the VisuSerialCom example project - albeit altered - to read an integer from an Arduino, which sends it every second as a high and low byte in order.&lt;br/&gt;
I've edited the project to receive the data as an array of 1 int and it displays properly.  That integer is a base number plus a randomization band (i.e. 6000 + random number between -100 and +100), hence the update every second is important to capture the most recent value.&lt;/p&gt;
&lt;p&gt;The problem I run into is this:  After running for a while, the number reads suffer from very severe lag.  I can force the Arduino output to zero manually and observe that change immediately on an attached 7-segment display as well as on an oscilloscope. &lt;br/&gt;
I left the program running for 12 hours and the lag is now at about 25 minutes.  So I force a change to zero, and the Raspberry Pi with the modified VisuSerialCom project still updates the number once every second, but it will take about 25 minutes of 1-second updates before the value goes to zero.&lt;br/&gt;
What should I be looking at to fix this?  Perhaps forcibly flush the readBuffer after every read?  (How do I do that?)&lt;/p&gt;
&lt;p&gt;Thanks for any help,&lt;/p&gt;
&lt;p&gt;Matt&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>