Reading a user frame into register

  • I need to read a component of a user frame into a register, on R-30iB.


    I tried PR[x]=UFRAME[n], but this results in strange content of the position register,
    something like NX=1mm, NY=0mm, NZ=0mm, OX=0mm, OY=1mm, OZ=0mm,
    which has nothing with the user frame values.


    I tried then to read the component of the $MNUFRAME system variable directly,
    but could not discover the proper syntax for the parameter name.


    Would greatly appreciate any help on both issues.

  • What you are seeing in the PR is the first 6 components of a rotation matrix. If you hit the page key (F2 I think) when viewing it you will see the remaining 6 components.


    Turn $PR_CARTREP to True in the system variables. This will make the PR in a PR[XX]=UFRAME[X] command show up in normal Cartesian representation and not in matrix representation.


    Of course this very useful system variable isn't documented...

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • Thank you, Nation, it worked.


    I also would like to directly read a user frame component into a register.
    This will be done in TP format BG logic, so reading to position register cannot be used.
    What would be the syntax for this? Say, I need Z of Uframe 1.
    R[1]=($MNUFRAME[1,1]???). How to refer the Z component?


  • I too would really like to know how this is done, assuming it is even possible. I even had a thread here, but no one was able to give me an answer.

    Check out the Fanuc position converter I wrote here! Now open source!

    Check out my example Fanuc Ethernet/IP Explicit Messaging program here!

  • Why u not want to use Karel, Macro, BG. Their bunch can help to solve a problem. In BG u put flag ON. When this flag is put ON then macro is called. In macro u called Karel program when u got in numeric register Z component of UFRAME. And in ends of karel program u put flag off. In BG u saw when flag is OFF then u take from register needed data.
    If u think that is bad idea pls say^)

  • I think u can without Karel do it. Two choise:
    1. If u TeachPendant is off:
    Write BG to put flag for macros. In macros write PR[n] = UFRAME[m]; R[y] = PR[n,j] just like this. And in end of macros back macro flag to OFF.
    2. If u TeachPendant is on:
    its choise is difficult. But We can in run start TP program to read flag from BG and back datas of UFRAME in numeric register and say that to BG. because I not find how can to start the macro when TP is on^(

    Edited once, last by scotty ().

  • What you are seeing in the PR is the first 6 components of a rotation matrix. If you hit the page key (F2 I think) when viewing it you will see the remaining 6 components.


    Turn $PR_CARTREP to True in the system variables. This will make the PR in a PR[XX]=UFRAME[X] command show up in normal Cartesian representation and not in matrix representation.


    Of course this very useful system variable isn't documented...

Advertising from our partners