Main Content

executeURScriptCommand

Send URScript command to control cobot over RTDE interface

Since R2024a

Description

executeURScriptCommand(ur,urScriptCommand) sends the specified URScript command to control cobot over RTDE interface.

Note

executeURScriptCommand stops the current UR program, if it is playing, due to safety reasons, and enables communication using primary or secondary interface to send UR script commands directly. To continue using urRTDEClient object, open the Teach Pendant interface or URSim simulator interface, click the icon to change the mode to Local control, play the program, and switch back to Remote control mode. Clear the urRTDEClient object and create it again to use other functionalities.

executeURScriptCommand(ur,urScriptCommand,port) sends the specified URScript command to control cobot over RTDE interface, at the specified port . Specifying the port is optional.

example

Examples

collapse all

Connect to a physical or simulated cobot by using the urRTDEClient object.

ur = urRTDEClient('172.19.98.176');

Specify the URScript command for moving a joint to position, and execute the command at the secondary port.

executeURScriptCommand(ur,'movej([-1.6007,-1.7271,-2.2030,-0.8080,1.5951,-0.0310])',30002)

Input Arguments

collapse all

Connection to physical or simulated cobot from Universal Robots, specified as a urRTDEClient object.

URScript command, specified as a string scalar or character vector.

Example: movej([-1.6007,-1.7271,-2.2030,-0.8080,1.5951,-0.0310])

Data Types: string | char

TCP port number on the cobot. This argument is optional.

Example: 30002

Data Types: double

Version History

Introduced in R2024a

See Also