<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/</id><updated>2022-12-20T16:24:50.022000Z</updated><subtitle>Recent posts to TCP with CAA Net Base Services</subtitle><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#ff2b/c2a6" rel="alternate"/><published>2022-12-20T16:24:50.022000Z</published><updated>2022-12-20T16:24:50.022000Z</updated><author><name>masmith1553</name><uri>https://forge.codesys.com/u/masmith1553/</uri></author><id>https://forge.codesys.comb77555d8d15f81774d28ddc87988585754eb3d6c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Is there a was to flush the TCP port before a TCP Receive?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#ff2b" rel="alternate"/><published>2021-05-14T10:10:58.282000Z</published><updated>2021-05-14T10:10:58.282000Z</updated><author><name>ddenton</name><uri>https://forge.codesys.com/u/ddenton/</uri></author><id>https://forge.codesys.com4ef0f543cc1377d6ea1448cfa2de8caa205b9fd7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hey guys! &lt;/p&gt;
&lt;p&gt;I've been struggling with this too. To defeat the Tcp_Read/Write error, I cleared my Tx and Rx (send and receive) buffers every cycle. I guess this makes sense, since overwriting a larger message with a small one without clearing first would be...messy. &lt;/p&gt;
&lt;p&gt;I have large sized arrays (65,500 bytes), so I had to use the following method to zero out all my arrays without hitting a watchdog timer exception:&lt;/p&gt;
&lt;p&gt;Mem.MemFill(pMemoryBlock:= ADR(arrRx),uiLength := SIZEOF(arrRx),byFillValue := 0);&lt;br/&gt;
Mem.MemFill(pMemoryBlock:= ADR(arrTx),uiLength := SIZEOF(arrTx),byFillValue := 0);&lt;/p&gt;
&lt;p&gt;Hope this helps! &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#5e95" rel="alternate"/><published>2020-05-05T07:20:49.947000Z</published><updated>2020-05-05T07:20:49.947000Z</updated><author><name>maoravni</name><uri>https://forge.codesys.com/u/maoravni/</uri></author><id>https://forge.codesys.comeee5f112d1fd0cca2142339f9cae6dc7d4cf3251</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I have a project that was compiled on an old version of codesys. I recently upgraded my entire project to use all latest library and bumped into the same error (6012).&lt;/p&gt;
&lt;p&gt;My temporary solution was to downgrade only the NBS library to an older version - that seemed to solve my issue. I've gone back to version 3.5.6.0 of the library.&lt;/p&gt;
&lt;p&gt;Can anyone from codesys comment on this?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#5543" rel="alternate"/><published>2020-02-27T13:48:29.355000Z</published><updated>2020-02-27T13:48:29.355000Z</updated><author><name>AndreasR</name><uri>https://forge.codesys.com/u/andreasr/</uri></author><id>https://forge.codesys.comd5c126ebe8454d4b6c37720de3442c9c53f11c2e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;matyzs.v hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
HI,&lt;br/&gt;
I have the same problem. Did you find some solution please?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I have the same problem as well. Did anyone find some solution please?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#3522" rel="alternate"/><published>2020-02-27T13:48:29.252000Z</published><updated>2020-02-27T13:48:29.252000Z</updated><author><name>arihje</name><uri>https://forge.codesys.com/u/arihje/</uri></author><id>https://forge.codesys.com025164d08477618ee4bc213bb6bde78d26efba8c</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I also have this problem. I am using code similar to what dFx posted, not like the example with the&lt;br/&gt;
Handler FB, and for a single client it works fine resetting the server each time the client disconnects.&lt;br/&gt;
Luckily, I only need a server for one client in my current application.&lt;/p&gt;
&lt;p&gt;I cannot find anything documenting what causes a TCP_RECEIVE_ERROR (6012).&lt;br/&gt;
It surely does not mean that a message was not received correctly, because the messages always come&lt;br/&gt;
through correctly.&lt;br/&gt;
The error is raised if I physically disconnect the server from the network, but also when the client closes&lt;br/&gt;
the connection correctly by setting the TCP FIN flag. I have checked with Wireshark that a full normal&lt;br/&gt;
handshake for closing the connection is performed, but still get the error.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#751c" rel="alternate"/><published>2020-02-27T13:48:29.126000Z</published><updated>2020-02-27T13:48:29.126000Z</updated><author><name>Anonymous</name><uri>https://forge.codesys.com/u/*anonymous/</uri></author><id>https://forge.codesys.com9db273666260bda387b97754037c86902227a6fa</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;&lt;em&gt;Originally created by:&lt;/em&gt; rettore84&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;luciano.assirelli hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Hi all, and thanks for existing.&lt;br/&gt;
I'm apparently facing the same problem. I need to implement a server accepting a single client. &lt;br/&gt;
To simplify things at the beginning, I implemented a simple echo server, which TCP_Writes the same&lt;br/&gt;
buffer contents, as soon as some contents arrives thru TCP_Read. And everything looks ok:&lt;br/&gt;
once the connection is established, echo is working.&lt;br/&gt;
Things get complcated when I "close" the connection, either from the client or server side: before reconnect,&lt;br/&gt;
the connection handle is properly at zero; after reconnect, the connection handle provided by the &lt;br/&gt;
TCP_Connection function block appears to be the same as before disconnect; and this is may not &lt;br/&gt;
be a problem, but the TCP_Read executed on that handle gives a permanent TCP_RECEIVE_ERROR (6012).&lt;br/&gt;
I have no other options than disable/enable the TCP_Server fb, but nothing changes. By the way, even if&lt;br/&gt;
this worked, I suppose that it would be not applicable if one had to implement a multiple client solution.&lt;br/&gt;
The only operation that really reset things is a controller warm reset.&lt;br/&gt;
Just to put some other meat on the grill... I have been using a proprietary TCP server implementation&lt;br/&gt;
from ELAU (now Schneider Electric), and it gave me the option to filter incoming connection based on the IP address.&lt;br/&gt;
How could this be done with CAA netbase? Or, more simply spelled: how can I obtain the IP address of an incoming connection?&lt;br/&gt;
I will really appreciate any comments!&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Not sure if someone is still having issues with this and getting error 6012. This was happening whenever the client was disconnecting from Codesys Server. I had always to do a warm/cold restart. My solution was not to use the Handler FB that comes in the example project. Take all the logic that it is inside the Handler FB, and put it outside. You don't need the Handler FB. It will work.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#55e1" rel="alternate"/><published>2020-02-27T13:48:29.060000Z</published><updated>2020-02-27T13:48:29.060000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.comce5d390c134e975c0f9348a8b176e098778314e6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;dFx hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
To face this, I ping my Partner which is not very reliable (need to know Partner IP address). I do it outside the block, and then I reset Enable flag.&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#c322" rel="alternate"/><published>2020-02-27T13:48:28.993000Z</published><updated>2020-02-27T13:48:28.993000Z</updated><author><name>matyzs.v</name><uri>https://forge.codesys.com/u/matyzs-v/</uri></author><id>https://forge.codesys.come3a6ba250c54b735539438cbaf9dbe8cf3a6617b</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;luciano.assirelli hat geschrieben:&lt;/strong&gt;&lt;br/&gt;
Things get complcated when I "close" the connection, either from the client or server side: before reconnect,&lt;br/&gt;
the connection handle is properly at zero; after reconnect, the connection handle provided by the &lt;br/&gt;
TCP_Connection function block appears to be the same as before disconnect; and this is may not &lt;br/&gt;
be a problem, but the TCP_Read executed on that handle gives a permanent TCP_RECEIVE_ERROR (6012).&lt;br/&gt;
I have no other options than disable/enable the TCP_Server fb, but nothing changes. By the way, even if&lt;br/&gt;
this worked, I suppose that it would be not applicable if one had to implement a multiple client solution.&lt;br/&gt;
The only operation that really reset things is a controller warm reset.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;HI,&lt;br/&gt;
I have the same problem. Did you find some solution please?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#83ed" rel="alternate"/><published>2020-02-27T13:48:28.928000Z</published><updated>2020-02-27T13:48:28.928000Z</updated><author><name>dFx</name><uri>https://forge.codesys.com/u/dfx/</uri></author><id>https://forge.codesys.com6cb6e49f29fbf13fb62a4375b4e59bc2911930c7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Create message is an exemple of user function that transfert the data into your buffer.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>TCP with CAA Net Base Services</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/c9c9e4ae34/?limit=25#1d0a" rel="alternate"/><published>2020-02-27T13:48:28.858000Z</published><updated>2020-02-27T13:48:28.858000Z</updated><author><name>tom vg</name><uri>https://forge.codesys.com/u/tom-vg/</uri></author><id>https://forge.codesys.com201af7a2318a458efca131e4695f4c2b565c7524</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;hi Everyone !&lt;/p&gt;
&lt;p&gt;I'm implementing a TCP read write but is quit hard to get it operational. I'm working with Somachine (Codesys environment for Schneider Electric PLC's), In the example from the CAA Net base services is a 'Createmessage fb. I'm not retrieving this in the libs that i have installed. Can someone tell me where to find it? &lt;/p&gt;
&lt;p&gt;gr Tom&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Knipsel.PNG" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=3555"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>