Setting the speed slider from a program - 15293


One example of switching between 2 speeds in the program and one example where the switching is controlled by an input

Examples are valid for:
CB2 Software version: 1.8.16941

CB3 Software version: 3.1.17779
Note that older or newer software versions may behave differently.

These examples can be used for both CB2 and for CB3.

What is important to notice is that on CB2 the WAIT command in the GUI or sleep() command in script are depended on the speed slider similar to the speed of the robot. This is not the case on CB3 and makes it possible to replace a loop of sync()'s with a WAIT instead.

Counter based:
This example moves the robot through 3 waypoints in the Robot Program.
In the Thread socket_open is used to connect to the Secondary Client Interface on the robot's own controller. The speed slider is controlled by a float between 0.0 and 1.0. Where 1.0 is 100%.

The example switches between 0.2 and 1.0. After each switch the loop waits 1 second before proceeding. On the CB2 controller the WAIT command in the GUI or sleep() command in script are depended on the speed slider similar to the speed of the robot. At 50% a 1 second wait would take 2 second. At 10% 10 second etc. It is therefore not possible to use these commands reliably. Especially as a speed at 0.0 would mean an infinite long wait.

Setting the speed slider from a running program is only possible on the script level. To send script commands to the controller one must use either port 30001 or 30002.

Primary and Secondary Client Interface link: Remote Control Via TCP/IP

To connect to a server running on the controller one must use the IP address "127.0.0.1", also known as localhost.

 Speed Slider Ex

 The script command sync() uses the frequency of the controller as reference. When no commands are to be executed or calculated a sync() takes 8ms. 125 sync() will therefore yield 1000 milliseconds equal to 1 second wait.

Find the program speedSliderEx_wCounter.urp attached - see bottom of this page.

Input based:
This example moves the robot through 3 waypoints in the Robot Program.
In the Thread socket_open is used to connect to the Secondary Client Interface on the robot's own controller. The speed slider is controlled by a float between 0.0 and 1.0. Where 1.0 is 100%.

The example switches between 0.2 and 1.0. It reads the current state of the input and sets the speed accordingly. The current state is stored and a wait is used to suspend the thread until the input changes state. There is no reason to continuously spending commands to the robot when there are no change in the state. Normally on the CB2 controller the WAIT command in the GUI or sleep() command in script are depended on the speed slider similar to the speed of the robot. But when used together with an expression or input then it uses sync() behind the scenes.

Setting the speed slider from a running program is only possible on the script level. To send script commands to the controller one must use either port 30001 or 30002.

Primary and Secondary Client Interface link: Remote Control Via TCP/IP

To connect to a server running on the controller one must use the IP address "127.0.0.1", also known as localhost.

Speedsliderex Wbutton

The script command sync() uses the frequency of the controller as reference. When no commands are to be executed or calculated a sync() takes 8ms.

Find the program speedSliderEx_wInput.urp attached - see bottom of this page.



Want to get notified about updates?

You are welcome to sign up for notifications about new relevant information and articles that could be interesting for you.

Universal Robots A/S needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at anytime. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, check out our Privacy Policy.

Need help?

Did you find what you needed on this site? For additional information please contact one of our distributors.