




已阅读5页,还剩24页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
KUKA China | 20.06.2016 | Seite 1 PM Team KUKA机器人变量说明文档机器人变量说明文档 KUKA China | 20.06.2016 | page 2 Simple data types KUKA China | 20.06.2016 | page 3 Simple data types KUKA China | 20.06.2016 | page 4 Definition of “variables” In addition to the use of constants (digits, characters, etc.), memory locations are also defined in the robot controller in which these values can be stored. This stored information can thus be retrieved at various points in the program for evaluation and further processing. A variable is a fixed memory area, whose contents can be addressed via the variable name. Example: . Part_counter = 37 . Content of the variable Variable name KUKA China | 20.06.2016 | page 5 Declaration of variables DECL Data_Type Variable_Name Variable declarations always have the following syntax: Def Main( ) DECL INT part_counter INI . End Example: KUKA China | 20.06.2016 | page 6 Variables and names Variable names in KRL can have a maximum length of 24 characters. can consist of letters (A-Z), numbers (0-9) and the signs _ and $. must not begin with a number. must not be a keyword. KUKA China | 20.06.2016 | page 7 Simple data types “A” TRUE 1.43 32 Example ASCII character 1- 255 TRUE, FALSE +/-1.1E-38 . +/-3.4E+38 -231 . (231-1) Range of values 1 character Logic state Floating-point number Integer Meaning CHAR BOOL REAL INT Keyword Character Boolean Real Integer Data type KUKA China | 20.06.2016 | page 8 Basic structure of a robot program DEF NAME( ) END ;- Declaration section - . ;- Initialization section - . ;- Instruction section - . KUKA China | 20.06.2016 | page 9 Activating the DEF line Variables must be declared before the INI line In order to set syntax before the INI line, the DEF line must be activated KUKA China | 20.06.2016 | page 10 Declaration and value assignment DEF MAIN_PROGRAM( ) ;- Declaration section - DECL INT PART ;- Initialization section - INI ;Initialization of acceleration and velocity ;- Instruction section - PART=58 ;Value assignment, decimal PART=B111010 Value assignment, binary PART=H3A ;Value assignment, hexadecimal . END Value assignments are made in the program advance run! KUKA China | 20.06.2016 | page 11 Lifetime of variables in the SRC file . are only recognized in their own program. . are not recognized in local subprograms. DEF HP1( ) DECL INT CUBE INI CUBE=0 END Variables declared . in the corresponding DAT file . are only recognized in their own program, i.e. in the main program and in local subprograms. DEFDAT HP1( ) DECL INT CUBE=0 . ENDDAT in the $CONFIG.DAT file . are recognized in every program. . can be called during program execution. DEFDAT $CONFIG DECL INT CUBE=0 . ENDDAT KUKA China | 20.06.2016 | page 12 Declaration of constants DECL CONST Datentyp Variable_Name Constant declarations always have the following syntax and they could only declared in a data list: DEFDAT Main( ) Decl CONST REAL PI = 3.14159 . END Example: You can not manipulate Constants in the SRC-file. It causes a error message. KUKA China | 20.06.2016 | page 13 Arrays with simple data types and counting loop KUKA China | 20.06.2016 | page 14 Arrays KUKA China | 20.06.2016 | page 15 Arrays (one-dimensional) Creation: DECL Data_Type Variable_NameNumber of array elements Work: Variable_NameIndex = Value_Assignment Syntax: Example: DEF MAIN_PROGRAM( ) DECL REAL measurement3 INI measurement1 = 17.5 measurement2 = 35.7 measurement3 = 67.2 . END KUKA China | 20.06.2016 | page 16 Simple counting loop FOR Counter = Start TO End Statement ENDFOR DEF INIT_OUTPUTS ( ) DECL INT COUNTER INI FOR COUNTER=1 TO 10 ;Set output 1-10 to FALSE $OUTx=FALSE ENDFOR . END Syntax: Example: X10 ? yes no $OUTX KUKA China | 20.06.2016 | page 17 Example: Simple counting loop (1) 1 2 3 4 1 * 5 = 5 5 DEF MAIN_PROGRAM( ) DECL INT CELL4 DECL INT FI ;Array index INI FOR FI = 1 TO 4 CELLFI = FI * 5 ENDFOR . END CELL FI = 2 KUKA China | 20.06.2016 | page 18 Example: Simple counting loop (2) 1 2 3 4 2 * 5 = 10 5 10 DEF MAIN_PROGRAM( ) DECL INT CELL4 DECL INT FI ;Array index INI FOR FI = 1 TO 4 CELLFI = FI * 5 ENDFOR . END CELL FI = 3 KUKA China | 20.06.2016 | page 19 Example: Simple counting loop (3) 1 2 3 4 3 * 5 = 15 5 10 15 DEF MAIN_PROGRAM( ) DECL INT CELL4 DECL INT FI ;Array index INI FOR FI = 1 TO 4 CELLFI = FI * 5 ENDFOR . END CELL FI = 4 KUKA China | 20.06.2016 | page 20 Example: Simple counting loop (4) CELL 1 2 3 4 4 * 5 = 20 5 10 15 20 DEF MAIN_PROGRAM( ) DECL INT CELL4 DECL INT FI ;Array index INI FOR FI = 1 TO 4 CELLFI = FI * 5 ENDFOR . END FI = 5 KUKA China | 20.06.2016 | page 21 Two-dimensional array DEF MAIN_PROGRAM( ) DECL INT MEAS_VALUE 2,4 DECL INT ROW,COLUMN INI ; - Pre-assignment of an array - FOR ROW = 1 TO 2 FOR COLUMN = 1 TO 4 MEAS_VALUE ROW,COLUMN = 0 ENDFOR ENDFOR . END Row 1 Column Row 2 1 2 3 4 0 0 0 0 0 0 0 0 KUKA China | 20.06.2016 | page 22 Row Column Example: Three-dimensional array BOOL MATRIX 3, 3, 3 Level KUKA China | 20.06.2016 | page 23 Three-dimensional array DEF MAIN_PROGRAM( ) BOOL MATRIX 3,3,3 INT ROW, COLUMN, LEVEL INI FOR LEVEL = 1 TO 3 FOR COLUMN = 1 TO 3 FOR ROW = 1 TO 3 MATRIX ROW, COLUMN, LEVEL = FALSE ENDFOR ENDFOR ENDFOR . END The keyword “DECL” may also be omitted when declaring simple data types. KUKA China | 20.06.2016 | page 24 Structure KUKA China | 20.06.2016 | page 25 Structures Example: Exact definition of a car Air conditioning Motor Color Manufacturer KUKA China | 20.06.2016 | page 26 Structures A structure is a combination of different data types. A structure is initialized with an aggregate. Not all the parameters have to be specified in an aggregate. The order of the parameters is insignificant. User-defined structures should end in .TYPE! KUKA China | 20.06.2016 | page 27 DEF WELD ( ) STRUC WELDTYPE REAL V_WIRE, INT CHARAC, BOOL PULSE DECL WELDTYPE SEAM1 INI SEAM1=V_WIRE 0.7, CHARAC 5, PULSE FALSE . SEAM1.PULSE=TRUE . END User-defined structure Name of the structure Variable name Data type Modification of a value in an aggregate using a point separator KUKA China | 20.06.2016 | page 28 Predefined structures The following structures are predefined in the KUKA robot system: STRUC AXIS REAL A1,A2,A3,A4,A5,A6 STRUC E6AXIS REAL A1,A2,A3,A4,A5,A6,E1,E2,E3,E4,E5,E6 STRUC FRAME REA
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 化学气相淀积工协同作业考核试卷及答案
- 丝线脱胶后处理工艺考核试卷及答案
- 石材切割设备校验工艺考核试卷及答案
- 薄膜电阻器制造工异常处理考核试卷及答案
- 招聘师前沿技术考核试卷及答案
- 九年级化学第六单元控制燃烧第2节化石燃料的利用练习试题以及答案(适合鲁教版)
- 吐司店转让合同
- 银行中级工试题及答案
- 银行招聘面试题目及答案
- 银行运营考试题目及答案
- 床上洗头护理培训课件
- 2025年统编版小升初语文阅读专项训练:点面结合(含答案)
- 小学生养成良好学习习惯课件
- 《乡土中国》非连续性文本阅读专练-2023届高考语文备考专题复习
- 2025年北京市水务局所属事业单位招聘工作人员101人笔试高频重点提升(共500题)附带答案详解
- 2025至2030年中国密炼机上辅机系统行业投资前景及策略咨询研究报告
- 《T CPSS 1013-2021-开关电源电子元器件降额技术规范》
- 四川省德阳市中江县2024-2025学年九年级上学期期中考试英语试题(无答案)
- 2024年职工职业技能大赛数控铣工赛项理论考试题库-下(多选、判断题)
- 房地产行业市场调查报告
- 资金分析师职业鉴定考试复习题及答案
评论
0/150
提交评论