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

Determining if there is an argument present in TP

  • Nation
  • January 6, 2013 at 4:38 PM
  • Thread is Resolved
  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • January 6, 2013 at 4:38 PM
    • #1

    Does anyone know if there is a way to programmatically test for the existence of an argument?

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

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

  • robodog
    Trophies
    3
    Posts
    13
    • January 6, 2013 at 4:58 PM
    • #2

    Not really sure what your asking. :hmmm:

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • January 6, 2013 at 5:18 PM
    • #3

    Say I call a program as follows:

    Code
    CALL SUBCALL(1) ;

    and inside of SUBCALL I have:

    Code
    IF AR[1]=1, JMP LBL[100] ;
    !Do stuff...
    END ;
    LBL[100] ;
    !Do other stuff...
    END ;

    It will run fine.

    But if I call the SUBCALL program without any arguments, like so:

    Code
    CALL SUBTEST ;

    It will fault on the if statement with an INTP-288 error. (Parameter does not exist)

    Code
    IF AR[1]=1, JMP LBL[100] ; <--INTP-288 FAULT
    !Do stuff...
    END ;
    LBL[100] ;
    !Do other stuff...
    END ;

    I want to know if there is anyway to test for the existence of an argument passed to the SUBCALL program.

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

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

  • easyrobot
    Trophies
    3
    Posts
    27
    • January 7, 2013 at 2:19 AM
    • #4

    As far as I know there is not a way to check for the existence of a parameter in a TP program.
    But you can do it using Karel.
    You can use this instruction ( Syntax : GET_TPE_PRM(param_no, data_type, int_value, real_value, str_value, status)
    To determine if the parameter exist and paste the result on a flag or register and check for that on your TP program.
    You need to have the Karel option loaded in your controller in order to be download any Karel program.
    Also you need to have the olpc-pro to compile the file on you pc.
    I would like to know if there is another way more simple.

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • January 7, 2013 at 1:52 PM
    • #5

    Unfortunately, the job I am working on, the customer did not buy any options whatsoever. So no karel for me. Also, you no longer get a free pass on karel for the R30-iB.

    Its starting to sound like that there isn't a way to do it. I really wish I could do something like this:

    Code
    IF AR[1]<>EXIST, JMP LBL[10] ;
    IF AR[1]=1, JMP LBL[100] ;
    LBL[10] ;
    !Do default stuff...
    END ;
    LBL[100] ;
    !Do other special stuff...
    END ;

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

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

  • robodog
    Trophies
    3
    Posts
    13
    • January 7, 2013 at 2:21 PM
    • #6

    Still not sure I understand what your wanting to do. where you have CALL SUBTEST you need to have a variable for the argument, CALL SUBTEST(1), thats why you are getting that alarm.

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • January 7, 2013 at 7:03 PM
    • #7

    I want that variable to be optional. Similar to how the Present() function works in ABBs.

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

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

  • easyrobot
    Trophies
    3
    Posts
    27
    • January 8, 2013 at 3:45 AM
    • #8

    Well, if Karel is not an option,
    Then you will need to have that argument in all your calls. Probably use a negative value when the argument shouldn't exist.

    IF AR[1]<>-1, JMP LBL[10] ;
    IF AR[1]=1, JMP LBL[100] ;
    LBL[10] ;
    !Do default stuff...
    END ;
    LBL[100] ;
    !Do other special stuff...
    END ;

    Yeap! I can't think on something different. I know... It is too bad and I guess Fanuc guys believe that programmers don't need that option using TP programs... As I said in Karel it is possible.

  • robodog
    Trophies
    3
    Posts
    13
    • January 8, 2013 at 3:20 PM
    • #9
    Quote from easyrobot


    Well, if Karel is not an option,
    Then you will need to have that argument in all your calls. Probably use a negative value when the argument shouldn't exist.

    IF AR[1]<>-1, JMP LBL[10] ;
    IF AR[1]=1, JMP LBL[100] ;
    LBL[10] ;
    !Do default stuff...
    END ;
    LBL[100] ;
    !Do other special stuff...
    END ;

    Yeap! I can't think on something different. I know... It is too bad and I guess Fanuc guys believe that programmers don't need that option using TP programs... As I said in Karel it is possible.

    Display More


    I was thinking of something like this too.

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • January 10, 2013 at 2:56 PM
    • #10

    I decided to go with a register as the solution.

    The call:

    Code
    89:  !Advance the slide for gripper 1 ;
      90:  !and ignore switch. ;
      91:  R[192:Enb Quick Exit]=1    ;
      92:  CALL G1ADVANCE    ;

    How I use it:

    Code
    /PROG  G1ADVANCE	  Macro
    /ATTR
    COMMENT		= "G1 Advance Slide";
    /MN
       1:  JMP LBL[1] ;
       2:  !******************************** ;
       6:  ! ;
       7:  !Program Name: G1ADVANCE ;
       8:  ! ;
       9:  !Program description: ;
      10:  !Advances the slide for gripper 1 ;
      11:  ! ;
      12:  !Revision History: ;
      13:  !v1.0 - 11/7/12 ;
      14:  !v1.1 - 1/6/13 ;
      15:  ! ;
      16:  !Revision Description: ;
      17:  !v1.0 - Initial release ;
      18:  !v1.1 - Added Quick Exit logic ;
      19:  ! ;
      20:  !******************************** ;
      21:  LBL[1:Begin] ;
      22:   ;
      23:  DO[482:Return Gripper1]=OFF ;
      24:  DO[481:Advance Gripper1]=ON ;
      25:   ;
      26:  !Exit early if told to do so. ;
      27:  IF R[192:Enb Quick Exit]<>0,JMP LBL[32766] ;
      28:   ;
      29:  !Wait for slide advanced input ;
      30:  $WAITTMOUT=200 ;
      31:  WAIT DI[481:Gripper1 Advanced]=ON TIMEOUT,LBL[9001] ;
      32:   ;
      33:  !Make sure return switch is off. ;
      34:  IF DI[482:Gripper1 Returned]=ON,JMP LBL[9005] ;
      35:   ;
      36:  !Gripper slide advanced. ;
      37:  END ;
      38:   ;
      39:   ;
      40:  !******************************** ;
      41:  !Fault area ;
      42:  !******************************** ;
      43:   ;
      44:  !The slide failed to advance. ;
      45:  LBL[9001:Advance Err] ;
      46:  CALL FAULT(1) ;
      47:  JMP LBL[9999] ;
      48:   ;
      49:  !Both switches on. ;
      50:  LBL[9005:Bth swtch on Err] ;
      51:  CALL FAULT(5) ;
      52:  JMP LBL[9999] ;
      53:   ;
      54:  !Go Home and abort. ;
      55:  LBL[9999:Recovery] ;
      56:  DO[481:Advance Gripper1]=OFF ;
      57:  DO[482:Return Gripper1]=ON ;
      58:  WAIT    .50(sec) ;
      59:  CALL RECOVERY    ;
      60:  CALL ABORTIT    ;
      61:  LBL[32766:End of program] ;
      62:  R[192:Enb Quick Exit]=0    ;
    /POS
    /END
    Display More

    Maybe sometime in the future we will get this functionality. Seeing as how it took until about 2007 for Fanuc to implement program names longer than 8 characters, I bet we should have something like what I want around 2025 or so.

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

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

  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • August 2, 2021 at 6:45 PM
    • #11
    Quote from Nation

    Maybe sometime in the future we will get this functionality. Seeing as how it took until about 2007 for Fanuc to implement program names longer than 8 characters, I bet we should have something like what I want around 2025 or so.

    Darn, I guess I'm still 4 years too early looking for this same functionality...

  • zet-jaro
    Reactions Received
    3
    Trophies
    3
    Posts
    28
    • February 28, 2022 at 5:52 PM
    • #12
    Quote from EnergyAddict

    Darn, I guess I'm still 4 years too early looking for this same functionality...

    only 3 more years! :grinning_squinting_face:

  • bellm
    Reactions Received
    2
    Trophies
    3
    Posts
    45
    • July 11, 2023 at 4:48 PM
    • #13

    One more year hopefully. lol

  • zet-jaro
    Reactions Received
    3
    Trophies
    3
    Posts
    28
    • July 12, 2023 at 1:29 PM
    • #14

    :fingerscrossed: ! :grinning_squinting_face:

  • leidai5
    Trophies
    3
    Posts
    44
    • August 1, 2023 at 4:56 PM
    • #15

    This would be really helpful right about now...c'mon FANUC anytime now...

  • KineFi
    Trophies
    3
    Posts
    3
    • April 24, 2024 at 7:36 AM
    • #16

    Still waiting...

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,934
    • April 24, 2024 at 2:22 PM
    • #17

    Given the R50iA comes out next year, and it supports python snippets, I might be correct!

    It will be interesting to find out.

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

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

  • KineFi
    Trophies
    3
    Posts
    3
    • April 25, 2024 at 6:32 AM
    • #18

    That sounds really ground breaking for Fanuc ecosystem.

  • cattmampbell
    Reactions Received
    4
    Trophies
    1
    Posts
    17
    • April 25, 2024 at 6:24 PM
    • #19
    Quote from Nation

    Given the R50iA comes out next year, and it supports python snippets, I might be correct!

    It will be interesting to find out.

    Nation, I had no idea about this until I saw your comment. Besides being about to use Python, it looks like the R-50iA also has "Integration with Visual Studio Code". Do you know any specifics, or have any idea as to what FANUC means when they say that the R-50iA has "Integration with Visual Studio Code"? Very curious about that. 🤔

  • DS186
    Reactions Received
    200
    Trophies
    6
    Posts
    1,075
    • April 25, 2024 at 6:52 PM
    • #20

    Check the below link for some official information about the capabilities of the new R-50iA controller.

    ROBOT New product: Robot Controller R-50iA - New Product - Products - FANUC CORPORATION

    According to my sales rep, the official product release is planned for October 2024 (at least in Europe/Germany). I have also asked for some detailed information but so far I didn't receive more details.

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