LMDaniel999 - 2017-07-18

Hi,

i got a question about the serial communication in Codesys with the raspberry pi and an usb/serial converter:
How can i maximize the communication speed?
I request a measuring value by sending a symbol to an measuring system.

More infos about the setting:
For sending and reading I use an edited SERIAL_LINE function block, i got at this thread: https://forum.codesys.com/viewtopic.php?t=5699
i added a new mode, wich sends first and reads the returning value after sending the request symbol.
The waiting timers in the serial connection I minimized to 80ms. If I use shorter times, I get no values.
Also I tried different values for the timers after sending and reading and tried different cycle times down to 8ms.
Changing the cycle times and waiting times simultaneously didn´t work, too.

The baud rate of the measuring system is fixed to 4800 baud.
It uses 7 bits, even parity and 2 stop bits.
If I send a "?", i get a value back like this: "+xxx.xxx$R"

Requesting and reading a value takes at least about 200ms.
So i can only transfer 5 values a second, but i need a faster communication.

How can I improve the communication speed?
I know that there are limits for this communication, but I want to know where´s the problem and the bottleneck.
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...
If this is true, why the communication can´t be improved by reducing the cycle time?
The baud rate might be big enough to transfer more values a second...

Or is the serial communication implemented in the raspbian os?

Why does the serial communication need the waiting timers?

Thanks a lot!