没有合适的资源?快使用搜索试试~ 我知道了~
首页英文版UR优傲机器人脚本手册ScriptManual
英文版UR优傲机器人脚本手册ScriptManual
需积分: 45 513 浏览量
更新于2023-05-31
评论 1
收藏 1.22MB PDF 举报
英文版UR优傲机器人脚本手册,指令齐全,参数释义清晰,URScript编程语言 5.1.0版本 9,10,2018
资源详情
资源评论
资源推荐

The URScript Programming
Language
Version 5.1.0
September 10, 2018
Designed and Built in Denmark

CONTENTS CONTENTS
The information contained herein is the property of Universal Robots A/S and shall
not be reproduced in whole or in part without prior written approval of Universal
Robots A/S. The information herein is subject to change without notice and should
not be construed as a commitment by Universal Robots A/S. This manual is period-
ically reviewed and revised.
Universal Robots A/S assumes no responsibility for any errors or omissions in this doc-
ument.
Copyright
c
2009–2018 by Universal Robots A/S
The Universal Robots logo is a registered trademark of Universal Robots A/S.
Contents
Contents 2
1 The URScript Programming Language 3
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 Connecting to URControl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Numbers, Variables, and Types . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Flow of Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4.1 Special keywords . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Remote Procedure Call (RPC) . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.7 Scoping rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.8 Threads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.8.1 Threads and scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.8.2 Thread scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.9 Program Label . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Module motion 12
2.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3 Module internals 30
3.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4 Module urmath 42
4.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
4.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
5 Module interfaces 58
5.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
5.2 Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
2
URScript

The URScript Programming Language
1 The URScript Programming Language
1.1 Introduction
The Universal Robot can be controlled at two levels:
• The PolyScope or the Graphical User Interface Level
• Script Level
At the Script Level, the URScript is the programming language that controls the robot.
The URScript includes variables, types, and the flow control statements. There are also
built-in variables and functions that monitor and control I/O and robot movements.
1.2 Connecting to URControl
URControl is the low-level robot controller running on the Mini-ITX PC in the Control
Box. When the PC boots up, the URControl starts up as a daemon (i.e., a service) and
the PolyScope or Graphical User Interface connects as a client using a local TCP/IP
connection.
Programming a robot at the Script Level is done by writing a client application (running
at another PC) and connecting to URControl using a TCP/IP socket.
• hostname: ur-xx (or the IP address found in the About Dialog-Box in PolyScope if
the robot is not in DNS).
• port: 30002
When a connection has been established URScript programs or commands are sent in
clear text on the socket. Each line is terminated by “\n”. Note that the text can only
consist of extended ASCII characters.
The following conditions must be met to ensure that the URControl correctly recognizes
the script:
• The script must start from a function definition or a secondary function definition
(either "def" or "sec" keywords) in the first column
• All other script lines must be indented by at least one white space
• The last line of script must be an "end" keyword starting in the first column
4
URScript

Numbers, Variables, and Types The URScript Programming Language
1.3 Numbers, Variables, and Types
In URScript arithmetic expression syntax is standard:
1+2-3
4
*
5/6
(1+2)
*
3/(4-5)
In boolean expressions, boolean operators are spelled out:
True or False and (1 == 2)
1 > 2 or 3 != 4 xor 5 < -6
not 42 >= 87 and 87 <= 42
Variable assignment is done using the equal sign =:
foo = 42
bar = False or True and not False
baz = 87-13/3.1415
hello = "Hello, World!"
l = [1,2,4]
target = p[0.4,0.4,0.0,0.0,3.14159,0.0]
The fundamental type of a variable is deduced from the first assignment of the vari-
able. In the example above foo is an int and bar is a bool. target is a pose: a
combination of a position and orientation.
The fundamental types are:
• none
• bool
• number - either int or float
• pose
• string
A pose is given as p[x,y,z,ax,ay,az], where x,y,z is the position of the TCP, and
ax,ay,az is the orientation of the TCP, given in axis-angle notation.
1.4 Flow of Control
The flow of control of a program is changed by if-statements:
if a > 3:
a = a + 1
elif b < 7:
b = b
*
a
else:
a = a + b
5
URScript
剩余101页未读,继续阅读
















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0