RobotStudio event

Communication Interface Error

Hi all,

I am trying to build a TCP/IP based communication between a c++ server and robostudio. I have managed to send messages from robotstudio to the server pretty quickly, but I have problems with sending messages from the server to robotstudio.
The problem is: After exactly 12 messages sent by the server, I get a communication interface error -112602. At first I thought that the messages are lost, because of timing or some other reason and since I have set the MaxLost= 10 in the Configuration.xml file, that this was the  reason the communication failed. But I checked, by using the FlexPendant, if I receive the values sent by the c++ server and it seems that I get all of them, so no message is lost.
So why do I get this error? What other thing might causes it?

I include my rapid code and I attach the description and configuration files

MODULE RRI_newmodule
    RECORD robotdata
        num type;
        string status;
    ENDRECORD

    RECORD replydata
        num type;
        string status;
        num Time;
    ENDRECORD

    PERS sensor TestDevice := [-1,0,2];
    PERS robotdata RobotMessage := [0,""];
    PERS replydata ReplyMessage := [0,"",0];


    PROC Main()
    SiConnect TestDevice;
    SiSetCyclic TestDevice, RobotMessage, 800;
    SiGetCyclic TestDevice, ReplyMessage, 800;
    
    ENDPROC 
    
ENDMODULE
  

Comments

  • pollux
    pollux
    edited November 2014
    Hi Fotisf,

    I only got about 10 days of experience with robotstudio/rapid so this could be related to my unexperienceness :),  but I noticed unexpected behavior when trying to communicate over a socket too. I solved this by not sending too much data at once. I'm sending less then 1024 bytes at a time (which makes handling the buffers easier too) and this seems to work fine for both ways of communicating. 

    What is that MaxLost configuration flag you're talking about? 

    p.


  • Hi pollux,

    Don't worry, I am a newbie too.
    I send around 400 characters from robotstudio to the c++ server and not more than 80 characters from the server to robotstudio till now.
    As for the MaxLost configuration, it is in the description.xml file, sorry for the confusion. It is the maximum number of lost packages allowed, if it is exceeded a communication error is generated.

    Since you have already implemented it, could you please send me some sample code? I would be really grateful.

    Thank you very much for the quick reply.


  • Hi FotisF, 

    I'll send you some code when I am behind the pc at the office. So if I'm correct is the MaxLost parameter used by the controller to detect lost tcp/ip packets? Is this some sort of security 'feature'?

    p

  • Hi pollux,

    yes it is a security feature. If many tcp/ip packets are lost (the user configures how many is too many), then something's wrong with the communication, so an error is generated.
    I have read about it in the Robot Reference Interface Application Manual.


  • Thanks FotisF, 

    I thought I had experienced something like this but someone from ABB told me this feature didn't exist when I asked (?). This explains my previous post where I can ping the controller but not being able to go 'online'. 

    Thanks for sharing
    p
  • Hi FotisF,


    Note that this really needs to be cleaned up and I need to add some extra checks. I hope it contains something useful.

    p
  • Hi pollux,

    many thanks for the code,I believe that it will be very useul for me. I 'll check it and see if I can solve my problem by creating and using a socket insted of SiConnect.
    I let you know how it goes.

  • Hi pollux,

    I finally managed to make my code work. It seems it was a minor thing that caused the problem, I forgot to include the message id in the message I sent to Robotstudio. So now the communication works using the RRI. Anyway, many thanks for the code again.