Skip to content

Instantly share code, notes, and snippets.

@Shawn-Armstrong
Last active April 29, 2023 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shawn-Armstrong/6523676f1cf25e6373c2f27e487e86ad to your computer and use it in GitHub Desktop.
Save Shawn-Armstrong/6523676f1cf25e6373c2f27e487e86ad to your computer and use it in GitHub Desktop.

AUTHOR: Shawn Armstrong
CONTACT: smarmstr@ucsc.edu

Fanuc_KAREL_hello_world.md

Overview

  • This document provides instructions for using Fanuc's KAREL programming language to create / run a simple hello world program.
  • This demo was created using Fanuc's ROBOGUIDE simulator running their CRX-20iA/L controller.

Instructions

NOTE: Clicking on images will increase resolution.

  1. Start ROBOGUIDE and perform the following actions:

    step1speed

    1. Select New Cell
    2. Select HandlingPRO then next
    3. Select next
    4. Select next
    5. Select CRX-20iA/L then next
    6. Select next
    7. Search KAREL and select R632, J566, search Remote and select R657, J624 then select next
    8. Select finish and wait for he controller to finish loading
  2. Create and compile a KAREL program with the following actions:

    step2speed

    1. On the file tree under Robot Controller1, right click Files then select New Files > KAREL Source (.kl)

    2. Copy and paste the following script

      PROGRAM hello_world
      
      BEGIN
      
        WRITE TPERROR('Hello World', CR);
      
      END hello_world;
    3. Press the build icon in the upper right hand of the editor

  3. Run the KAREL program with the following steps:

    step4speed

    1. Open the Teach Pendant by click on the following icon.

      image

    2. Open the setup menu by clicking the menu button.

      image

    3. Click through the setup process selecting Skip Gudiance and Finish Step when prompt; keep click next until finish. image

    4. It'll transition you to the icon menu, select create program.

      image

    5. Select the blank template option then click through the prompt until you're brough to editor.

      image

    6. Press the EDCMD button and insert a single line

      image

    7. Press the INST button then select Call > Collect > KAREL PROGRAMS > HELLO_WORLD

    8. Afterward, press SHIFT on your keyboard while selecting the FWD button on the pendant to prompt Hello World.

      image

Observations

  • The GUI was designed for operators. GUI help instructions frequently reference "programming the robot"; this is intended for operators to program through the GUI and not CS people looking to do KAREL.
  • There seems to be other alternatives to the teach pendant but they're just as bad. It appears a NoVNC server is launched to provide an alternative interface. For me, it was launched at http://127.0.0.1:3080/frh/jcgtp/iRProg.stm?_config_mode=-4 .
  • The pgogramming manual frequently mentions the use of function keys on the teach pendant. You can replicate these keystrokes on the teach pendant by holding shift+desired key.
  • This Fanuc community post looked pretty relavent to our goals.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment