RobotStudio event

Read joint angles via OPC

Options
Hi!

I've successfully installed a OPC Server for the IRC5 controller. With a OPC Client i can access several I/O signals and so on.
Now what I want to do is to read out the joint angles of the virtual IRB120 robot in Robotstuido via the OPC Server. I thought of a scenario where I'm able to jogg the virtual robot model in Robotstudio and read out the angles via OPC.

I've searched the I/O signals of the IRC5 but i don't find any signal which represents a motor/joint angle

Does somebody have any suggestions on how to do that?

Thx a lot

Comments

  • Henrik Berlin
    Options
    I don't think there is a pre-defined signal you can use for joint values.

    Try defining a background target that continuously reads (at regular time intervals) the current joint values using the RAPID instruction "GetJointData" and outputs the values through some analog signals that you need to define for this purpose. Haven't tried it though. No guarantees. 
    Henrik Berlin
    ABB
  • Hi Henrik!
    Thanks for your reply!

    I've tried to do a backgroundtask with the following code (at first made task NORMAL instead of SEMISTATIC):

    MODULE MainModule
        VAR jointtarget joints;
        PROC main()
        WHILE 1=1 DO
            joints:=CJointT(\TaskRef:=T_ROB1Id); 
        ENDWHILE
        ENDPROC
    ENDMODULE

    and following task T_ROB1 also in NORMAL mode:

    MODULE MainModule
        PROC main()
            MoveJ [[437.94,242.07,226.08],[0.000128885,0.164209,-0.986425,2.19848E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v1000, z50, tool0;
            MoveL [[437.94,242.07,129.10],[0.000129096,0.164209,-0.986426,2.21218E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v100, fine, tool0;
            MoveL [[437.94,242.07,277.05],[0.000128927,0.164209,-0.986426,2.20586E-05],[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v100, z10, tool0;
            MoveJ [[437.94,52.29,352.29],[0.000129264,0.164209,-0.986426,2.20375E-05],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v1000, z50, tool0;
            MoveJ [[437.94,-155.04,229.34],[0.000129854,0.164209,-0.986426,2.17056E-05],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v1000, z50, tool0;
            MoveL [[437.94,-155.04,184.42],[0.000129644,0.164209,-0.986426,2.1811E-05],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v100, fine, tool0;
            MoveL [[437.94,-155.04,270.72],[0.000129686,0.164209,-0.986426,2.18057E-05],[-1,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v100, z10, tool0;
            MoveJ [[437.94,29.65,377.70],[0.000129517,0.164209,-0.986426,2.18373E-05],[0,-1,-1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]], v1000, z50, tool0;
        ENDPROC
    ENDMODULE

    If i want to run the simulation it simply doesn't start without any feedback (neither on the flexpedant nor in Rapid tap under simulate and debug if i press play).
    If i want to set the task for my logger to SEMISTATIC i get following error message:


    Do you have anny suggestions for fixing?

    Thanks


  • Henrik Berlin
    Options
    You should add WaitTime 0.01; after you read the joints (or any low number above zero), otherwise the controller will be choked. The real controller can handle it, but the virtual controller will get stalled.

    The error message complains that you don't have write access. Do you?
    Henrik Berlin
    ABB
  • Hi Henrik! Sorry for the late response, I got it all working now! Turned out that I used an old version of RobotWare 5. I upgradet it to RobotWare 6 and everything worked. Although I'm not happy with the refreshrate of the jointpositions on the opc server, but I suggest this comes from the semi-parallel usage of tasks on the controller am I right?

    I connected the Mechatronic Concept Designer with OPC to Robotstudio. Where in Robotstudio the Robot moves smooth, in MCD the robot movement is somehow flickery (which comes from the low refreshrate of jointdata in robotstudio). Do you have any suggestions on how to speed this up. Or is it possible to export the angular joint positions from robotstudio using other interfaces like shared memory instead of OPC, in order to get a smooth simulation in MCD?