<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to SysComRead timeout</title><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/741bdcdd67/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/CODESYS-V2/thread/741bdcdd67/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/CODESYS-V2/thread/741bdcdd67/</id><updated>2020-02-27T22:56:50.812000Z</updated><subtitle>Recent posts to SysComRead timeout</subtitle><entry><title>SysComRead timeout</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/741bdcdd67/?limit=25#f9d5" rel="alternate"/><published>2020-02-27T22:56:50.812000Z</published><updated>2020-02-27T22:56:50.812000Z</updated><author><name>Carli</name><uri>https://forge.codesys.com/u/carli/</uri></author><id>https://forge.codesys.comc85fc057358e2e30ef864a4fbaf2ae4a87c30e67</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Here is answer from CoDeSys support:&lt;/p&gt;
&lt;p&gt;The timeout is the time a function waits in total till it returns.&lt;/p&gt;
&lt;p&gt;If the function is called and no data is available then it returns immediately.&lt;/p&gt;
&lt;p&gt;I think you must wait until you call the read function as it seems that it takes some time till data is available.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>SysComRead timeout</title><link href="https://forge.codesys.com/forge/talk/Codesys%2520V2.3/thread/741bdcdd67/?limit=25#0bb9" rel="alternate"/><published>2020-02-27T22:56:49.221000Z</published><updated>2020-02-27T22:56:49.221000Z</updated><author><name>Carli</name><uri>https://forge.codesys.com/u/carli/</uri></author><id>https://forge.codesys.com6659ba475db1b7ef286705f56b7b20ba6b4b60d6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I have problem with timeout in the "SysComRead" function.&lt;/p&gt;
&lt;p&gt;I send the message with COM port successfully and then I want to read the answer, but function "SysComRead" doesn't wait for setting timeout to the answer.&lt;/p&gt;
&lt;p&gt;How may I set this communication?&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;Here is part of my code:&lt;/p&gt;
&lt;p&gt;```&lt;/p&gt;
&lt;p&gt;Global variables:&lt;br/&gt;
   port: PORTS:=COM1;&lt;br/&gt;
   setting: COMSETTINGS := (Port:=COM1, &lt;br/&gt;
            dwBaudRate:=9600, &lt;br/&gt;
            byStopBits:=0, &lt;br/&gt;
            byParity:=0, &lt;br/&gt;
            dwTimeout:=5000, &lt;br/&gt;
            dwBufferSize:=0, &lt;br/&gt;
            dwScan:=0);&lt;br/&gt;
Function:&lt;br/&gt;
   handle: DWORD;&lt;br/&gt;
   message: ARRAY &lt;span&gt;[0..9]&lt;/span&gt; OF BYTE;&lt;br/&gt;
   handle := SysComOpen( port );     (&lt;em&gt; Open COM port &lt;/em&gt;)&lt;br/&gt;
   SysComSetSettings(dwHandle:=handle, ComSettings:=ADR(setting));     (&lt;em&gt; Setting up communication &lt;/em&gt;)&lt;br/&gt;
   SysComWrite(handle, ADR(message), 7, 5000);     (&lt;em&gt; Send message (7bytes) &lt;/em&gt;)&lt;br/&gt;
   SysComRead(handle, ADR(message), 3, 5000);     (&lt;em&gt; Read answer (3bytes) &lt;/em&gt;)&lt;br/&gt;
   SysComClose(handle);     (&lt;em&gt; Close COM port &lt;/em&gt;)&lt;/p&gt;
&lt;p&gt;```&lt;span&gt;[/code]&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>