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

Writing to a register in karel

  • nygil
  • March 8, 2024 at 4:26 PM
  • Thread is Resolved
  • nygil
    Trophies
    1
    Posts
    1
    • March 8, 2024 at 4:26 PM
    • #1

    Hey everybody, I'm new to Karel and I've been looking for a good place to start, threads to read etc. I would like to be able to at some point be able to use Karel to do my robot logic in pns001, has anyone attempted/done this if so could i see some examples?

  • panic mode March 8, 2024 at 4:27 PM

    Approved the thread.
  • Lerak
    Reactions Received
    6
    Trophies
    2
    Posts
    203
    • March 8, 2024 at 4:53 PM
    • #2

    Hi !

    Could you explain the goal you reach in your management program.

    If you use PNS, then the call is made by PLC or other (so the management is there)

    If you want to use Karel, then you do not need PNS and you could manage as you want.

    If it starts well the first time, you have not checked all !

  • HalbesYoyo
    Persona non grata
    Reactions Received
    47
    Trophies
    3
    Posts
    151
    • March 8, 2024 at 5:13 PM
    • #3

    First of all, if not done already, you may download the manual B-83144EN-1/01 KAREL OPERATOR'S MANUAL from myFanuc :winking_face:

    So what would you like to achieve? Write to a register? In KAREL it's several commands for register operations. Here's some of them:

    Register Operation - Read

    GET_JPOS_REG

    GET_POS_REG

    GET_REG

    Register Operation - Write

    SET_JPOS_REG

    SET_POS_REG

    SET_REAL_REG

    SET_INT_REG

  • hermann
    Reactions Received
    403
    Trophies
    9
    Posts
    2,593
    • March 8, 2024 at 5:24 PM
    • #4

    My advice for Karel: avoid it where ever possible. Exception: You want some kind of knowledge hiding. :winking_face:

  • Lerak
    Reactions Received
    6
    Trophies
    2
    Posts
    203
    • March 8, 2024 at 5:38 PM
    • #5
    Quote from hermann

    My advice for Karel: avoid it where ever possible. Exception: You want some kind of knowledge hiding. :winking_face:

    Yes, Karel is a last option (exception Hiding things , special calculation/decision needed) :winking_face:

    If it starts well the first time, you have not checked all !

  • Shellmer
    Reactions Received
    52
    Trophies
    5
    Posts
    161
    • March 10, 2024 at 9:11 PM
    • #6

    I avoid to use Karel all I can, but if no other option is possible, the best practice to keep a maintainable code would be to split every function you need and call it through TP.

    So per example, if you need to do some calculations using "SIN" and "COS", you can create a Karel routine that accepts 2 parameters:

    - ANGLE -> As float

    - RESULT -> As float

    Then on the karel routine you can declare first parammeter as input, second as output, and when calling the routine through TP you can use 2 registers.

    As this example would be a simple function that only calls an internal Karel function, it should not need to be maintained, you can also put the original .kl file inside the MD for anyone who needs to check his contents or even recompile it.

    Yeah, I know it's not the best thing of the world, but you simply cannot avoid to use Karel for some things. Per example If you need to check the reachability of a vision point provided by external vision equipment other than fanuc before performing the real motion, you need to use karel, there is not other way to do it, so on this case, just create a simple routine to do that and all should be good.

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

  • Assigning value to a KAREL variable in TP program

    • coffeeBean
    • February 7, 2024 at 9:41 AM
    • Fanuc Robot Forum
  • Controlling Air flow through robot.

    • AlejandroOrtiz
    • July 27, 2023 at 1:25 AM
    • Fanuc Robot Forum
  • Error Codes to PLC

    • bwengren
    • December 2, 2016 at 5:35 PM
    • Fanuc Robot Forum
  • Karel Code Compilation (ktrans)

    • cyphery
    • May 12, 2023 at 6:29 PM
    • Fanuc Robot Forum
  • Other ways to check robot position against position register?

    • SnapShot
    • December 13, 2021 at 4:50 PM
    • Fanuc Robot Forum
  • Is it possible to convert a JPOS in KAREL to a XYZWPREXT position?

    • mikelaks
    • August 27, 2021 at 9:13 PM
    • Fanuc Robot Forum
  • Read name of PR given in PR Data list?

    • TomFoolious
    • December 9, 2020 at 12:52 PM
    • Fanuc Robot Forum
  • Access to the position register comments/names

    • Fabian Munoz
    • June 24, 2020 at 3:13 PM
    • Fanuc Robot Forum

Tags

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