Using Workspace on KR C2

  • Hi All


    How do I setup work space on KR C2 ?


    The option under CONFIGURE-->MONITORING WORKSPACE ENVELOPE is grayed out.


    Basically what I want to do is call a subroutine only if the robot is in a certain position.


    IF $IN[1] AND "certain position" then

    Subroutine()

    ENDIF


    Can someone point me in the right direction ?


    Thanks

  • Well, I direct you to expert programming manual :smiling_face:


    Been a while since I worked on KRC2, so not sure why the option is greyed out if you are logged in as an expert at least. You can just ignore it and set it up programmatically.


    Creating a small workspace and using it's state in a condition is ok if you only want the location of the TCP (XYZ coordinates). If you want certain/similar position (XYZABC) then you will need to also check angles with axis angle or quaternion.


    It's not clear what it is you are trying to do, but if this position is on a path, then maybe just use a trigger?

  • I want to write an IF statement based on a robot position being true.

    Creating a small workspace and using it's state in a condition is ok if you only want the location of the TCP

    How do I do this ? What would the first line of the IF statement look like ?

  • If you have something like Workspace.Mode = #inside then in sps or some other non-robot thread you can run a procedure that does


    If Workspace.State and $in[ChDI_IncomingFire] and RunningThisForTheFirstTimeFlag then

    EngageDefProtocols()

    endif


    Just continuously check.

  • Thanks

    Well, I direct you to expert programming manual :smiling_face:


    Been a while since I worked on KRC2, so not sure why the option is greyed out if you are logged in as an expert at least. You can just ignore it and set it up programmatically.

    I read thru the expert programming manual, but I cannot see any reference on how to set it up programmatically as you suggested. Is the syntax similar to setting up a $BASE ?

  • Thanks

    I read thru the expert programming manual, but I cannot see any reference on how to set it up programmatically as you suggested. Is the syntax similar to setting up a $BASE ?

    Yeah, just instead of Frame it's of a type Box. All cartesian workspaces are already initialized in STEU/MADA/Custom.dat:


    $WORKSPACE[1]={X 0.0,Y 0.0,Z 0.0,A 0.0,B 0.0,C 0.0,X1 0.0,Y1 0.0,Z1 0.0,X2 0.0,Y2 0.0,Z2 0.0,MODE #OFF}

  • I guess none :grinning_squinting_face: You just find that $Workspace is a system variable and from there figure out where it's declared, what type it is and what it's consituent parts mean. If anyone tried to put everything there is to know about programming in KRL, it would be a lot bigger manual :smiling_face:

Advertising from our partners