<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to RS232 maximizing communication speed?</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/d2c0450a44/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/d2c0450a44/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/d2c0450a44/</id><updated>2020-02-27T16:56:54.996000Z</updated><subtitle>Recent posts to RS232 maximizing communication speed?</subtitle><entry><title>RS232 maximizing communication speed?</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/d2c0450a44/?limit=25#51d1" rel="alternate"/><published>2020-02-27T16:56:54.996000Z</published><updated>2020-02-27T16:56:54.996000Z</updated><author><name>LMDaniel999</name><uri>https://forge.codesys.com/u/lmdaniel999/</uri></author><id>https://forge.codesys.comef721e3b20a01130eca32f07381974c615cc4fb3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;i got a question about the serial communication in Codesys with the raspberry pi and an usb/serial converter:&lt;br/&gt;
&lt;strong&gt;How can i maximize the communication speed?&lt;/strong&gt;&lt;br/&gt;
I request a measuring value by sending a symbol to an measuring system.&lt;/p&gt;
&lt;p&gt;More infos about the setting:&lt;br/&gt;
For sending and reading I use an edited SERIAL_LINE function block, i got at this thread: &lt;a class="" href="https://forum.codesys.com/viewtopic.php?t=5699" rel="nofollow"&gt;https://forum.codesys.com/viewtopic.php?t=5699&lt;/a&gt;&lt;br/&gt;
i added a new mode, wich sends first and reads the returning value after sending the request symbol.&lt;br/&gt;
The waiting timers in the serial connection I minimized to 80ms. If I use shorter times, I get no values.&lt;br/&gt;
Also I tried different values for the timers after sending and reading and tried different cycle times down to 8ms.&lt;br/&gt;
Changing the cycle times and waiting times simultaneously didn´t work, too.&lt;/p&gt;
&lt;p&gt;The baud rate of the measuring system is fixed to 4800 baud.&lt;br/&gt;
It uses 7 bits, even parity and 2 stop bits.&lt;br/&gt;
If I send a "?", i get a value back like this: "+xxx.xxx$R"&lt;/p&gt;
&lt;p&gt;Requesting and reading a value takes at least about 200ms.&lt;br/&gt;
So i can only transfer 5 values a second, but i need a faster communication.&lt;/p&gt;
&lt;p&gt;How can I improve the communication speed?&lt;br/&gt;
I know that there are limits for this communication, but I want to know where´s the problem and the bottleneck.&lt;br/&gt;
At another sample I read, that the serial communication can only transfer one symbol at one cycle. Is this right? The 80ms waiting time seems to fit to this expectation...&lt;br/&gt;
If this is true, why the communication can´t be improved by reducing the cycle time?&lt;br/&gt;
The baud rate might be big enough to transfer more values a second...&lt;/p&gt;
&lt;p&gt;Or is the serial communication implemented in the raspbian os?&lt;/p&gt;
&lt;p&gt;Why does the serial communication need the waiting timers?&lt;/p&gt;
&lt;p&gt;Thanks a lot! &lt;/p&gt;&lt;/div&gt;</summary></entry></feed>