RobotStudio event

Sending coordinates from the C# code to the robot

Hello!

I am a beginner in using RobotStudio, RobotWare
and PC SDK. What I am trying to do is to send from a C# program some
coordinates to which the robot arm of an IRB 1600 to move to. I have already
done the part of network discovery and selecting the robot controller in Visual
Studio 2008 using C#. Then when I press a button I want that that some
coordinates to be sent to the robot ad the robot to move there. I am using
RobotStudio 5.14.

Firstly, is this possible?

And secondly, if the answer is yes, how could I
do it? Do I have to write some code for the robot too or the RAPID code can be
included in the Visual Studio 2008 application and when I execute the .exe
program resulting from it the robot will move?

Thank you for your help!

Comments



  • Hi cosmin,
     
    Welcome to the forum.
     
    1) Yes
    2) You need RAPID code on the controller. In that RAPID code you can have RobTargets, which you then find & edit using PC SDK. I would propose an edited flag (bool) that tells the robot that the targets have been updated as well. So that you can have handshakes back and forth between PC SDK and RAPID.
    Now you could create a RAPID module and have the controller load it but that is more difficult.
     
    PC SDK manual - Chapters
    [Using the PC SDK - Rapid domain -Working with RAPID data ]
    [Using the PC SDK - Rapid domain - RAPID symbol search]
     
     
     
    Unrelated: why use 2008? Visual Studio 2010 express is free to use.
  • Thank you for your input!
    So I should create a RAPID program and upload it to the controller with some dummy targets which I will then update from my C# program? Can you please tell me where I could find some examples of RAPID code (maybe some code where some targets are defined) and how I could upload RAPID code to the controller? What editor can I use to edit the RAPID code?
    Sorry to ask such basic questions but I have read almost the entire PC SDK Application Manual and I couldn't find these answers.
    Thank you in advance!

    Unrelated:
    The reason I am using Visual Studio 2008 is that in the documentation it is mentioned only Visual Studio 2005 and Visual Studio 2008 and I didn't wanted to have any compatibility issues. Also I have a license for Visual Studio 2008.
  • Hi, you can also use Socket programming. Robot is the Client and your c# program is the server Or Viceversa. You can write a rapid program which listens for the data from server. Let me know if this is what you required or something else.
    Regards
    Ravi



  • Hi, sorry to highjack this thread but I'm also interested in sending coordinates to the robot via a c# addin.

    i want to control an irb 140 with a 3rd party controller. i was looking to just set some joint values with the coordinates i geht from the controller. then i would just do a loop which gets the coordinates and feeds it to the joints.

    is this possible or do i have to write something in rapid too? the goal is just any movement from the robot (only in robotstudio, i only need it on the screen for my thesis) induced by the controller


    benane2012-07-22 18:49:25
  • Hi Guys,

    I did the RAPID/C# communication by searching for the variables, updating them, then writing back. The only problem is that the running rapid program has to finish the MoveL command the program pointer is at before it can respond to the change.

    Is there a method to make it more dynamic?

    Regards
    Mo