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

Using IF with Position Register

  • Cleber Mori
  • June 5, 2023 at 2:48 AM
  • Thread is Unresolved
  • Cleber Mori
    Trophies
    1
    Posts
    4
    • June 5, 2023 at 2:48 AM
    • #1

    Hi.I would like to set a maximum range for the values of X, Y, Z, W, P, R.


    Something like:

    IF PR[5,1]>155 AND <175 , JMP LBL(22)

    ! WRONG VALUE

    UALM[2]

    LBL[22]


    IF doesn't work with Position Register.

    How could i do that?

  • panic mode June 5, 2023 at 4:41 AM

    Approved the thread.
  • hermann
    Reactions Received
    406
    Trophies
    9
    Posts
    2,607
    • June 5, 2023 at 5:46 AM
    • #2
    Code
    IF ((PR[5,1]>155) AND (PR[5,1] <175)) , JMP LBL(22)
  • kluk-kluk
    Reactions Received
    51
    Trophies
    5
    Posts
    300
    • June 5, 2023 at 10:36 AM
    • #3

    You are missing a part.

    IF PR[5,1]>155 AND PR[5,1]<175 , JMP LBL(22)

    This wont work with RJ and earlier.

    (the mixed logic solution of Hermann will work fine too.)

  • R47
    Reactions Received
    11
    Trophies
    3
    Posts
    110
    • June 5, 2023 at 1:18 PM
    • #4

    And don't forget to change the lines UALM[2] and LBL[22].

  • Sergei Troizky
    Reactions Received
    69
    Trophies
    6
    Posts
    651
    • June 5, 2023 at 6:37 PM
    • #5

    The correct syntax with no redundant brackets is:

    IF (PR[5,1]>155 AND PR[5,1]<175),JMP LBL[22]

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

  • Cleber Mori
    Trophies
    1
    Posts
    4
    • June 5, 2023 at 9:50 PM
    • #6

    The command "IF" doesn't work with Position Register.

    The problem is not the syntax.

    This:

    IF PR[5,1]>155 AND <175 , JMP LBL(22)

    is just an example of the logic I would like to use, but I don't have the option to use IF with PR.

    This:
    IF ((PR[5,1]>155) AND (PR[5,1] <175)) , JMP LBL(22)

    Or this:

    IF (PR[5,1]>155 AND PR[5,1]<175),JMP LBL(22)

    are not options because I don't have the option to use IF with PRs.

    Thank you for your attention and answers, but my question is precisely whether there is a way to use IF with PR. Or another similar command for Fanuc robots (R30iB)




  • Sergei Troizky
    Reactions Received
    69
    Trophies
    6
    Posts
    651
    • June 5, 2023 at 10:16 PM
    • #7

    " I don't have the option to use IF with PRs."

    What makes you think so? This ability is not an option.

    The syntax provided works on R30iA and R30iB.

    Are you editing on the robot teach pendant or in PC text editor?

    What are your regional settings for decimal separator? Is it . or , ?

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

  • Nation
    Typical Robot Error
    Reactions Received
    537
    Trophies
    9
    Posts
    1,917
    • June 5, 2023 at 10:22 PM
    • #8

    Are you trying to do this on a non motion program (No groups assigned)? Or on a paint robot?

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

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

  • hermann
    Reactions Received
    406
    Trophies
    9
    Posts
    2,607
    • June 6, 2023 at 5:12 AM
    • #9

    1. What system version do you have?

    2. Solution is to copy the PR[5,1] to a R[] and use that for comparison.

  • Cleber Mori
    Trophies
    1
    Posts
    4
    • June 6, 2023 at 10:31 PM
    • #10

    Hermann's answer would be a solution. Thank you Hermann. But the problem is that I will need many Registers and I have few available. For each PR would need 6 registers (x, y, z, w, p, r).

    Is there another way to do this?view?usp=drive_link

  • Cleber Mori
    Trophies
    1
    Posts
    4
    • June 6, 2023 at 11:32 PM
    • #11

    Sergei:

    Robot M20iB/25, HandlingPRO, R30iB
    Editing in ROBOGUIDE from a robot backup.
    Decimal separator is "."

    Nation: Is a motion program.

  • Sergei Troizky
    Reactions Received
    69
    Trophies
    6
    Posts
    651
    • June 7, 2023 at 2:51 AM
    • #12

    IF instructions with no brackets do not support position registers.

    Use IF(...) instruction.

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

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

Similar Threads

  • it's simple program with Karel to move a fanuc robot 2000iA avec un contrôleur RJ3iB.

    • joH
    • March 21, 2023 at 1:06 PM
    • Fanuc Robot Forum
  • Fanuc 30iB controller locks up

    • kdkoadd
    • January 3, 2023 at 12:39 PM
    • Fanuc Robot Forum
  • Interference Zone of Elite Collaborate Robot

    • EliCobot
    • May 23, 2022 at 7:58 PM
    • other Cobots
  • position register editing using touch up

    • Eric Pego
    • October 21, 2021 at 8:41 PM
    • Fanuc Robot Forum
  • Reference position/position register

    • Jerryl859
    • January 18, 2021 at 1:06 AM
    • Fanuc Robot Forum
  • HELP

    • Kawazaki02
    • January 6, 2021 at 2:58 PM
    • Fanuc Robot Forum
  • Read name of PR given in PR Data list?

    • TomFoolious
    • December 9, 2020 at 12:52 PM
    • Fanuc Robot Forum
  • Homing filosophy with Fanuc

    • PetrBroza
    • November 25, 2020 at 10:00 AM
    • Fanuc Robot Forum
  • iRvision precision

    • Jesper
    • May 20, 2019 at 8:24 PM
    • Fanuc Robot Forum

Tags

  • IF
  • Position Register
  • range

Users Viewing This Thread

  • 3 Guests
  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