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. ABB 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

Default values of declared RAPID variables?

  • SkyeFire
  • February 17, 2023 at 3:57 PM
  • Thread is Unresolved
  • SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,429
    • February 17, 2023 at 3:57 PM
    • #1

    Stupid question: if a PROC contains the following:

    VAR BOOL bVar;

    WHILE NOT bVAR DO:

    ...

    ENDWHILE


    What happens? I've come across this in a piece of RAPID I didn't write, but the WHILE loop executes at least once, even though bVAR is never set to True or False in between the VAR and WHILE. Now, in KUKA KRL, this would result in an "undefined variable" error, but after examining this PROC, it seems like RAPID automatically assigns False to a new Bool variable.

    Am I right on this, or am I missing something? I've searched the RAPID Reference manual, but I haven't found anything that states how this works explicitly.

    Is the default value for num types 0, and [[0,0,0],[1,0,0,0]] for pos types? Is there a list of these "default values" by variable type?

  • Go to Best Answer
  • DS186
    Reactions Received
    200
    Trophies
    6
    Posts
    1,072
    • February 17, 2023 at 5:32 PM
    • #2

    A num with no value is initialized with 0 (which means it is the same for e.g. a pos), a bool will be FALSE and a string will be empty. Check chapter 1.2.2 of the RAPID overview manual for more information.

  • SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,429
    • February 17, 2023 at 11:32 PM
    • #3
    Quote from DS186

    Check chapter 1.2.2 of the RAPID overview manual for more information.

    Is there a keyword to search for? So far, none of the (several) versions of the Rapid Overview manual I have covered anything related to default values in section 1.2.2

  • DS186
    Reactions Received
    200
    Trophies
    6
    Posts
    1,072
    • February 18, 2023 at 8:26 AM
    • #4

    It is just a short section talking about the initial values.

    Images

    • Screenshot_2023-02-18-08-23-44-48_f541918c7893c52dbd1ee5d319333948.jpg
      • 58.59 kB
      • 384 × 853
      • 20
  • HyperLenon
    Trophies
    3
    Posts
    7
    • February 18, 2023 at 8:42 AM
    • #5

    Technical reference manual

    RAPID overview

    RobotWare 6.04

    Document ID: 3HAC050947-001

    Revision: D

    Page 31

    Little bit old but it still good I think :grinning_squinting_face:

  • SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,429
    • February 20, 2023 at 7:51 PM
    • #6

    Turns out I had 6 different Revs of that PDF. Only Rev D and above had that footnote.

    I'm still a bit curious what an aggregate like robtarget gets set to in this scenario, but I guess I'll just have to experiment with that if I have a chance.

  • DS186
    Reactions Received
    200
    Trophies
    6
    Posts
    1,072
    • February 20, 2023 at 9:05 PM
    • #7
    Quote from SkyeFire

    I'm still a bit curious what an aggregate like robtarget gets set to in this scenario, but I guess I'll just have to experiment with that if I have a chance.

    If you declare a robtarget, for example

    VAR robtarget p10;

    the values of p10 will be all 0, because a robtarget is just a structure of num variables.

  • SkyeFire
    Reactions Received
    1,052
    Trophies
    12
    Posts
    9,429
    • February 21, 2023 at 3:32 PM
    • #8
    Quote from DS186

    the values of p10 will be all 0, because a robtarget is just a structure of num variables.

    Will it, though? The 'zero' value for a robtarget is usually [[0,0,0],[1,0,0,0]], because of the way quaternions work. It's that kind of edge case that has me curious.

  • DS186
    Reactions Received
    200
    Trophies
    6
    Posts
    1,072
    • February 22, 2023 at 10:52 AM
    • Best Answer
    • #9
    Quote from SkyeFire

    Will it, though? The 'zero' value for a robtarget is usually [[0,0,0],[1,0,0,0]], because of the way quaternions work. It's that kind of edge case that has me curious.

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
  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