<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/</id><updated>2025-12-01T07:47:13.698000Z</updated><subtitle>Recent posts to TCP Server</subtitle><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#febd" rel="alternate"/><published>2025-12-01T07:47:13.698000Z</published><updated>2025-12-01T07:47:13.698000Z</updated><author><name>junbon</name><uri>https://forge.codesys.com/u/junbon/</uri></author><id>https://forge.codesys.com5cb1916b5d71f9ff38cf900282c124a96cd4e20d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm not sure what the issue with the socket implementation is, but based on what I've read in the forums, it appears that the Nett Base Services package is the best option. &lt;a href="https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/"&gt;https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/&lt;/a&gt; &lt;a href="https://snowrider3dgame.io/" rel="nofollow"&gt;Snow Rider 3D&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#e94c" rel="alternate"/><published>2025-10-29T08:45:37.451000Z</published><updated>2025-10-29T08:45:37.451000Z</updated><author><name>rosean88</name><uri>https://forge.codesys.com/u/rosean88/</uri></author><id>https://forge.codesys.com3da62f38b75e414fbe7bc258898556eb432a1d6b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It's great to see interest in building a TCP server in your PLC program! I've had success using the CAA NetBaseSrv library for its ease of implementation. Additionally, don't forget to consider data transmission efficiency, as this can impact your server's performance. By the way, if you're looking for a break after coding, check out &lt;a class="" href="https://driftboss.lol/" rel="nofollow"&gt;drift boss&lt;/a&gt;  for some fun gameplay! Happy coding!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#25b7" rel="alternate"/><published>2025-06-16T02:24:23.281000Z</published><updated>2025-06-16T02:24:23.281000Z</updated><author><name>tommytyler</name><uri>https://forge.codesys.com/u/tommytyler/</uri></author><id>https://forge.codesys.comfb98072adfc8b65dfd44a250aafb8941e6246934</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm not sure what the issue with the socket implementation is, but based on what I've read in the forums, it appears that the Nett Base Services package is the best option.  &lt;a href="https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/"&gt;https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/&lt;/a&gt; &lt;a class="" href="https://speedstars-game.io" rel="nofollow"&gt;speed stars&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#2d26" rel="alternate"/><published>2025-06-03T10:13:14.430000Z</published><updated>2025-06-03T10:13:14.430000Z</updated><author><name>thomasfrank</name><uri>https://forge.codesys.com/u/thomasfrank/</uri></author><id>https://forge.codesys.comfe586afa0da319362c6029dafddb8a2010f1e610</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;You can use function blocks like TCPServer to start the &lt;a class="" href="https://retrobowl.college/online" rel="nofollow"&gt;Retro Bowl College&lt;/a&gt; server and TCPAccept to handle incoming connections, with CAA.Handle simply acting as a reference ID for each resource.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#ad00" rel="alternate"/><published>2025-02-20T20:29:12.782000Z</published><updated>2025-02-20T20:29:12.782000Z</updated><author><name>rmaas</name><uri>https://forge.codesys.com/u/rmaas/</uri></author><id>https://forge.codesys.com95525d70f478f460e2400aeb5a879a5cc7ad22a9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi George,&lt;/p&gt;
&lt;p&gt;I do not know what the problem is with the syssocket implementation, but when i read the forums it seems the Net Base Services library is the recommended way to go.&lt;/p&gt;
&lt;p&gt;There is another more extensive example here:&lt;br/&gt;
&lt;a href="https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/"&gt;https://forge.codesys.com/prj/codesys-example/plc-chat-nbs/home/Home/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have just tested this example and it works very well, also with closing and opening the connection from hercules...&lt;/p&gt;
&lt;p&gt;good luck!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#f509" rel="alternate"/><published>2025-02-20T15:40:57.612000Z</published><updated>2025-02-20T15:40:57.612000Z</updated><author><name>george32</name><uri>https://forge.codesys.com/u/george32/</uri></author><id>https://forge.codesys.comec77eb7cbf051b607bb81205a38688e3f2bec712</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you for your advice Rinie, &lt;/p&gt;
&lt;p&gt;I have tried to follow this example but found one problem.When I disconnect with Hercules the system does not acknowledge the lost of its connection this could result in critical errors. &lt;/p&gt;
&lt;p&gt;Because of this error I am trying to implement the Syssocket library. With this library I am having a problem which I could not solve.&lt;/p&gt;
&lt;p&gt;I have the following code:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;ip_adres&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;STRING&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="s1"&gt;'0.0.0.0'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;WORD&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt;    &lt;/span&gt;
&lt;span class="n"&gt;iStep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;INT&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;


&lt;span class="c1"&gt;// Socket information&lt;/span&gt;


&lt;span class="n"&gt;Socket_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_IEC_HANDLE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="n"&gt;Socket_handler_result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;


&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SOCKADDRESS&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Addres_Convert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Implementation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;

&lt;span class="c1"&gt;// Bind information&lt;/span&gt;
&lt;span class="n"&gt;Bind_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Listener Information&lt;/span&gt;
&lt;span class="n"&gt;Listener_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_IEC_RESULT&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;




&lt;span class="n"&gt;Addres_Convert&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Implementation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SysSockInetAddr&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;szIPAddress&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ip_adres&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="n"&gt;pInAddr&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sin_addr&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sin_family&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SOCKET_AF_INET&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sin_port&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Implementation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SysSockHtons&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;usHost&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;CASE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;iStep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;OF&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;// Create Socket&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;Socket_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;SysSockCreate&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;iAddressFamily&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SOCKET_AF_INET&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;diType&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SOCKET_STREAM&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;diProtocol&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SOCKET_IPPROTO_TCP&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;pResult&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Socket_handler_result&lt;/span&gt;&lt;span class="o"&gt;));&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;IF&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Socket_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Interfaces&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;RTS_INVALID_HANDLE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;THEN&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;iStep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;ELSE&lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="n"&gt;iStep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;END_IF&lt;/span&gt;

&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;Bind_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Implementation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SysSockBind&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;                            &lt;/span&gt;&lt;span class="n"&gt;hSocket&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;Socket_handler&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                            &lt;/span&gt;&lt;span class="n"&gt;pSockAddr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;ADR&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="o"&gt;),&lt;/span&gt;
&lt;span class="w"&gt;                            &lt;/span&gt;&lt;span class="n"&gt;diSockAddrSize&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;SIZEOF&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Socket_adress&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;



&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="n"&gt;Listener_handler&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;SysSocket_Implementation&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;SysSockListen&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
&lt;span class="w"&gt;                                &lt;/span&gt;&lt;span class="n"&gt;hSocket&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="n"&gt;Socket_handler&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
&lt;span class="w"&gt;                                &lt;/span&gt;&lt;span class="n"&gt;diMaxConnections&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;



&lt;span class="n"&gt;END_CASE&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When I am trying to get this working,  the SysSockBind function gives a value of 16#207 which means adress already in use. I find this weird because of the IP-adress of 0.0.0.0. I think I am converting the Ip-adress in the wrong way, but the code does not give a error arround this. So therefore I cannot find the solution to this problem. I hope someone could help me with this problem. &lt;/p&gt;
&lt;p&gt;Thanks in advance &lt;br/&gt;
George&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#0944" rel="alternate"/><published>2025-02-20T08:01:55.393000Z</published><updated>2025-02-20T08:01:55.393000Z</updated><author><name>rmaas</name><uri>https://forge.codesys.com/u/rmaas/</uri></author><id>https://forge.codesys.come31e3b827c93d892200ad1587380a1a467f422d5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi George,&lt;/p&gt;
&lt;p&gt;I am no expert but recently tried and got it working using this example project:&lt;br/&gt;
&lt;a href="https://forge.codesys.com/prj/codesys-example/nbs/home/Home/#example-for-tcp-server-tcp-client"&gt;https://forge.codesys.com/prj/codesys-example/nbs/home/Home/#example-for-tcp-server-tcp-client&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;br/&gt;
Rinie&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP Server</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/25b3ce1af3/?limit=25#91a8" rel="alternate"/><published>2025-02-20T07:08:00.904000Z</published><updated>2025-02-20T07:08:00.904000Z</updated><author><name>george32</name><uri>https://forge.codesys.com/u/george32/</uri></author><id>https://forge.codesys.comb1d7022c5ad776b69df9065b72c7d50feb4ed185</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Dear people,&lt;/p&gt;
&lt;p&gt;I would like to create a TCP server in my PLC program. The TCP server needs to communicate with an external device. I have been searching the internet and found that the libraries Syssocket or CAA NetBaseSrv are two possible solutions to create a TCP server. From what I have read, CAA NetBaseSrv is more user-friendly to implement than the Syssocket variant.  &lt;/p&gt;
&lt;p&gt;However, I am still struggling to actually implement this library. Foremost is my little knowledge about creating a TCP server and how to read/understand each function block, especially the outputs of some blocks and the types, e.g. server has an output CAA.Handle, but I cannot find the explanation of CAA.Handle. I tried to find a good document that can help me understand how to implement a TCP server, but I could not find it. &lt;/p&gt;
&lt;p&gt;Thank you in advance,&lt;br/&gt;
George&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>