Greetings to all,
I am coming from the V+ and VAL3 corner, so please forgive me my illiteracy with Kawasaki.
I have programmed a TCP/IP program which speaks with a .NET application on a PC.
It works pretty well, but during stability testing (I tested random forced disconnections) I came across an issue where K-Roset does not behave as specified in the TCP/IP Manual.
25 TCP_RECV .ret, .sock_id, .$tcp_data[1], .num, .to, 255
26 IF .ret < 0 THEN
27 ; do some error handling and cleanup here
28 END
The issue is : when the program is in TCP_RECV and there is a communication error like -34021, contrary to the documentation, the program is stopped instead of returning the error code in the .ret variable. As the program is stopped I have no way of cleaning up and retrying.
Here is the terminal-output when that happens : (the Pendant displays the same message with an orange RESET button etc)
(E4021) TCPIP)Communication Error. CODE=0 Dst.IP=0.60161672.268472975.-34021
No = 1001
Program = rt_tcp_receive Step = 25
PC program aborted.No = 1001
The documentation says to the TCP_RECV function:
If communication error occurs, the error code is stored in the returned value storage variable and program execution does not stop.
and later in Chapter 6.1 the same statement :
6.1 COMMUNICATION ERRORS IN SOCKET COMMUNICATION
The following errors may be detected during execution of socket communication instructions,
but will not stop the execution of the program
Error -34021 is clearly in the list of error-codes which should not stop program execution.
So what is my mistake ? Why does the program stop instead of returning the error code ?
Is there a secret SWITCH where this behavior can be altered ? Or is this just a K-ROSET issue and will not happen on a real robot ?
I have also not found an equivalent to V+ REACTE where you can handle such program-stopped conditions with your own error handling routine.
Any help is greatly appreciated.
Reto.