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

KAREL programming FANUC

  • Kawazaki02
  • September 29, 2020 at 5:18 PM
  • Thread is Unresolved
  • Kawazaki02
    Reactions Received
    1
    Trophies
    2
    Posts
    20
    • October 13, 2020 at 10:31 PM
    • #21

    Hi guys. can you tell me which operator to use to get the value of the argument shown in the picture?

  • Nation
    Typical Robot Error
    Reactions Received
    552
    Trophies
    9
    Posts
    1,935
    • October 13, 2020 at 11:43 PM
    • #22

    GET_TPE_PRM is the command to parse passed in arguments from a TP call.

    Example of its use from some code of mine in my conversion thread:

    Code
    --Should be an int from 1-3.
    GET_TPE_PRM(1, data_type, int_value, real_value, str_value, STATUS)
    --Validate what was passed.
    IF (data_type=1) AND (STATUS=0) THEN
    --Argument is an int.
    IF (int_value<1) OR (int_value>3) THEN
    --Invalid argument 2, not in range.
    --Clear and home user screen.
    WRITE(CHR(128))
    WRITE(CHR(137))
    --Force the user screen.
    FORCE_SPMENU(TP_PANEL , SPI_TPUSER , 1)
    WRITE('Invalid Argument 1. Must be an integer.',CR)
    WRITE('Valid Arguments are: 1 to 3',CR)
    WRITE('Mode 1: Convert all to JPOS',CR)
    WRITE('Mode 2: Convert all to LPOS',CR)
    WRITE('Mode 3: Convert LPOS to JPOS',CR)
    WRITE('and JPOS to LPOS',CR)
    ABORT
    ENDIF
    --Argument 2 is ok.
    conv_type=int_value
    ELSE
    --Invalid argument 2, not an integer, or the GET_TPE_PRM failed.
    --Clear and home user screen.
    WRITE(CHR(128))
    WRITE(CHR(137))
    --Force the user screen.
    FORCE_SPMENU(TP_PANEL , SPI_TPUSER , 1)
    WRITE('Invalid Argument 1. Must be an integer.',CR)
    WRITE('Valid Arguments are: 1 to 3',CR)
    WRITE('Mode 1: Convert all to JPOS',CR)
    WRITE('Mode 2: Convert all to LPOS',CR)
    WRITE('Mode 3: Convert LPOS to JPOS',CR)
    WRITE('and JPOS to LPOS',CR)
    ABORT
    ENDIF
    Display More

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

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

  • Kawazaki02
    Reactions Received
    1
    Trophies
    2
    Posts
    20
    • October 14, 2020 at 4:36 PM
    • #23
    Quote from Nation

    GET_TPE_PRM is the command to parse passed in arguments from a TP call.

    Example of its use from some code of mine in my conversion thread:

    Thank you very much. everything worked out. really not without dancing with a tambourine :smiling_face:

  • Kawazaki02
    Reactions Received
    1
    Trophies
    2
    Posts
    20
    • October 14, 2020 at 4:50 PM
    • #24

    if anyone needs a program on this topic, keep it and use it. program on KAREL. is designed to shift points by specified coordinates by the value of the argument, the argument is taken from the program call. (if you have questions about the program, write here, I will try to answer).

    Thanks to everyone who helped figure it out.

    Code
    PROGRAM TEST_KAR_12
    
    %ENVIRONMENT REGOPE
    %NOLOCKGROUP
    %ALPHABETIZE
    %COMMENT = 'ALL_POS_ARG'
    %ENVIRONMENT TPE
    %ENVIRONMENT BYNAM
    %INCLUDE klevtpe
    
    CONST
        MAX_AXS = 9    
        
    VAR
        to_prog: STRING[30]
        open_id: INTEGER
        status: INTEGER
        indx_pos: INTEGER
        num_axs : INTEGER
        group_no: INTEGER
        posn_type: INTEGER
        org_xyz : XYZWPREXT
        new_xyz : XYZWPREXT
        num_pos : INTEGER
        r_val: REAL
        i_val: INTEGER
        r_flg :BOOLEAN
        pos_num: INTEGER
        
        param_no : INTEGER
        data_type : INTEGER
        int_value : INTEGER
        real_value : REAL
        sens_name   : STRING[40]
        
        
        
    BEGIN
        
        GET_TPE_PRM (1,2,int_value,real_value,sens_name,STATUS)
        
            to_prog = 'TEST_TP_1'
             
         OPEN_TPE (to_prog, TPE_RWACC, TPE_RDREJ, open_id, status)
             group_no = 1
             
         AVL_POS_NUM (open_id, pos_num, status)
                 num_pos = pos_num    
                 
         FOR indx_pos = 1 TO num_pos-1 DO    
             
        GET_POS_TYP (open_id, indx_pos, group_no, posn_type, num_axs, status)
            WRITE('get_pos_typ status', status,CR)
            
            SELECT posn_type OF    
                CASE (pt_rxyzwpr):
            
          org_xyz = GET_POS_TPE (open_id,  indx_pos, status)
                 new_xyz = org_xyz
                 new_xyz.x = org_xyz.x + int_value
                 new_xyz.y = org_xyz.y + 0
                new_xyz.z = org_xyz.z + 0
                new_xyz.w = org_xyz.w + 0
                new_xyz.p = org_xyz.p + 0
                new_xyz.r = org_xyz.r + 0
                new_xyz.ext1 = org_xyz.ext1 + 0
                new_xyz.ext2 = org_xyz.ext2 + 0
                new_xyz.ext3 = org_xyz.ext3 - int_value
                
        SET_EPOS_TPE (open_id, indx_pos, new_xyz, status)
        
            ENDSELECT
            
         ENDFOR
         
        CLOSE_TPE (open_id, status)
        
    END TEST_KAR_12
    Display More
  • sbertelli
    Trophies
    1
    Posts
    1
    • November 18, 2022 at 12:45 AM
    • #25

    hello were you able to solve the problem of moving the extended axes with karel or using a table with continuous rotation. ??

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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • 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
  • krc5
  • KRL
  • KUKA
  • motoman
  • Offset
  • PLC
  • PROFINET
  • Program
  • Programming
  • RAPID
  • roboguide
  • robot
  • robotstudio
  • RSI
  • safety
  • Siemens
  • simulation
  • SPEED
  • staubli
  • tcp
  • TCP/IP
  • teach pendant
  • vision
  • Welding
  • workvisual
  • yaskawa
  • YRC1000

Similar Threads

  • How do I know Karel is installed?

    • ashwinmudigonda
    • February 19, 2018 at 6:53 PM
    • Fanuc Robot Forum
  • Dynamic control of FANUC Robot in Run-Time

    • Gokul N A
    • July 3, 2019 at 10:39 AM
    • Fanuc Robot Forum
  • Fanuc Code Verses Epson or ABB

    • AwfulAutomation
    • July 15, 2019 at 12:49 PM
    • General Discussion of Industrial Robots Only
  • Utility of KAREL Programming?

    • StoopidEngineer
    • April 22, 2019 at 11:10 PM
    • Fanuc Robot Forum
  • Converting a p-code in Karel function

    • emanuel_eng
    • October 9, 2017 at 8:48 PM
    • Fanuc Robot Forum
  • Fanuc Virtual Environment

    • NPG92
    • March 16, 2018 at 8:43 PM
    • Fanuc Robot Forum
  • ABB RAPID Veteran, a few question about FANUC KAREL

    • Elok
    • February 27, 2018 at 7:49 PM
    • Fanuc Robot Forum
  • Karel Program for RJ2 controller

    • demionkrishan
    • November 14, 2017 at 3:11 PM
    • Fanuc Robot Forum
  • Karel Translator Directives

    • bencor21
    • August 24, 2017 at 2:35 PM
    • Fanuc Robot Forum
  • HELP WITH FANUC R2000ib 165 F

    • Fran94
    • February 10, 2017 at 8:39 PM
    • Fanuc Robot Forum

Tags

  • Fanuc
  • karel

Users Viewing This Thread

  • 1 Guest
  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