1. Home
    1. Dashboard
    2. Search
  2. Forum
    1. Unresolved Threads
    2. Members
      1. Recent Activities
      2. Users Online
      3. Team Members
      4. Search Members
      5. Trophys
  3. Articles
  4. Blog
  5. Videos
  6. Jobs
  7. Shop
    1. Orders
  • Login or register
  • Search
This Thread
  • Everywhere
  • This Thread
  • This Forum
  • Articles
  • Pages
  • Forum
  • Blog Articles
  • Products
  • More Options
  1. Robotforum - Support and discussion community for industrial robots and cobots
  2. Forum
  3. Industrial Robot Support and Discussion Center
  4. Fanuc Robot Forum
Your browser does not support videos RoboDK Software for simulation and programming
Visit our Mainsponsor
IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Sponsored Ads

Reading a user frame into register

  • Sergei Troizky
  • October 16, 2013 at 11:58 PM
  • Thread is Resolved
  • Sergei Troizky
    Reactions Received
    70
    Trophies
    6
    Posts
    658
    • October 16, 2013 at 11:58 PM
    • #1

    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.

    Do it well right away. It will become bad by itself.

  • Nation
    Typical Robot Error
    Reactions Received
    547
    Trophies
    9
    Posts
    1,925
    • October 17, 2013 at 3:56 AM
    • #2

    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!

  • scotty
    Reactions Received
    43
    Trophies
    5
    Posts
    497
    • October 17, 2013 at 8:13 AM
    • #3
    Code
    PROGRAM a1
    
    
    %COMMENT = 'cool job'
    %ENVIRONMENT REGOPE
    %ENVIRONMENT SYSDEF
    %ENVIRONMENT KCLOP
    
    
    VAR
    xyz	: XYZWPR
    STATUS	: INTEGER
    BEGIN
    
    
    xyz = $MNUFRAME[1,1]
    SET_POS_REG(1,xyz, STATUS)
    
    
    END a1
    Display More
  • Sergei Troizky
    Reactions Received
    70
    Trophies
    6
    Posts
    658
    • October 17, 2013 at 2:39 PM
    • #4

    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?

    Do it well right away. It will become bad by itself.

  • Nation
    Typical Robot Error
    Reactions Received
    547
    Trophies
    9
    Posts
    1,925
    • October 18, 2013 at 2:31 AM
    • #5
    Quote from Sergei Troizky


    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!

  • scotty
    Reactions Received
    43
    Trophies
    5
    Posts
    497
    • October 23, 2013 at 8:54 AM
    • #6

    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^)

  • Sergei Troizky
    Reactions Received
    70
    Trophies
    6
    Posts
    658
    • October 23, 2013 at 2:39 PM
    • #7

    Karel is out of question. Our policy is to stay with TP format.
    I do want to do this in BG, where I cannot refer PR[n], only PR[n,c].
    All this being said, can you explain how a macro can help?

    Do it well right away. It will become bad by itself.

  • scotty
    Reactions Received
    43
    Trophies
    5
    Posts
    497
    • October 23, 2013 at 3:08 PM
    • #8

    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 (October 23, 2013 at 3:12 PM).

  • freemanleon
    Trophies
    3
    Posts
    21
    • November 7, 2013 at 6:17 AM
    • #9

    Even though I will do this in some easy way, scotty's Karel is still much more insteresting.

  • scotty
    Reactions Received
    43
    Trophies
    5
    Posts
    497
    • November 7, 2013 at 7:26 AM
    • #10

    thx

  • Andres Romero Romero
    Trophies
    2
    Posts
    2
    • March 5, 2022 at 8:02 PM
    • #11
    Quote from Nation

    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...

  • Andres Romero Romero
    Trophies
    2
    Posts
    2
    • March 5, 2022 at 8:04 PM
    • #12

    Just to say thank you. The PR_CARTREP was like a kind of tricky. Thank you so much, very useful

Advertising from our partners

IRBCAM
Robotics Channel
Robotics Training
Advertise in robotics
Advertise in Robotics
Advertise in Robotics

Job Postings

  • Anyware Robotics is hiring!

    yzhou377 February 23, 2025 at 4:54 AM
  • How to see your Job Posting (search or recruit) here in Robot-Forum.com

    Werner Hampel November 18, 2021 at 3:44 PM
Your browser does not support videos RoboDK Software for simulation and programming

Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Thread Tag Cloud

  • abb
  • Backup
  • calibration
  • Communication
  • CRX
  • DCS
  • dx100
  • dx200
  • error
  • Ethernet
  • Ethernet IP
  • external axis
  • Fanuc
  • help
  • hmi
  • I/O
  • irc5
  • IRVIsion
  • karel
  • kawasaki
  • KRC2
  • KRC4
  • KRC 4
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • robodk
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000
  1. Privacy Policy
  2. Legal Notice
Powered by WoltLab Suite™
As a registered Member:
* You will see no Google advertising
* You can translate posts into your local language
* You can ask questions or help the community with your knowledge
* You can thank the authors for their help
* You can receive notifications of replies or new topics on request
* We do not sell your data - we promise

JOIN OUR GREAT ROBOTICS COMMUNITY.
Don’t have an account yet? Register yourself now and be a part of our community!
Register Yourself Lost Password
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on Google Play
Robotforum - Support and discussion community for industrial robots and cobots in the WSC-Connect App on the App Store
Download