Socket Communication


i try to connect robotstudio with another pc. I think i have to use socket communication.

VAR socketdev client_socket;

VAR string receive_string;

PROC client_messaging()


! Create and connect the socket in error handlers

SocketSend client_socket \Str := "Hello server";

SocketReceive client_socket \Str := receive_string;


SocketClose client_socket;








! No error recovery handling



PROC client_recover()

SocketClose client_socket;

SocketCreate client_socket;

SocketConnect client_socket, "", 1025;







! No error recovery handling



 i read in a manaul, that i need pc interface, but where or who can i see, if my pc has pc inter face?

best regards


  • SjoLiSjoLi Dodewaard NL
    PC interface is an option in yourcontroller not on a pc

    You can connect to the controller via the serviceport and have all funtionality.

    If you want to be able to connect to the robot via a network the robotcontroller needs to have the option PC interface.
    Without this you are only able to get files from/to the controller via an FTP-program from a network location.
    The Netherlands
  • Peter1Peter1 ✭✭


    if you want to use pc interface it is your ROBOT that needs the option PC interface

    make a backup of your robot and look in the directory BACKINFO for the file backinfo.txt (this is for IRC5 robot)

    there you can see all the options installed in your robot, i.e.   616-1 PC Interface

    Or go on your main screen ABB to "system info" and look for "System properties/Control module/options"



  • Dante1990Dante1990
    edited July 2013
    thanks for the answers.
    I try to built a socket between Robotstudio and Visual basic, is that possible.

    I have in my Rapid task a program error ?

    Module Socket

    VAR socketdev socket1;
    VAR socketstatus state;

    PROC main ( )

    SocketCreate socket1;
    SocketConnect socket1, "", 1025;
    SocketSend socket1 Str:=received_string;
    state := SocketGetStatus( socket1 );



    Post edited by Dante1990 on
  • AlexKAlexK Sweden ✭✭
    Please post the error message you get? For Socket commands you need to have the PC Interface option.
    Best regards
    Alexander Källberg
  • hi 

    i dont have pc interface, but i have to use opc for the communication.
    i know for opc, first i hve to programme with CoDeSys and after that i have to create a smart component (opc component),but how i can connect robotstudio with visual basic ?

    best regards
  • There seems to be a lot of confusion here. I think it would be more helpful if you try to explain what you are trying to achieve and get help on achieving that, instead of trying to get technical help on something which you might not need to achieve your goal anyway.


    So is this for simulation purposes only or is there a real robot cell involved?

    If it is a real robot cell and you need to use opc communication from some other device (PLC?) to communicate with your controller - then RobotStudio isn't involved at all. Instead what you need is to have a PC with IRC5 OPC Server installed, then configure that with the controller, then use whatever OPC client/server interface your device have to connect it to the IRC5 OPC Server output.

    If this is for simulation only then you can have Visual Basic .NET code both in a Smart Component with Code Behind, or as a RobotStudio SDK - addin. If so check out the Developer Center. However that would have nothing to do with the OPC smart component since you wouldn't be able to edit it's code.

    Now the socket messaging would only be useful if you are running communication between two rapid tasks, or if you are running communication from the robot controller using RAPID to a PC with a PCSDK application listening. If so RobotStudio wouldn't be involved.


    So please focus instead on explaining what you need to achieve.

  • hi 

    i have to create a communication between robotstudio, the real robotor and visual basic. 
    the programme of visual basic give robot studio instructions, for example leave path A. after that robot studio have to give the instructions to the real cell. Is it possible to connect them.

    best regards
  • Ah, another student then?


    Now why do you want to include RobotStudio?

    If you need to make a Visual Basic app that communicate with the real robot, it is much easier and better to have that communication go directly and skip RobotStudio entirely.

    You do that by creating a PC SDK application, which you can start reading about that over in the Developer Center, but you should try out the coding part preferably by reading this chapter.

    I've created samples using C# which you can find by searching this forum, attached is one with a read/write RAPID variable, study it to see what you need to do in VB.


  • Hi John thanks for the answer. I have to create a PC SDK Application, but where can i find the declarations for Visual Basic? Is there a Handbook of abb to this topic. In the zip are many data, which i have to install ? Another Student have to Programm Visual Basic, i have to Programme robot Studio. Best regards Dante
  • hi
    i read in a chapter, that i need for the real controller the following software components must be installed to develop, test and debug
    using a real robot controller:
    • ABB RobotStudio (Complete or Custom - with RobotStudio and PC SDK
    • Microsoft Visual Studio 2005 Express or better, or, Microsoft Visual Studio
    2008 Express or better.
    • Controller option PC Interface
    • Network connection between PC and robot controller

    the problem is i dont have pc interface, which other communication can i use without pc interface
  • Sorry, can somebody explain
    1. What means "myString"
    RapidData rd = _controller.Rapid.GetRapidData("T_ROB1", "myModule", "myString");

    2. what I should put inside the Textbox for writing RAPIDA ?                        
    rapidString.FillFromString( textBoxString.Text);

    I need just an alive example.

Sign In or Register to comment.