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

Assigning value to a KAREL variable in TP program

  • coffeeBean
  • February 7, 2024 at 9:41 AM
  • Thread is Unresolved
  • coffeeBean
    Reactions Received
    4
    Posts
    18
    • February 7, 2024 at 9:41 AM
    • #1

    Hello,

    I am wondering if this is possible and I'm just doing something wrong, or if I'm trying to achieve the unachievable :smiling_face:

    I couldn't find an exact example on this in the manual, but I want to assign a value to a KAREL variable in my TP program, fx:

    Code
    $[PROGRAM]VAR=R[10001] ;

    However, when I try to run it, I get "Parameter not found" error. I'm puzzled by this, since both $[PROGRAM]VAR and R[10001] have been used earlier in the program. I've also used the current value of the $[PROGRAM]VAR to assign it to a different register, and that works fine:

    Code
    R[10002]=$[PROGRAM]VAR ;

    Can this be done and something is missing in the syntax?

    Thank you in advance.

  • Online
    hoitzing
    Reactions Received
    24
    Trophies
    1
    Posts
    128
    • February 7, 2024 at 12:37 PM
    • #2

    It works for me, using the actual registers and not local registers. Have you checked when trying to assign from a (non-local) register or from a constant value?

  • coffeeBean
    Reactions Received
    4
    Posts
    18
    • February 7, 2024 at 1:05 PM
    • #3

    Thanks for the reply!

    Quote from hoitzing

    Have you checked when trying to assign from a (non-local) register or from a constant value?

    I have not tried with either, since my goal is to use the value stored in local registers and avoid writing to actual registers :frowning_face: Perhaps there is a limitation to this operation that prevents it from working when using local registers?

    The workaround I ended up doing was create a KAREL program that would be called from the TP program with two arguments - an integer which is used to distinguish which KAREL variable to change and a value to be applied. Since there were a couple of KAREL variables I wanted to apply this operation to, I use the first argument in an IF statement to determine which one is to be changed.

    At least for now it seems like moving this operation to a KAREL program and calling it from the TP program is the only way to achieve this.

  • Online
    hoitzing
    Reactions Received
    24
    Trophies
    1
    Posts
    128
    • February 7, 2024 at 1:14 PM
    • #4

    Just checked and local registers work fine as well. Doublecheck if you have enabled all the local registers you're trying to access (and not only R[10001]), or dumb typos in the parameter name. Otherwise I don't know where it could go wrong for you

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

  • KRL to KAREL match cases

    • Latoff
    • February 13, 2020 at 9:52 PM
    • Fanuc Robot Forum

Tags

  • Fanuc
  • karel
  • tp
  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