Forum Migration Notice
We're transitioning to a more modern community platform by the end of this year. Learn about the upcoming changes and what to expect.

Sockets

Hello All.
Im fairly new to working with RobotStudio and am now working on the task for sending data to a tool.
The tool is a gripper, which is listening to incomming messages all the time.

    VAR socketdev server;
    PROC MAIN()
        SocketCreate server;
        SocketBind server , <RobotIP> , 1000;
        SocketConnect server, <GripperIP> , 1000;
        SocketSend server, Str := "Test";
        SocketClose server;     
    ENDPROC

where Robot- and GripperIP are Strings with the correct IP.
If have allready programmed a socked Connection in Python and it worked but here i allways get the "The Address is already in use" error (ERR_SOCK_ADDR_ISSUE).
What am I doing wrong?
I also tried changing the port the gripper listens to to 2000 which produced the same error.
Thanks for your efford.

Greetings
Ura



Comments

  • I have succeded establishing a connection by deleting the
        SocketBind server , <RobotIP> , 1000;
    row (although RobotIP was not equal to GripperIP Wacko)
    But now my gripper tells me, he's connected to the right ip, but the programm doenst continue from the
        SocketConnect server, <GripperIP> , 1000;
    row....


  • Scratch that....
    It continued but didn't show me, that the program pointer moved, which i missinterpreted Tongue
    Problem solved... Good i could talk with myself about it LOL