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

Passing Arguments From TP to Karel

  • Braxtonc001
  • November 19, 2019 at 9:11 PM
  • Thread is Unresolved
  • Braxtonc001
    Trophies
    3
    Posts
    25
    • November 19, 2019 at 9:11 PM
    • #1

    Does anyone know how Passing an argument from the teach pendent programming to a .PC program.... on the Karel side? for example do you do the following:

    PROGRAM FRM_OVD_XMPL(Dynframe:INTEGER;Pos1:POSITION;POS2:POSITION;Pos3:POSITION)

    Begin

    Whats even more cool. is Fanuc has a way of setting names for arguments. in the teachpendant. For example when i call the program on the tp for a 3d program...

    1: CALL FIRE_PROJECTOR (projector name= ,)

  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 19, 2019 at 10:12 PM
    • #2

    You have to check for TP arguments in the Karel program.

    Code
    GET_TPE_PRM(1, data_type, int_value, real_value, str_value, STATUS)

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

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

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • November 19, 2019 at 10:16 PM
    • #3

    DUUUDDDEEEE!!!!!!!!!!!!!!!!!!!!!!!!! i was legit just turned to that page in the Old Karel Manual.

    Any Idea how they set the name of an argument? in .TP?



    1: CALL FIRE_PROJECTOR (projector name= ,)

  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 20, 2019 at 5:56 AM
    • #4

    You have to create a file named argdispeg01.dt, load it, and reboot the robot.

    Here is what the contents of the file looks like on a job I did:

    Code
    [PROGRAM]
    NAME = "SAFE_PERCH"
    ARGUMENT = '2'
    [ARGUMENT]
    N01 = "J1":'0'
    N02 = "J6":'0'
    [ENDPROGRAM]
    [PROGRAM]
    NAME = "DRAWER_DATA_SEARCH"
    ARGUMENT = '2'
    [ARGUMENT]
    V01 = "LH":'1', "RH":'2'
    V02 = "Empty":'0', "Raw":'1', "Finished":'2'
    [ENDPROGRAM]
    Display More

    The handlingtool manual goes over it pretty well.

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

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

  • dha
    Reactions Received
    28
    Trophies
    6
    Posts
    397
    • November 20, 2019 at 8:06 AM
    • #5

    Just what I was looking for few days ago. But I was looking in KAREL manual as I tought this was KAREL function ...

    Thanks

    Quote from Nation

    You have to create a file named argdispeg01.dt, load it, and reboot the robot.

    Here is what the contents of the file looks like on a job I did:

    Code
    [PROGRAM]
    NAME = "SAFE_PERCH"
    ARGUMENT = '2'
    [ARGUMENT]
    N01 = "J1":'0'
    N02 = "J6":'0'
    [ENDPROGRAM]
    [PROGRAM]
    NAME = "DRAWER_DATA_SEARCH"
    ARGUMENT = '2'
    [ARGUMENT]
    V01 = "LH":'1', "RH":'2'
    V02 = "Empty":'0', "Raw":'1', "Finished":'2'
    [ENDPROGRAM]
    Display More

    The handlingtool manual goes over it pretty well.

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • November 20, 2019 at 3:09 PM
    • #6

    Nation,

    Youre right the handling manual does describe the Naming convetions for arguements prettty well. So i will have no problems in the future with that.

    Whats weird is the examples I use via the Karel program do not work. Having all kinds of issues just to pull a integer.

    My errors with logic im trying to use

    C:\uf_override.kl(22)

    22 GET_TPE_PRM(1, data_type, int_value, status)

    ^ ERROR

    ROUTINE called has less arguments than ROUTINE definition. Routine: GET_TPE_PRM

    C:\uf_override.kl(26)

    26 IF Data_type <> PARM_INTEGER THEN -- make sure parameter is an integer

    ^ ERROR


    Example in the manual. Which only shows half of what needs done. see attached. Is this a common thing in Karel? They only show you half the solution?

    Images

    • Capture.PNG
      • 221.79 kB
      • 1,125 × 846
      • 140
  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 20, 2019 at 4:13 PM
    • #7
    Quote from Braxtonc001

    22 GET_TPE_PRM(1, data_type, int_value, status)

    ^ ERROR

    ROUTINE called has less arguments than ROUTINE definition. Routine: GET_TPE_PRM

    You have to use the amount of arguments defined for that routine. None of them are optional. Doesn't matter if you don't use them later, they still need to be populated.

    Quote from Braxtonc001

    C:\uf_override.kl(26)

    26 IF Data_type <> PARM_INTEGER THEN -- make sure parameter is an integer

    ^ ERROR

    PARM_INTEGER was probably a constant defined earlier in the program. I don't think it is a global constant. That, or it was imported. Check the top of the example program.

    My Karel joint conversion program uses GET_TPE_PRM quite a bit. Check it out here.

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

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

  • TitusLepic
    Reactions Received
    112
    Trophies
    6
    Posts
    442
    • November 20, 2019 at 4:19 PM
    • #8

    GET_TPE_PRM requires 6 arguments. You're trying to call it with 4. Therefore the error "ROUTINE called has less arguments than ROUTINE definition"

    GET_TPE_PRM(param_no, data_type, int_value, real_value, str_value, STATUS) - all arguments are required. If the parameter is INT, int_value will be the value of the parameter. If it's a real, real_value; string, str_value. Data_type tells you what type of parameter is being passed from the TP program.

  • scotty
    Reactions Received
    43
    Trophies
    5
    Posts
    497
    • November 20, 2019 at 4:28 PM
    • #9

    is it solved or still need help?

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • November 20, 2019 at 4:49 PM
    • #10

    I guess I can say that I understand what the compiler is recommending the issue is. It conflicts with what I am trying to understand in the Karel manual.

    So help me help my understanding of this language. I'm new to it.

    1.with any "built in procedure" all in/out have to be populated? For example 'GET_TPE_PRM(x,x,x,x,x,x)'.....

    2.also depending on the Data type of the TP argument only one of the variables will be populated,even though all 3 are shown, int_value, Real_value, or str_value?

    Nation,

    Your program helped a lot thanks. im learning quickly just started karel yesterday.

    everyone,

    the manual program example didn't set any variables or anything and shows the built in procedure wrong. Guess I will just have to accept this and learn that the manual isn't entirely right.

  • Nation
    Typical Robot Error
    Reactions Received
    529
    Trophies
    9
    Posts
    1,910
    • November 20, 2019 at 4:58 PM
    • #11
    Quote from Braxtonc001

    1.with any "built in procedure" all in/out have to be populated? For example 'GET_TPE_PRM(x,x,x,x,x,x)'.....

    Correct. I'm not sure if Karel even supports optional arguments. Would be something to look into, but in this case, none are optional.

    Quote from Braxtonc001

    2.also depending on the Data type of the TP argument only one of the variables will be populated,even though all 3 are shown, int_value, Real_value, or str_value?

    Also correct. The others are there in case the user passes in a real or a string. Like Titus said, data_type will tell you what came in, then you use that to know which var to look at. Pretty clunky, but that is Karel in general.

    Quote from Braxtonc001

    Guess I will just have to accept this and learn that the manual isn't entirely right.

    Haha, welcome to the world of Karel.

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

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

  • TitusLepic
    Reactions Received
    112
    Trophies
    6
    Posts
    442
    • November 20, 2019 at 5:04 PM
    • #12

    1&2 - correct on both

    The program in the manual is just a snippet. You're right that they don't show where they declared their variables, but I'm not seeing how the built-in is wrong?

  • Braxtonc001
    Trophies
    3
    Posts
    25
    • November 20, 2019 at 5:08 PM
    • #13
    Quote from TitusLepic

    1&2 - correct on both

    The program in the manual is just a snippet. You're right that they don't show where they declared their variables, but I'm not seeing how the built-in is wrong?

    You are right, I as wrong. The Built-in is correct. must be that damn dyslexia or something....


    THANKS EVERYONE!!!!!!!!!!!!!!!!

  • TitusLepic
    Reactions Received
    112
    Trophies
    6
    Posts
    442
    • November 20, 2019 at 5:19 PM
    • #14

    <argument> denotes an optional argument

    {argument} denotes an optional repeatable argument

    Everything else is required

    Good luck learning Karel, I'm pretty new to it myself - once you get the hang of its weird idiosyncrasies it's not too bad.

  • penguinMan
    Trophies
    3
    Posts
    21
    • June 21, 2022 at 3:53 PM
    • #15

    Were you guys able to find out how to show the desciption of the arguments when calling the program from TP?

    i have it so when i call the program i have to manually add the arguments but their is no desciption as to what they are:

    PROGRAM Outputs_Ctrl

    %ALPHABETIZE

    %CMOSVARS

    %COMMENT ='Outputs Control'

    VAR

    Status, loop, StartOutput, EndOutput, OutputReq :INTEGER


    ------------------------------------------------------------------------

    ROUTINE GetArgumentValue

    VAR str_value:STRING[1]

    Real_Val:REAL

    BEGIN

    -- Read the arguments sent

    GET_TPE_PRM(1,1,StartOutput,Real_Val,'gripper',status)

    GET_TPE_PRM(2,1,EndOutput,Real_Val,str_value,status)

    GET_TPE_PRM(3,1,OutputReq,Real_Val,str_value,status)

    END GetArgumentValue

    ------------------------------------------------------------------------

    BEGIN -- Main Program

    GetArgumentValue

    IF OutputReq =1 THEN

    FOR loop = StartOutput TO EndOutput DO

    DOUT[loop] = ON

    ENDFOR

    ELSE

    FOR loop = StartOutput TO EndOutput DO

    DOUT[loop] = OFF

    ENDFOR

    ENDIF

    END Outputs_Ctrl

    pasted-from-clipboard.png

  • R47
    Reactions Received
    11
    Trophies
    3
    Posts
    109
    • June 21, 2022 at 4:21 PM
    • #16

    Hi penguinMan,

    you can set up the ArgdispEgXX.file ... i think that will help you out

    [PROGRAM]

    NAME = "OUTPUTS_CNTR"

    ARGUMENT = '3'

    [ARGUMENT]

    N01 = "Start Output"

    N02 = "End Output"

    V03 = "ON":'1', "OFF":'0'

    [ENDPROGRAM]

    Edited once, last by R47: [PROGRAM] NAME = "OUTPUTS_CNTR" ARGUMENT = '3' [ARGUMENT] N01 = "Start Output" N02 = "End Output" V03 = "ON":'1', "OFF":'0' [ENDPROGRAM] (June 21, 2022 at 4:26 PM).

  • penguinMan
    Trophies
    3
    Posts
    21
    • June 21, 2022 at 5:37 PM
    • #17

    Do you know where i can find some documentation on the argdispeg file? i tried searching it through the handling tool and karel manuals but cannot seem to find anything on it

  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • June 21, 2022 at 10:05 PM
    • #18
    Quote from penguinMan

    Do you know where i can find some documentation on the argdispeg file? i tried searching it through the handling tool and karel manuals but cannot seem to find anything on it

    Handling Tool Manual. Section Titled "Wizard to Input Arguments"

    In my Rev C its section 7.9.5

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

Tags

  • karel
  • Programs
  • TP programming
  • arguments
  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