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 to Write Robot I/O Comment

  • iProg83
  • January 31, 2022 at 9:13 PM
  • Thread is Unresolved
  • iProg83
    Reactions Received
    1
    Trophies
    3
    Posts
    14
    • January 31, 2022 at 9:13 PM
    • #1

    So I am starting out with KAREL-

    I have the programming and reference bibles (manuals)

    I am looking at a couple of the built-ins for writing the comment for a robot I/O. I change EOATs often and their nomenclature is never the same to actuate the grippers, vacuum generators, etc.

    I have seen these two built-ins;

    RSET_PORTCMT

    SET_PORT_CMT

    I am struggling to follow which one is more suitable for what I am attempting to accomplish.

    I want to be able to call the procedure/routine (I have seen this used both terms in the manual)

    AR[1]- type of i/o (DI,RI,DO,RO,AI, etc)

    AR[2]- number of the i/o

    AR[3]- comment of i/o as a string

    I feel like the SET_PORT_CMT is the appropriate one to use- am I on the right path?

  • Go to Best Answer
  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • January 31, 2022 at 10:16 PM
    • #2

    I'm by no means a Karel Expert, but I've dabbled.

    Yes you are on the right path.

    SET_PORT_CMT can be used to set I/O comments

    You may also want to look at SET_REG_CMT, SET_PREG_CMT, SET_SREG_CMT for registers, Position Registers, and String Registers.

    Reading Arguments can be accomplished with GET_TPE_PRM.

  • iProg83
    Reactions Received
    1
    Trophies
    3
    Posts
    14
    • February 1, 2022 at 8:42 PM
    • #3

    Oof-

    Ok I am guessing that I will need to write much more code to accomplish this.

    I will continue reading the manual as much as I can.

    My code is a jumbled up mess at the moment. I am wishing I could find examples of passing multiple arguments in the manual. I haven't read the whole thing yet- that will take a bit.

  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • February 2, 2022 at 2:29 PM
    • Best Answer
    • #4

    Honestly, It probably sounds like more than it really is. Curiosity got to me, so I tried it myself, and it wasn't that much code.

    If you're interested, below is how I accomplished it.

    I'm sure there is probably more error checking that can be done with the STATUS variables, but I don't know much about them, I got them out of another source code I had a copy of.

    I followed the AR[] structure from your original post; AR[1] = IO_type, AR[2] = IO_Num, AR[3] = IO_cmt.

    The IO_type variable gets passed as an integer who's value comes from KLIOTYPS.KL (See the list below) and then I have a SELECT CASE setup for the Registers; pass a 1000, 1001, or 1002 for Num-Reg, Pos-Reg, or String-Reg respectively.

    (Setting this program up in ARGDISPEG01.DT would also be a good idea)

    io_din = 1 -- Digital input

    io_dout = 2 -- Digital output
    io_anin = 3 -- Analog input
    io_anout = 4 -- Analog output

    io_rdi = 8 -- Robot digital input
    io_rdo = 9 -- Robot digital output

    io_gpin = 18 -- Grouped inputs
    io_gpout = 19 -- Grouped outputs

    io_flag = 35 -- Flag (F[ ])
    io_marker = 36 -- Marker (M[ ])


    Code
    PROGRAM ARG_CMTS
    %NOPAUSE = TPENABLE
    %COMMENT = 'ROBOT COMMENTS'
    %ENVIRONMENT REGOPE
    %ENVIRONMENT IOSETUP
    %ENVIRONMENT STRNG
    %INCLUDE kliotyps
    
    VAR
        int_value, STATUS, IO_Num, IO_type   :INTEGER
        real_value  :REAL
        IO_cmt, str_value  : STRING[32]
        
        
    BEGIN
        GET_TPE_PRM(1, 1, IO_type, real_value, str_value, STATUS)
        GET_TPE_PRM(2, 1, IO_Num, real_value, str_value, STATUS)
        GET_TPE_PRM(3, 3, int_value, real_value, IO_cmt, STATUS)
        
        IF IO_type >= 1000 THEN
            SELECT IO_type OF
            CASE(1000):
               SET_REG_CMT (IO_Num, IO_cmt, STATUS)
           CASE(1001):
               SET_PREG_CMT (IO_Num, IO_cmt, STATUS)
           CASE(1002):
               SET_SREG_CMT (IO_Num, IO_cmt, STATUS)
            ENDSELECT
        ELSE
            SET_PORT_CMT(IO_type, IO_Num, io_cmt, STATUS)
        ENDIF
    
     END ARG_CMTS
    Display More

    Edited once, last by EnergyAddict (February 2, 2022 at 2:35 PM).

  • iProg83
    Reactions Received
    1
    Trophies
    3
    Posts
    14
    • February 2, 2022 at 3:30 PM
    • #5

    Energy addict-

    Thank you a very much. This does help out.

    I was reading in my manual yesterday about KLIOTYPS.KL. I was unable to find any of this when I searched in my manual. I was really hoping there was more about it in the appendix.

    I definitely have some studying to do here.

  • EnergyAddict
    Reactions Received
    45
    Trophies
    4
    Posts
    133
    • February 2, 2022 at 3:43 PM
    • #6
    Quote from iProg83

    I was reading in my manual yesterday about KLIOTYPS.KL. I was unable to find any of this when I searched in my manual. I was really hoping there was more about it in the appendix.

    I found the KLIOTYPS list on this thread KLIOTYPS.KL

    Glad I could help.

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

  • Software Request to Fanuc - the robot forum bugs and wish list

    • Werner Hampel
    • August 17, 2019 at 11:12 AM
    • Fanuc Robot Forum
  • PC and FANUC robot TCP/IP Communication

    • mahboobelahi93
    • September 24, 2021 at 4:02 PM
    • Fanuc Robot Forum
  • INTP-105 Run request failed, trying to start program with RUN_TASK built-in

    • FLrobotics
    • November 12, 2020 at 4:40 PM
    • Fanuc Robot Forum
  • Call TP program from KAREL

    • Limburger
    • May 20, 2021 at 4:30 PM
    • Fanuc Robot Forum
  • Fanuc Karel Server, MSG_CONNECT exits with status 67206 without blocking

    • KlausSu
    • April 18, 2019 at 11:14 AM
    • Fanuc Robot Forum
  • SAVE Macro with KAREL program

    • Famous_Fella
    • April 1, 2020 at 9:47 AM
    • Fanuc Robot Forum
  • KAREL - Problems for generate an output answer (R[ ], DOUT ...)

    • RobBrain34
    • November 7, 2019 at 7:59 PM
    • Fanuc Robot Forum
  • Communication going between cognex and fanuc robot

    • pramtekkar
    • June 5, 2019 at 4:42 PM
    • Fanuc Robot Forum
  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