UnderAutomation
    • Home page
  • Products
    • Universal Robots SDK
      • Overview
      • Download
      • Documentation
        • Overview
        • Get started with .NET
        • Get started with LabVIEW
        • Get started with Python
        • Get started with Matlab
        • Connect to the robot
        • Configure the UR simulator (URSIM)
        • Licensing
        • RTDE : Real-Time Data Exchange
        • Primary Interface : Data streaming
        • Remote send script
        • Dashboard Server : Remote Commands
        • SFTP file handling
        • SSH Linux commands
        • XML-RPC
        • Interpreter Mode
        • Socket communication
        • Forward and Inverse Kinematics
        • Convert position types
        • Open and edit program and installation files
        • Reading & Writing Global Variables
        • Reading & Writing Registers
    • Fanuc SDK
    • Yaskawa SDK
    • Staubli SDK
    • Quote • Order
    • License
Any question?

[email protected]

Contact us
UnderAutomation
  • Home page
  • Products
      • Overview
      • Download
      • Documentation
      • Overview
      • Download
      • Documentation
      • Overview
      • Download
      • Documentation
      • Overview
      • Download
      • Documentation
  • Quote • Order
  • Contact us
⌘Q
Universal Robots SDK documentation
Primary Interface : Data streaming
Documentation home
Dashboard Server : Remote Commands

Remote send script

Remote send and execute URScript via the Primary Interfaces.

  • Send URScript with Primary Interface
  • Send urp program file
  • Interpreter mode
  • Try it with the Windows example

Send URScript with Primary Interface

The Primary Interface protocol allows URScript script lines to be sent to the robot for execution.

Script can only be executed if you are connected to port PrimaryClient (default if not specified) or SecondaryClient.

You can send multiple script lines simultaneously.

set_digital_out(1, True)

You can also send script within a def function.

def primaryProgram():
  while (True):
    movej([0.9434381127910002, -1.3082063255028469, 2.2063341418137945, -2.6507188134210273, -1.081363649387086, 4.80585136204575], a=1.3962634015954636, v=1.0471975511965976)
    movej([0.9433155477260482, -1.014172108307441, 2.246293286726412, -2.9852336083709154, -1.0813798520591593, 4.805802742045307], a=1.3962634015954636, v=1.0471975511965976)
  end
end

When the script is received, the program is paused and your script is executed. There is no feedback on whether or not it has been executed.

To avoid stopping the main program, you can send script within a dry block, which defines a secondary program. The secondary program does not interrupt the main script and runs in parallel. However, it does not allow you to move the robot or write global variables.

Read UR documentation : https://www.universal-robots.com/articles/ur/programming/secondary-program/

sec secondaryProgram():
  set_digital_out(1, True)
end

In order for your robot to accept script execution, it must be in “Remote” mode, which can be selected using the switch located at the top right of Polyscope.

switch remote

Also, be sure the robot is powered on to execute move instructions

The Script.Send() method of PrimaryInterfaceClient class is used to send the script to the robot.

using UnderAutomation.UniversalRobots;
class PrimaryInterfaceScript
{
static void Main(string[] args)
{
var robot = new UR();
robot.Connect("192.168.0.1");
/**/
// Pause main program and execute script
robot.PrimaryInterface.Script.Send("movej([-1.5,-1.5,-2,-0.5,1.8,0],a=1.4, v=1.05, t=0, r=0)");
// Send Secondary program
robot.PrimaryInterface.Script.Send(@"
sec secondaryProgram():
set_digital_out(1, True)
end
");
/**/
}
}

Please refer to the Script Manual to see all the functions you can remotely call : Download PDF Script Manual.

Send urp program file

You can also send a local urp program file from your machine to the robot via SFTP : read SFTP documentation

Interpreter mode

It is also possible to send URScript lines via the "Interpreter Mode" protocol. : read Interpreter Mode documentation

Try it with the Windows example

PrimaryInterface

Primary Interface : Data streaming
Documentation home
Dashboard Server : Remote Commands

Easily integrate Universal Robots, Fanuc, Yaskawa or Staubli robots into your .NET, Python, LabVIEW or Matlab applications

UnderAutomation
Contact usLegal
Products
Universal Robots SDKFanuc SDKYaskawa SDKStaubli SDK
enEnglish
frFrançais
deDeutsch
esEspañol
zh中文
ja日本語
ko한국어

© All rights reserved.