Articles Download Safety & Security Forum myUR Go to Main Site

Universal Robots A/S
Energivej 51
DK-5260 Odense S

T: +45 8993 8989
sales@universal-robots.com

 
  • Articles
  • Download
  • Safety & Security
  • Forum
  • myUR
  • Go to Main Site
  • Support
  • Articles
  • Runtime error/Infinite loop

Runtime error/Infinite loop

Why do I get the message "Runtime error"?

Last modified on Jan 29, 2025

Examples are valid for:

CB2 Software version: 1.8.16941
CB3 Software version: 3.3.0.145
e-Series Software version: 5.1

Note that older or newer software versions may show differently message.

These examples can be used for both CB2,CB3 and e-Series.

 

During programming the robot, you might encounter a runtime error like this: 

Infiniteloop

or

Runtime Error

This can happen in the RobotProgram or in any Thread. 
The reason of this error, is that the program loops, but the lines in the program does not take any physical time. 

As an example, this program would cause an "infinite loop" error.

Infiniteloop1

This error happens dut to the fact, that all 3 assignment operations does not use physical time. And since the program is looping, the program is running infinitely fast in infinite circles. 

The method of solving this, is to insert a command that uses physical time. 
These commands use physical time: 

  • Wait (wait for a given time, e.g. 0.01 s)
  • sync() script command
  • Robot movements (e.g. a move command to a position whete the robot isn't already)

Thus, inserting a "Wait: 0.01" command into the program resolves the runtime error. 

Infiniteloop2

Other more complex programs might as well cause this error. 
In below program, if both "something_A" and "something_B" is False, then the robot program will loop infinitely, because no commands are executed. 

RobotProgram
   If (something_A)
      MoveJ
          Waypoint 1
          Waypoint 2
          Waypoint 3
   ElseIf (something_B)
      MoveL
          Waypoint 4
          Waypoint 5
          Waypoint 6

 

The runtime error can be solved by inserting e.g. a "sync()" script command at the end of the program. 
Then, if both IF-statements are false, the robot will spend physical time at the "sync()" command. 
Thus: 

RobotProgram
   If (something_A)
      MoveJ
          Waypoint 1
          Waypoint 2
          Waypoint 3
   ElseIf (something_B)
      MoveL
          Waypoint 4
          Waypoint 5
          Waypoint 6
   sync()

Related articles

CB3 to e-Series programs transferring quick guide
logo

Product

  • UR3e Robot
  • UR5e Robot
  • UR10e Robot
  • UR16e Robot
  • UR20 Robot
  • UR+ Products

Company

  • About us
  • Contact us
  • Careers We're hiring
  • UR merchandise

Training / Resources

  • Academy
  • Technical Resources
  • Articles
  • FAQ

Insights

  • Blog
  • Case stories
  • Content library
  • News centre
  • Podcast
  • Webinars & Events

Get in touch

  • Ask an Expert
  • Schedule a no-cost assessment
  • Find a distributor
  • Customer support

Connect with us

  • LinkedIn
  • Facebook
  • Twitter
  • YouTube
  • Instagram
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com
  • Copyright @ Universal Robots 2025
  • Cookie policy
  • Privacy policy
  • Universal Robots A/S
  • Energivej 51
  • DK-5260 Odense S
  • T: +45 89 93 89 89
  • sales@universal-robots.com
  • US Corporate Office
  • 27-43 Wormwood St.
  • 02210 Boston, MA.
  • +1-844-GO-COBOT
  • ur.na@universal-robots.com

Copyright © Universal Robots 2025

Cookie policy
Privacy policy