roboBASIC命令手册
TRIO BASIC中文手册
描述 ERROR_LINE 包括最后 BASIC 程序出错的行数
PMOVE 包括任务缓存的状态 PROC 获得特定过程参数 PROC_LINE 返回特定程序的当前行 PROCNUMBER 包括当前被选择运行的任务数 PROC_STATUS 返回特定过程的状态
RUN_ERROR 包括在特定任务产生的 BASIC 错误数 TICKS 包括当前任务时钟脉冲
描述
页数
8 轴参数
以下列表概述了轴的参数,详细描述参考特定页。
命名
ACCEL ADDAX_AXIS ATYPE AXISSTATUS CLOSE_WIN CLUTCH_RATE CREEP DATUM_IN DECEL DEMAND_EDGES DPOS DRIVE_STATUS D_GAIN ENCODER ENDMOVE ERRORMASK FAST_JOG FASTDEC FE FE_LIMIT FERANGE FEMIN FHOLD_IN FHSPEED FS_LIMIT FWD_IN FWD_JOG
描述 任何两个有效表达式的加 任何两个有效表达式的减 任何两个有效表达式的乘积 任何两个有效表达式的除 如果表达式 1 等于表达式 2 返回真,否则返回假 如果表达式 1 不等于表达式 2 返回真,否则返回假 如果表达式 1 大于表达式 2 返回真,否则返回假 如果表达式 1 大于等于表达式 2 返回真,否则返回假 如果表达式 1 小于表达式 2 返回真,否则返回假 如果表达式 1 小于等于表达式 2 返回真,否则返回假 返回表达式的绝对值 返回表达式的反余弦 两有效 BASIC 表达式在整数部分的相应位执行与操作 返回表达式的反正弦 返回表达式的正切值 返回非零表达式的反正切值 清除特定 VR 变量的特定位
roboBASIC命令手册完整版_renxixi
目录第一章ROBOBASIC指令概述 (3)第二章ROBOBASIC语法概述 (8)第三章ROBOBASIC命令声明说明 (14)第四章控制流指令说明 (15)第五章ROBOBASIC数字输入输出说明 (23)第六章内存指令说明 (27)第七章ROBOBASIC的LCD模块说明 (29)第八章ROBOBASIC电机控制指令说明 (34)第九章ROBOBASIC 语音控制指令说明 (48)第十章ROBOBASIC 外部通讯指令说明 (52)第十一章ROBOBASIC 模拟信号处理指令描述 (57)第十二章ROBOBASIC 其他指令 (64)第十三章ROBOBASIC 指令描述 (66)注:本命令手册由任茜茜翻译,仅供学习使用。
在翻译中参考了部分前者的译文,但是由于本人英语水平有限,不对手册的正确程度做保证。
如果有任何问题可以给我发邮件,邮箱****************。
第一章 ROBOBASIC指令概述指令概述:ROBOBASIC是一个用于控制机器人的独家编程设计语言。
使用ROBOBASIC 命令控制一个机器人,ROBOBASIC已经被添加到BASIC语言。
文中②符号表示该命令只适用于MR-C2000系列控制器。
文中③符号表示该命令只适用于MR-C3000系列控制器。
声明和定义指令:DIM 声明变量AS 变量声明时分配存储空间CONST 声明常量(可读不可写)BYTE 变量声明时指定为字节型INTEGER 变量声明时指定为整型控制流指令:IF 条件语句开始THEN 条件语句为真时执行下一条语句ELSE 条件语句为假时执行下一条语句ELSEIF 另一个条件语句开始ENDIF 条件语句结束FOR 循环开始TO 指定循环范围NEXT 循环结束GOTO 无条件跳转GOSUB 调用子程序RETURN 子程序返回END 结束程序执行STOP 停止程序执行RUN 连续执行程序WAIT 等待至程序执行完成DELAY 延时一段时间再执行程序②BREAK 暂停程序执行并转换到调试模式数字信号输入输出指令:IN 从输入端口读信号OUT 发送信号到输出端口BYTEIN 从输入端口读取比特信号(一字节)BYTEOUT 发送一比特的信号到输出端口②INKEY 从输入端口读取键值STATE 输出端口状态PULSE 发送脉冲信号到输出端口TOGGLE 发转输出口状态③KEYIN 接受模拟键盘输入内存指令:PEEK 从控制器的RAM中读取数据POKE 向控制器的RAM中写入数据ROMPEEK 从控制器外部的EEPROM RAM读取数据ROMPOKE 向控制器外部的EEPROM RAM写数据LCD指令:LCDINIT 初始化LCD模块CLS 清除LCD模块数据LOCATE 设置字符在LCD中的位置PRINT 显示字符(字母)FORMAT 设置字母格式CSON 显示光标CSOFF 隐藏光标CONT 设置对比度DEC 输出十进制数到LCDHEX 输出十六进制数到LCD③BIN 输出二进制数到LCD操作数相关操作:AND 逻辑与OR 逻辑或MOD 取余XOR 逻辑异或③NOT 所有位求反电机控制指令:ZERO 设置伺服电机的0点(自然角度)MOTOR 开启伺服电机的输出端口MOTOROFF 关闭伺服电机的输出端口MOVE 同时操作多个伺服电机SPEED 设置伺服电机的速度②ACCEL 设置伺服电机的加速度DIR 设置伺服电机的方向PTP 开启/关闭同时控制操作SERVO 控制伺服电机PWM 直流电机的脉冲宽度控制②FASTSERVO 以最大速度操作伺服电机③HIGHSPEED 开启/关闭伺服电机的高速模式③MOVEPOS 根据以声明的位置移动伺服电机组③POS 设置机器人的特定姿势③FPWM 改变脉冲宽度和频率③MOVE24 同时操作所有的24个伺服电机③INIT 设置初始移动姿态③MOTORIN 读取伺服电机当前的位置③AIMOTOR 设置使用AI电机③AIMOTOROFF 退出AI电机③AIMOTORIN 读取AI电机当前的位置③SETON 设置使用setup功能③SETOFF 退出setup功能③ALLON setup所有的伺服电机③ALLOFF 取消所有伺服电机的setup功能③GETMOTORSET 读取伺服电机的当前位置并保存当前位置电机组参数分配:③G6A 将0~5号电机分配给A组③G6B 将6~11号电机分配给B组③G6C 将12~17号电机分配给C组③G6D 将18~23号电机分配给D组③G6E 将24~29号电机分配给E组③G8A 将0~7号电机分配给A组③G8B 将8~15号电机分配给B组③G8C 将16~23号电机分配给C组③G8D 将24~31号电机分配给D组③G12 分配0~11号伺服电机③G16 分配0~15号伺服电机③G24 分配0~23号伺服电机③G32 分配0~31号伺服电机声音控制指令:②BEEP 用PIEZO播放警告音②SOUND 用PIEZO发出一定频率的声音②PLAY 用PIEZO播放声音③MUSIC 用PIEZO播放音乐③TEMPO 设置声音节奏外部通讯指令:②RX 通过RX端口接收RS-232信号②TX 通过TX 端口传输RS-232信号②MINIIN 通过mini通讯端口接受mini总线信号②MINIOUT 通过mini通讯端口传输mini总线信号③ERX 通过RX端口接收RS-232信号③ETX 通过TX 端口传输RS-232信号模拟信号处理指令:③AD 从AD端口读取模拟信号③REMOCON 从红外远程装置读取键值③SONAR 从超声波端口读取距离③RCIN 从RC(遥控)读取输入值③GYRODIR 设置陀螺仪的方向③GYROSET 把一个陀螺仪分配给一个伺服电机③GYROSENSE 设置陀螺仪的灵敏度处理指令:ON...GOTO 根据变量值跳转其他指令:RND 产生一个随机数REMARK 产生一个文本入口目的指令:‘$DEVICE 设置控制器由目前正在运行的程序操作③‘$LIMIT 限制伺服电机的运行范围第二章 ROBOBASIC语法概述字符集:roboBASIC字符集由英文字母、数字及特殊字符组成。
ABB机器人培训手册 (中文)basic1
系统安全机器人系统复杂而且危险性大,以下的安全守则必须遵守。
∙万一发生火灾,请使用二氧化炭灭火器。
∙急停开关(E-Stop)不允许被短接。
∙机器人处于自动模式时,不允许进入其运动所及的区域。
∙在任何情况下,不要使用原始盘,用复制盘。
∙搬运时,机器停止,机器人不应置物,应空机。
∙意外或不正常情况下,均可使用E-Stop键,停止运行。
∙在编程,测试及维修时必须注意既使在低速时,机器人仍然是非常有力的,其动量很大,必须将机器人置于手动模式。
∙气路系统中的压力可达0.6MP,任何相关检修都要断气源。
∙在不用移动机器人及运行程序时,须及时释放使能器(Enable Device)。
∙调试人员进入机器人工作区时,须随身携带示教器,以防他人无意误操作。
∙在得到停电通知时,要预先关断机器人的主电源及气源。
∙突然停电后,要赶在来电之前预先关闭机器人的主电源开关,并及时取下夹具上的工件。
∙维修人员必须保管好机器人钥匙,严禁非授权人员在手动模式下进入机器人软件系统,随意翻阅或修改程序及参数。
第一章综述一、S4C系统介绍:全开放式对操作者友善最先进系统最多可接六个外围设备常规型号:IRB 1400,IRB 2400,IRB 4400,IRB 6400IRB 指 ABB 机器人,第一位数(1,2,4,6)指机器人大小第二位数( 4 )指机器人属于S4或S4C系统。
无论何型号,机器人控制部分基本相同。
IRB 1400:承载较小,最大承载为5kg,常用于焊接。
IRB 2400:承载较小,最大承载为 7kg ,常用于焊接。
IRB 4400:承载较大,最大承载为60kg 常用于搬运或大范围焊接。
IRB 6400:承载较大,最大承载为200kg,常用于搬运或大范围焊接。
二、机器人组成:机器人由两部分组成:Controller: 控制器。
Manipulator: 机械手。
操作人员通过示教器和操作盘操作机器人。
左边是示教器(Teach Pendant)。
Adobe RoboHelp 2017 用户指南说明书
About the T utorialThis is a tutorial on Adobe RoboHelp 2017. Adobe RoboHelp is a Help Authoring Tool (HAT) that allows you to create help systems, e-learning content and knowledge bases. The latest version of RoboHelp is packed with features, which allows you to create Responsive HTML5 layouts that work on any device size.This tutorial will help the readers in understanding the basics of the program and enable to create help files or documentation for various technical communications.AudienceAdobe RoboHelp is used by industry professionals looking to create great technical content for their end-users. As such, it does require some knowledge of HTML and other web technologies. Some advanced features such as creation of custom dialog boxes require programming knowledge in Visual Basic, C/C++, Java or JavaScript.However, newer versions make it easy for anyone to get started without having to write a line of code. Therefore, users of all experience levels can follow this tutorial.PrerequisitesThe reader should have proficient knowledge of navigating your way around the Windows OS (Windows 7 or later) along with good technical knowledge of the software for which the readers are going to prepare the documentation.Adobe RoboHelp is part of the Technical Communication Suite (TCS). You can purchase a subscription to TCS, which will also give you access to tools such as FrameMaker, Captivate, Acrobat and Presenter. If you are interested only in RoboHelp, the reader should purchase a separate license, which can be either an individual license, a perpetual license as part of the Cumulative Licensing Program (CLP), perpetual license as part of the Transactional Licensing Program (TLP) or an Enterprise Term License Agreement (ETLA). Prices and licensing options can be checked on the following link –/products/robohelp/buying-guide.html. The reader can also download a fully functional 30-day trial version to test out the software from the following link –https:///products/robohelp/download-trial/try.html#.Copy right and DisclaimerCopyright 2019 by Tutorials Point (I) Pvt. Ltd.All the content and graphics published in this e-book are the property of Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or republish any contents or a part of contents of this e-book in any manner without written consent of the publisher.We strive to update the contents of our website and tutorials as timely and as precisely as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of our website or its contents including this tutorial. If you discover any errors on our website or in this tutorial, please notify us at **************************T able of ContentsAbout the Tutorial (i)Audience (i)Prerequisites (i)Copyright and Disclaimer (i)Table of Contents ...................................................................................................................................... i i1.RoboHelp – Overview (1)2.RoboHelp – New Features (2)3.RoboHelp – Server (3)4.RoboHelp – Workspace Overview (4)5.RoboHelp – Working with Tabs (7)6.RoboHelp – Working with Pods (10)7.RoboHelp – Environments (13)8.RoboHelp – Keyboard Shortcuts (14)9.RoboHelp – General Settings (16)10.RoboHelp – Overview of Projects (18)Project Files (18)11.RoboHelp – Creating & Managing Projects (20)12.RoboHelp – Opening a Project (23)13.RoboHelp – Configuring Project Settings (25)14.RoboHelp – Defining a Chapter Layout (26)15.RoboHelp – Managing Project Files (27)16.RoboHelp – Managing Project Folders (31)17.RoboHelp – Multilingual Authoring (33)18.RoboHelp – Importing PDF Files (35)19.RoboHelp – Importing & Linking MS Word Docs (38)20.RoboHelp – Converting Word Styles (42)21.RoboHelp – Importing DITA Map & XML Files (44)Importing DITA Map Files (44)Importing XML files (46)22.RoboHelp – Importing WinHelp Files (47)HTML Limitations with HLP Files (47)23.RoboHelp – Version Control (49)24.RoboHelp – Working with Reports (51)25.RoboHelp – Generating & Customizing Reports (52)26.RoboHelp – Creating, Saving & Opening Topics (54)27.RoboHelp – Authoring Topics in XHTML (57)28.RoboHelp – Creating & Working on Master Pages (58)29.RoboHelp – Managing Topics (61)30.RoboHelp – Spell Check, Find & Replace (63)31.RoboHelp – Ensuring W3C compliance (66)32.RoboHelp – Editing (67)33.RoboHelp – Formatting Characters (69)34.RoboHelp – Formatting Paragraphs (71)35.RoboHelp – Borders, Backgrounds & Sounds (72)36.RoboHelp – Working with Tables (75)37.RoboHelp – Working with Lists (77)38.RoboHelp – Creating & Editing Variables (79)39.RoboHelp – Media Rules & Attributes in Styles (81)40.RoboHelp – Managing Style Sheets (83)41.RoboHelp – Styling for Style Sheets (85)42.RoboHelp – Creating Table Styles (87)43.RoboHelp – Creating List Styles (89)44.RoboHelp – Creating HTML Styles (91)45.RoboHelp – Editing Styles in CSS (93)46.RoboHelp – Creating & Printing ToC (95)47.RoboHelp – Editing ToCs (97)48.RoboHelp – Managing ToCs (99)49.RoboHelp – Working With Multiple ToCs (101)50.RoboHelp – Creating Indexes & Keywords (102)51.RoboHelp – Editing Index Keywords (104)52.RoboHelp – Managing Indexes (106)53.RoboHelp – Automatic Indexing (107)54.RoboHelp – Creating Multiple Indexes (110)55.RoboHelp – Customizing, Adding ToC & Index Controls (111)56.RoboHelp – Glossaries (113)Glossary Hotspots (115)57.RoboHelp – Creating Text Links for Navigation (116)58.RoboHelp – Creating & Editing Bookmarks (117)59.RoboHelp – Linking Images & Multimedia (118)60.RoboHelp – Linking External Sources (119)61.RoboHelp – Maintaining & Repairing Links (120)62.RoboHelp – Link Controls (121)63.RoboHelp – Working With Text-Only Pop-Ups (125)64.RoboHelp – Create & Edit Browse Sequences (126)65.RoboHelp – Output Search (128)66.RoboHelp – Optimize & Configure Search (131)67.RoboHelp – External Content Search (133)68.RoboHelp – Working With Images (134)69.RoboHelp – Import Adobe Captivate Demos (137)70.RoboHelp – Adding & Removing Multimedia (138)71.RoboHelp – Adding DHTML Effects (140)72.RoboHelp – DHTML Triggers & Targets (142)73.RoboHelp – Marquees (144)74.RoboHelp – HTML Comments (145)75.RoboHelp – Working With iFrames (146)76.RoboHelp – Conditional Text (147)77.RoboHelp – Context-Sensitive Help (148)78.RoboHelp – Managing Map IDs (149)79.RoboHelp – Dynamic Editing of CST (151)80.RoboHelp – Developer Information (152)81.RoboHelp –What’s This? Help (153)82.RoboHelp – Single-Source Layouts (155)83.RoboHelp – Generate DUCC (157)84.RoboHelp – Generate Output for MS SharePoint (159)85.RoboHelp – Multiscreen Layouts (162)86.RoboHelp – MS HTML, JavaHelp & Oracle Help Layouts (163)87.RoboHelp – EPUB & Kindle Book Outputs (165)88.RoboHelp – Review & Collaboration (168)89.RoboHelp – Managing Shared Resources (171)90.RoboHelp – ActiveX Controls (173)91.RoboHelp – Forms & Frames (175)92.RoboHelp – HTML Help Controls (177)1.Adobe RoboHelpAdobe RoboHelp is a popular Help Authoring Tool (HAT) from Adobe. It is used by industry professionals to deliver engaging help content, e-learning resources, organizational policies and knowledge base articles to a wide audience irrespective of device form factor. The latest version of RoboHelp (2017 release) helps you to easily create next-gen Responsive HTML5 layouts, which enable seamless navigation and rich interactivity. RoboHelp was first created by Gen Kiyooka and released by Blue Sky Software in 1992. Blue Sky Software was acquired by Macromedia, which was subsequently acquired by Adobe in 2005. Adobe RoboHelp 2017 is versioned as 13.0 although technically it is version 21 taking into account the previous versions released under Macromedia. RoboHelp has evolved from being just a HAT to a versatile tool, which can help you create eBooks and even web sites. RoboHelp can output to a variety of help formats using the following Single Source Layouts (SSLs) –∙Responsive HTML5∙eBook∙Microsoft HTML Help∙JavaHelp∙Oracle Help∙Eclipse Help∙Adobe AIR Help∙Standard Word and PDF documentationOne of the biggest challenges faced in content delivery is ensuring that the intended audience is able to view it. RoboHelp allows content creators to create native apps for Android and iOS without the need for any extra software.With a plethora of new features in the latest release, Adobe RoboHelp remains the industry standard HAT for creating engaging help, e-learning and technical content which addresses the varied needs of the target audience in a dynamic way. It is easy to use –both by seasoned authors as well as by novices.2.Adobe RoboHelpThe 2017 release of RoboHelp packs in many new features. These include –∙Next-generation HTML5 layouts∙Auto-complete∙Thumbnail support∙Favorites in Responsive HTML5 layouts∙Baggage file folder import∙Variable viewsLet us understand them in detail.Next-generation HTML5 layoutsThe 2017 release of RoboHelp promises to help you create visually engaging borderless HTML5 layouts. These layouts offer a superior search and navigation experience and are preloaded with many features like topic sliders, show/hide widgets, etc. The responsive design enables the content to scale well across screens of different sizes.Auto-completeNow you can get predictive search results in the search field of the responsive HTML5 output after typing the first few characters. The results appear instantaneously and are contextual without the user having to enter the full search string. The results are ranked based on the frequency of the keyword in the content.Thumbnail supportYou can now publish thumbnails of images, which can reduce page loading times, saving bandwidth, while also being mobile friendly. If needed, the user can simply load the larger image by clicking on the thumbnail. It is possible to maintain a standard thumbnail size in order to maintain consistency throughout the content.Favorites in Responsive HTML5 layoutsIt is now possible to mark topics as favorites and add custom links with the new Indigo themed Responsive HTML5 layout.Baggage File Folder ImportYou can now add multiple baggage files stored in a folder in a single click by adding the folder to the project thereby making it easy to import folders containing support information.Variable viewsYou can now easily toggle between the variable name and its value by a keyboard shortcut or from the context menu. You can toggle a single variable or all variables to view content exactly as your audience would view it.3.Adobe RoboHelpAdobe RoboHelp Server is a server based help solution. You can upload your help content on a server, which can then provide real-time end user feedback. It can log data on the queries, which is asked by the users. RoboHelp Server can graphically show how users are navigating around the help system.(Image Source: Adobe RoboHelp 2017 documentation)You can use an authoring tool to author the content, which can include multiple projects and upload the entire project onto the RoboHelp Server. The RoboHelp Server includes automatic project merging, which allows authors to work on different projects at different schedules and publish all of them to the same server. Authors can also publish projects written in various languages on the same server.The RoboHelp Server can also interface with database servers such as Oracle or MS SQL Server and generate reports and logs. The response to the user query is relayed back via an Apache HTTP Server.Adobe RoboHelp The typical RoboHelp workspace comprises of elements called Pods , Panes , Bars and Windows . Let us have a look at some of the components of the workspace.Quick Access ToolbarThe Quick Access Toolbar provides access to frequently used commands. It can be customized to access the commands you access the most.The default commands include: Save All, Copy, Paste, Undo, and Redo.4.TabsTabs are logical groups of commands put together. A tab contains commands of related functionality. Tabs are contextual and change depending on the type of content and formatting.Document PaneThe document pane generally comprises of three rows of tabs as shown in the following screenshot.These tabs are explained below.∙The first row is the Tabbed Document Pane. Each tab comprises of one project.You can work on multiple projects at once and copy paste assets between these projects.∙The second row is the Design and HTML View Panes. For any given document, you can toggle between the design you are working on and the HTML code of your design. You can edit the HTML for even finer control. The HTML code is auto-generated as you keep working on the design.∙The third row shows the Document Area Selectors. These help you to jump to various sections of the document such as Paragraphs, Headings and Hyperlinks.PodsPods are panes that you can dock anywhere in the workspace to get access to all features, which are logically grouped. For example, the Project Manager pod shows all the components of the project. Pods can be grouped together or can be free floating on theworkspace.You can also make them auto-hide or move them to a different monitor.5.Adobe RoboHelpRoboHelp makes it easy to locate and identify commands associated with a particular function by organizing them into tabs. The tabs are organized in a ribbon similar to the Microsoft Office suite of programs.The ribbon comprises several tabs, which include –∙File∙Project∙Edit∙Insert∙Review∙Collaborate∙Output∙ToolsLet us understand each of these in detail.FileCreate new projects, open, save the existing project, view recent projects and change program settings.ProjectCreate, import, edit, and delete project components such as topics, snippets, tags, and variables. You can save the currently unsaved changes across the project.EditCreating and editing stylesheets, text formatting and content tagging.InsertInsert objects such as tables, images, Adobe Captivate content and snippets.ReviewTrack changes, accept and reject changes in a document review.CollaborateShare project resources across users and enable version control.OutputCreate, search, setup, generate, view and open RoboHelp outputs.ToolsYou can create and view reports. RoboHelp ships with a number of scripts, which you can use to perform certain commands. Select and execute scripts from the Scripts list in this tab.6.Adobe RoboHelpA pod is a floating or docked window of the workflow or associated functions organized in a logical manner. To open a pod, go to the Project tab, then in the Open section, click on the Pods icon to reveal a list of pods. Select a pod from the list. You can either dock the pod or keep it floating on your desktop. You can also auto-hide the pod or open it as a tabbed document.RoboHelp includes many types of pods. Some of them include –∙Starter Pod∙Project Manager Pod∙Output Setup PodLet us discuss each of these in detail.Starter PodThe Starter Pod usually appears as a tabbed document but just like any other pod, you can make it float or even dock it. It usually the starting point in the RoboHelp workflow.The Starter Pod comprises of four sections, which are –∙Recent Projects – Shows a list of recently opened projects.∙Create – Lets you choose the type of help file you want to create.∙Import –Import content from Microsoft Word, Adobe FrameMaker, Adobe PDF files, HTML or other supported formats.∙Resources –Contains links to help resources, seminars and knowledge base articles to help you get the most out of RoboHelp.Project Manager PodThe Project Manager pod contains all the various folders in which you store and edit your project files. The Project Manager pod has default folders for each content type.For example, all images in the project are stored under the Images folder, videos andsounds are stored under the Multimedia folder, etc.The Project Manager Pod also contains the Baggage Files folder, which contains theindirectly linked files that are part of the project. The baggage files might include –PDF files, PowerPoint presentations, etc. Double-clicking on files within the Baggage Files folderopens the file in its associated application.Output Setup PodThe Output Setup Pod helps you to view and modify the output of the content based on the targeted device. It contains a hierarchical organization of the different output components such as the Window, Master Pages, Skins, Device Profiles, Screen Layouts, etc.Right-click on any container to change its properties.For example –If you want to alter the dimensions of the MS_HTML output window, right-click on the MS_HTML container in the Windows folder and select how you want the window to be displayed on the screen.Adobe RoboHelpThe arrangement of workspace elements such windows, pods and other elements is called an environment. Environments can be customized as desired by the user. There can be specific arrangements of windows and pods, which can be saved as an environment. Environments can then be recalled by selecting the environment from the Workspace menu on the upper right hand corner of the window. Environments are saved in an ‘.rhs file ’, which can be exchanged with other authors.Creating and saving an environmentArrange all the pods in the workspace. Click on the dropdown arrow next to the Workspace in the upper right hand corner of the RoboHelp window. Click on Save... and select a location and name for the workspace.Loading a Saved EnvironmentClick on the dropdown arrow next to the Workspace in the upper right hand corner of the RoboHelp window and select Load…Browse to the file location of the .rhs file and click on Open to load the environment.Deleting an EnvironmentTo delete an environment, navigate to the location on the disk, where the .rhs file was stored and simply delete the .rhs file pertaining to that environment.7.Adobe RoboHelpEnd of ebook previewIf you liked what you saw…Buy it from our store @ https://。
慧鱼robo使用说明
1简介----用ROBO PRO软件控制慧鱼模型 (3)1.1ROBO PRO软件的安装 (3)1.2安装ROBO接口板的USB驱动程序 (4)1.3第一步 (7)2编程前的硬件快速测试 (10)2.1接口板与电脑的连接 (10)2.2接口板的设置 (10)2.3错误连接:未与接口板连接? (12)2.4各部分都工作正常吗——接口板的测试- (12)3第一级:第一个控制程序 (14)3.1创建一个新程序 (14)3.2控制程序的模块 (15)3.3插入、移动和修改程序模块 (15)3.4连接各程序模块 (18)3.5对首个控制程序的测试 (19)3.6其他的程序模块 (20)3.6.1时间延迟 (20)3.6.2等待输入 (21)3.6.3脉冲计数 (21)3.6.4循环计数 (22)3.7在线和下载操作的差别 (22)3.8技巧和诀窍 (24)4第二级:运行子程序 (26)4.1第一个子程序 (27)4.2子程序库 (31)4.2.1子程序库的使用- (31)4.2.2你自己的子程序库的使用 (31)4.3编辑子程序代号 (32)5第三级:变量、控制板和指令 (34)5.1变量和指令 (34)5.2变量和多个流程 (35)5.3控制板 (36)5.4计时器 (39)5.5子程序指令输入 (40)5.6列表(阵列) (43)5.7运算器 ............................................... 446扩展接口板和多个接口板的控制 (48)6.1扩展接口板 (48)6.2多个接口板 (48)6.3子程序中的接口板分配 (50)6.4技巧和窍门 (50)6.5改变接口板的序列号或固件版本 (51)7程序模块的概述 (53)7.1基础模块(第一级) (53)7.1.1启动 (53)7.1.2结束 (53)7.1.3数字分支 (53)7.1.4模拟分支 (54)7.1.5时间延迟 (54)7.1.6电动机输出 (55)7.1.7灯输出(第二级) (56)7.1.8输入等待 (57)7.1.9脉冲计数器 (58)7.1.10循环计数器- (58)7.2子程序1/O(第2-3级) (59)7.2.1子程序进入(第二级) (59)7.2.2子程序退出(第二级) (59)7.2.3子程序指令的输入(第三级) (59)7.2.4子程序指令的输出(第三级) (60)7.3变量、序列......(第三级) (60)7.3.1变量(全局) (60)7.3.2局部变量 (61)7.3.3常数- (62)7.3.4定时器变量- (62)7.3.5序列 (63)7.4指令(第三级) (65)7.4.1=(赋值) (65)7.4.2+(加) (66)7.4.3– (减) (66)7.4.4向右 (66)7.4.5向左 (66)7.4.6停止 (66)7.4.7打开 (66)目录17.4.8关闭 (67)7.4.9文本 (67)7.4.10附加值 (67)7.4.11删除值 (67)7.4.12 交换值 (67)7.5比较,等待, ... (Level 3) (67)7.5.1判断(带数据输入) (68)7.5.2固定值的比较 (68)7.5.3比较 (68)7.5.4延时 (69)7.5.5等待.. (69)7.5.6脉冲计数 (70)7.6接口板的输入、输出- (70)7.6.1数字量输入 (70)7.6.2模拟量输入 (71)7.6.3红外输入 (72)7.6.4马达输出 (73)7.6.5灯输出 (73)7.6.6控制板输入 (74)7.6.7控制板输出 (75)7.7运算器 (75)7.7.1算术运算器 (76)7.7.2逻辑运算器 (76)8控制板模块和控制板:概述 (78)8.1显示 (78)8.1.1仪表 (78)8.1.2文本显示 (79)8.1.3指示灯 (80)8.2控制模块 (81)8.2.1按钮 (81)8.2.2滑块 (82)9绘图功能 (83)1简介---用ROBO PRO软件控制慧鱼模型你一定曾经问过自己,机器人是如何执行被分配的任务,看上去就象有一只无形的手在操纵它。
ROBCAD_Basic_Training汇总
新建或打开项目的基本步骤
ROBCAD项目特点: 1,项目中无法选择存储路径,项目首先需要设 定项目的存储路径; 2,项目模块和功能模块化分比较明细; 3,模型全局坐标与现场工位中,参考全局坐标 一致; 4,注意选择模式和捕捉方式。
Seite 20
Robcad training
基本功能介绍
YUMA
软件版本
当前模块
项目名称
项目路径
捕捉方式
选取方式
2、项目存储直接存储到设置的项目文件夹下,即 不能更改存储路径;
3、软件中所有新建对象,都是新起名后添加实体 对象;
Seite 23
Robcad training
新建项目名称
装载多个项目融合在一个环境中
创建项目和工位布局
YUMA
新建项目命名
Seite 24
Robcad training
基础模块(Modeling和Workcell)
YUMA
数据结构简介
Seite 17
Robcad training
基础模块(Modeling和Workcell)
YUMA
数据结构
Seite 18
Robcad training
YUMA
基本功能介绍
Seite 19
Robcad training
YUMA
Seite 30
Robcad training
5 、Create the sub-Libraries(创建库子目录) Data/Library Utilities/Lib/Create….name
YUMA
注意:此处菜单通常情况下为灰色,即非可用 状态,只有在先设置库的根目录情况下,此菜 单才会显示高亮化;若刚初次设置,需要将库 的设置结构存储,重新打开软件,进入该项目 下,菜单才会显示高亮化。
basic语言的基本命令
5.声音语句(SOUND) 【功能】在指定的持续时间内发出给定的声调的声音。 【说明】 ⑴ 本模块已集成在通用机器人主板的10号端口。 ⑵ 声音频率的值,是实际的频率的值,能发出人的耳朵听到的频率,实际应用中,可适当改变声音的 频率来校正音准,声音频率0为休止符。 6.无条件转移语句(GOTO) 【格式】 GOTO 行标号 【功能】无条件地转向指定的行标号去执行程序。 【说明】 ⑴ 标号是表示某一地址的符号。 ⑵ 标号以冒号结束, 并且出现在执行语句的前面,而不能出现在不可执行语句前。 7.注释语句(REM) 【格式】 REM 字符串 【功能】 释语句的主要作用是为了增强程序的可读性,在程序执行中并不被执行,即REM”后的语句 只是起到说明作用。 【说明】 ⑴ 为了提高程序的可读性,可以在程序的适当位置加上一些注释,注释可以放在程序的任何位置。 ⑵ REM后面可以是任何内容。 ⑶ REM可以用 单引号代替“’”。 【应用】 REM 机器人走图形 8.条件转移语句(IF/THEN) 【格式】 IF 条件表达式 THEN 标号 【功能】 根据条件表达式是否成立,决定程序的流向。 【说明】 ⑴ 在条件语句中,条件表达式的值如果为真,那么转到给定的标号去执行程序,否则执行条件语句的 下一个语句。 ⑵ 在使用条件语句前,要对算术表达式、关系表达式、逻辑表达式以及有关知识有一个初步的了解和 认识。 ① 算术表达式: 算术运算符:+(加)、-(减)、*(乘)、/(除)、^(乘方)、(、)圆括号 算术表达式:用算术运算符和括号,将常量、变量和函数连接起来的式子。 ② 关系表达式 关系运算符:=(等于)、<>(不等于)、=&g于)、>、(大于)< (小于)。 关系表达式的运算结果是一个逻辑值,逻辑值只有两个,真(1)和假(0)。条件成立,其值为真, 条件不成立,其值为假。 ③ 逻辑表达式 逻辑运算符:AND(与)、OR(或)、NOT(非)。 逻辑表达式:用逻辑运算符把多个关系表达式连接起来的式子。 逻辑表达式的运算结果是一个逻辑值。 运算结果如下: A AND B 只有A 为真,B为真,逻辑表达式为真。 A OR B A和B中只要一个为真,逻辑表达式为真。 ⑶ 在逻辑运算、关系运算、数学运算的组合条件判断中,必须使用括号来表明运算顺序。 ⑷ 各种数学运算的范围为:0~65535,不能超过,除法运算为整数除法,即取商。 9.读数语句/置数语句(READ/DATA) 【格式】 READ 变量1,变量2,……变量N DATA 常量1,常量2,……常量N, 【功能】用DATA语句中的数据,给READ语句中的相应的变量赋值。 【说明】 ⑴ 变量1,变量1,……变量N是用逗号分隔的一组变量,末尾不加符号。 ⑵ 常量1,常量2,……常量N是用逗号分隔的一组数据,末尾不加符号。 ⑶ READ/DATA语句必须配对使用,READ语句中只能是变量,不能是常量或表达式。 ⑷ DATA语句中的数据只能是常量,不能是变量或表达式,DATA语句非执行语句,Data语句的位置无 限制,但必须在END语句前。 ⑸ READ语句,顺序读取,如果读数超过了实际有的数据,则读入的数据不可知。 10.恢复数据区语句(RESTORE) 【格式】 RESTORE 【功能】RESTORE语句,将读数指针重新置到开始位置。 ⑴ RESTORE语句与读数语句/置数语句(READ/DATA)联合使用。
第3章 Robobasic语言
13
3.2 Robobasic语言基本语法
3)数据变量/常量和其他语法解释 (3) 常量和变量: 声明常量或变量时,遵守以下规则: ①首字母用英语字母,“_”可用在变量名和常量名中。 ②常量名和变量名长度不可超过64. ③相同常量名和变量名只能声明一次,大小写无区别 ④声明常量大于65536会出错
2)表达式和运算符 位运算符:在机器人控制器中常使用一些变量以简化输入输出 端口的位控制. 位运算符可以对这些变量执行计算. 对一位的计算有位或(OR),位与(AND),位异或. 在roboBASIC中,运算符左移“<<”,右移“>>”和“.”用来移动 一位到一个指定位置.
设A的值为33(00100001),B值为15(00001111),使用相应的运算符时得到以 下结果. A AND B 1(00000001) A OR B 47(00101111) A XOR B 46(00101110)
15
3.2 Robobasic语言基本语法
5)替换语句:用来替换变量的值。 使用“=”号,值在右边,变量、字母串、计算公式在左边。 例: A=B A.1 = 1 A = ADIN(0) A=3*2–1 A=C+B–A A = “1”
16
3.2 Robobasic语言基本语法
6)行标记:用来指示程序里的位置。 可以用字母和数字。规则如下: ①标记不能超过64个字符长,第一个字符必须为英语字母; ②标记符后跟“:”; ③0~65536的数字可用来做标记名字。不需“:”; ④标记符不能重复,大小写无区别。
3
3.2 Robobasic语言基本语法
Robobasic语言基本语法与BASIC类似,比C语言更容易入门 1) 标识符集 roboBASIC标识符集由英语字母、数字和特殊符号组成。这 些在roboBASIC有特殊意义的符号如下表所示 符号 描述 符号 描述 + 加 : 标志 减 = 相等或替换 * 乘 < 不相等 / 除 > 不相等 % 求余 << 位左移 . 位指示 >> 位右移 & 数字 ?? 文本 ?? 字符串
roboBasic中文命令使用手册
第六章
内存有关命令解释
机器人控制器中有 CPU 和内存,因此它也算的上微机。在保存和计算程序过程中,内 存起着至关重要的作用,机器人控制器的外部内存,是采用 EEPROM,用于保存用户程序。 内存执行计算是在 CPU 中进行的。
内部内存也被称作 RAM,由于机器人控制器 CPU 的特点,它同时也被称作寄存器。 内部内存和可用变量的数目息息相关,在一个程序创建的时候 。MR-C2000 系列控制器有 30 字节的变量空间。而 MR-C3000 有 256 字节的变量空间。其他剩余内存作为机器人控制 器内部使用。外部存储器与创建的程序的大小是相关 。MR-C2000 系列有 4KB,MR-C3000 的系列有 12K,32K,64K 字节的内存,这些主要取决于模型。
命令示例:
擦除字符液晶显示模块字符 命令格式:CLS 命令说明:使用 CLS 命令删除所有字符显示在液晶显示模块。当 CLS 命令执行,将删除所有 字符,光标将被显示在左上角。LCDINIT 和 CLS 之间存在一定的差异。在 CLS 命令中,仅仅 是字符被擦除,但 LCDINIT 命令,所有的信息,比如内部变量,将全部被删除。 命令示例:
命令示例:
第八章
发动机控制命令说明
机器人控制器可以控制伺服机和直流电动机。在直流电动机 控制器可以控制速度,方向, 此时无需点机输入输出命令。伺服电动机可旋转角度为 -90o~+90o 度。度在伺服电动机中应以 10~190 来表示,因为在 roboBASIC 伺服电动机中不支持负数。
ZERO
设定伺服零点。
第七章
LCD 模块的检测
与机器人控制器的配合使用而设计的液晶显示模块 MR-16202。液晶显示模块连接到 MR-C2000 系列控制器的 6 号端口。 MR-C3000 的拥有指定的液晶端口。下面解释控制液晶显 示模块的命令和显示字符串。
Roboguide操作手册附加轴基础篇
ROBOGUIDE 使用手册(附加轴基础篇)QQ群:413515425目录第一章概述 (3)1.1.ROBOGUIDE简介 (3)1.2.软件安装 (3)第二章建立基本仿真模型 (8)2.1建立Workcell (8)2.2 ROBOGUIDE仿真界面简介 (14)2.2.1 常用工具条功能介绍 (14)2.2.2 基本操作 (18)2.2.3 机器人相关功能 (19)2.2.4 其他功能介绍 (20)第三章外部轴实例介绍 (22)3.1 设置机器人属性 (22)3.2 添加外部轴和TCP设置 (23)3.2.1 添加外部轴的设置 (23)3.2.2 焊枪模型的载入 (25)第四章编程 (31)4.1 添加一个Part (31)4.2 编写TP程序 (32)4.3编程注意事项及技巧 (34)第五章创建机器人行走轴 (35)5.1电机控制 (35)5.2利用自建数模创建 (38)5.3利用模型库创建 (41)5.4点动行走轴 (41)1.1.ROBOGUIDE简介ROBOGUIDE是发那科机器人界进行模拟,在这个三维世界教,进一步来模拟它的运动轨迹期时间。
ROBOGUIDE是一款核ROBOGUIDE的仿真环境界面是传1.2.软件安装打开RoboguideV7.7,在安装ROBOGUIDEV7.7安装。
若点击后无法安装,可打动安装,如下图:第一章概述机器人公司提供的一个离线编程工具,它是围绕一个维世界中模拟现实中的机器人和周边设备的布局,通过动轨迹。
通过这样的模拟可以验证方案的可行性同时一款核心应用软件,具体的还包括搬运、弧焊、喷涂面是传统的WINDOWS界面,由菜单栏,工具栏,状态,双击文件夹下setup.exe。
首先会弹出如下图的对.7前,需要先安装上图中所列出的组件,点击Intal可打开安装文件下的Support文件夹,在其中选择绕一个离线的三维世通过其中的TP示性同时获得准确的周喷涂等其他模块。
Basic语言的基本指令
basic语言的基本命令1.赋值语句(LET)【格式】LET 变量=表达式【功能】将一个数据赋给一个变量。
【说明】⑴LET 可省略基本语句。
⑵表达式的值就是要赋给变量的数据。
⑶表达式可以是一个数值,也可以是一个算术式。
【应用】LET A=52.暂停语句(PAUSE)【格式】PAUSE 时间【功能】暂时停止程序的执行,或是延迟一段时间。
【说明】⑴在让机器人运动时,是通过时间的长短来控制机器人前进、后退的距离,以及左、右转动的角度。
⑵时间的具体值就是指时间的长短,它可以精确到毫秒。
【应用】PAUSE 1000 此语句的意思是延时时间设为1秒。
3.结束语句(END)【格式】END【功能】终止运行4.循环语句(FOR/NEXT)FOR 循环变量= 初值TO 终值STEP 步长(…………------ 循环体……)NEXT变量FOR 循环说明语句(循环入口)NEXT 循环终值语句(循环出口)【功能】循环语句用来执行固定次数的重复动作。
【说明】⑴循环变量的初值、终值和步长均可以是常数或变量。
⑵当步长为1时,STEP 可以省略。
⑶FOR/ NEXT需同时使用缺一不可,循环变量名要一致。
⑷循环的嵌套层数不超过8层。
5.声音语句(SOUND)【功能】在指定的持续时间内发出给定的声调的声音。
【说明】⑴本模块已集成在通用机器人主板的10号端口。
⑵声音频率的值,是实际的频率的值,能发出人的耳朵听到的频率,实际应用中,可适当改变声音的频率来校正音准,声音频率0为休止符。
6.无条件转移语句(GOTO)【格式】GOTO 行标号【功能】无条件地转向指定的行标号去执行程序。
【说明】⑴标号是表示某一地址的符号。
⑵标号以冒号结束,并且出现在执行语句的前面,而不能出现在不可执行语句前。
7.注释语句(REM)【格式】REM 字符串【功能】释语句的主要作用是为了增强程序的可读性,在程序执行中并不被执行,即REM”后的语句只是起到说明作用。
【说明】⑴为了提高程序的可读性,可以在程序的适当位置加上一些注释,注释可以放在程序的任何位置。
basic语言的基本命令
basic语言的基本命令(2009-09-24 20:34:02)转载标签:i t 分类:编译器的编写1.赋值语句(LET)【格式】LET变量=表达式【功能】将一个数据赋给一个变量。
【说明】⑴L ET 可省略基本语句。
⑵表达式的值就是要赋给变量的数据。
⑶表达式可以是一个数值,也可以是一个算术式。
【应用】 LET A=52.暂停语句(PAU SE)【格式】 PAU SE 时间【功能】暂时停止程序的执行,或是延迟一段时间。
【说明】⑴在让机器人运动时,是通过时间的长短来控制机器人前进、后退的距离,以及左、右转动的角度。
⑵时间的具体值就是指时间的长短,它可以精确到毫秒。
【应用】 PAUS E 1000 此语句的意思是延时时间设为1秒。
3.结束语句(EN D)【格式】E ND 【功能】终止运行4.循环语句(FOR/NEXT) FOR循环变量 = 初值TO终值STEP步长(………… ------ 循环体……)NEX T变量FOR 循环说明语句(循环入口)N EXT 循环终值语句(循环出口)【功能】循环语句用来执行固定次数的重复动作。
【说明】⑴循环变量的初值、终值和步长均可以是常数或变量。
⑵当步长为1时,STEP可以省略。
⑶F OR/ N EXT需同时使用缺一不可,循环变量名要一致。
⑷循环的嵌套层数不超过8层。
5.声音语句(SO UND)【功能】在指定的持续时间内发出给定的声调的声音。
【说明】⑴本模块已集成在通用机器人主板的10号端口。
⑵声音频率的值,是实际的频率的值,能发出人的耳朵听到的频率,实际应用中,可适当改变声音的频率来校正音准,声音频率0为休止符。
第3章 Robobasic语言
6
3.2 Robobasic语言基本语法
2)表达式和运算符 关系运算符:用来比较两个值. 输出为TRUE或FALSE. 输出用来在IF语句中控制程序流向. 运算符 关系 表达式 = 等于 X=Y <> 不等于 X <> Y < 小于 X<Y > 大于 X>Y <= 小于等于 X <= Y >= 大于等于 X >= Y
2)表达式和运算符 位运算符:在机器人控制器中常使用一些变量以简化输入输出 端口的位控制. 位运算符可以对这些变量执行计算. 对一位的计算有位或(OR),位与(AND),位异或. 在roboBASIC中,运算符左移“<<”,右移“>>”和“.”用来移动 一位到一个指定位置.
设A的值为33(00100001),B值为15(00001111),使用相应的运算符时得到以 下结果. A AND B 1(00000001) A OR B 47(00101111) A XOR B 46(00101110)
12
3.2 Robobasic语言基本语法
3)数据变量/常量和其他语法解释 (3) 常量和变量:常量在程序执行中值不改变. roboBASIC可定义byte类型和integer类型的常量. 常量类型根据数的范围自动确定. 一旦常量被定义,就不能被重定义. 定义常量对程序大小没有影响. 当一个数频繁使用时定义为常量能简化程序的修改. 例: CONST OFF = 0 CONST motor_speed=200 定义OFF和motor_speed两个字符串为常量,分别赋值0/200; 变量声明应使变量占用内存最小。
23
3.3 Robobasic语言命令
2.流控制命令解释 (2) FOR...NEXT 语句结构 FOR [循环变量] = [START] TO [END] [循环语句] NEXT [循环变量] 命令解释:FOR后需跟循环变量,类型为整型或字节型。
RoboClaw 2x7A 双通道电机控制器数据手册说明书
RoboClaw 2x7A, 34VDC Dual Channel Brushed DC Motor ControllerData Sheet Version 2.3Feature Overview:• 7.5 Amps Continuous Per Channel• 15 Amps Peak Per Channel• Channel Bridging Supported• Dual Quadrature Decoding• 9.8 million PPS Decoding• Multimode Interface• TTL Serial• USB Port• Analog Interface• R/C Input Control• Limit, Home and E-Stops• Up to 34VDC Operation• Air Cooled• 3.3v Compliant Control Outputs• 5v Tolerant Control Inputs• Programmable Current Limiting• Programmable Voltage Clamping• Closed and Open Loop Operation• Auto Tuning PID Feature• Mixed Control Modes• Data Logging• Diagnostic LEDs• Field Firmware Updates• Regulated 5VDC, 1A User Available Output• Over Voltage and Under Voltage Protection• Easy Tuning, Monitor and Setup with PC utilityDevice OverviewThe RoboClaw is an intelligent, high performance motor controller designed to control dual brushed DC motors. It can be controlled from USB, RC radio, PWM, TTL serial, analog and microcontrollers such as an Arduino or Raspberry Pi.RoboClaw automatically supports 3.3V or 5V logic levels, travel limit switches, home switches, emergency stop switches, power supplies, braking systems and contactors. A built-in switching mode BEC supplies 5VDC at up to 1 Amp for powering user devices. In addition power supplies can be utilized by enabling the built in voltage clamping control feature.A wide variety of feedback sensors are supported. This includes quadrature encoders, potentiometers and absoluteencoders which can be easily configured using the available auto tune function. With sensors, two brushed DCmotors can be controlled in closed loop mode allowing precise control over position and speed. With the ability to use potentiometers, servo systems can be created and controlled from any of RoboClaw’s interface modes.For greater control, built-in commands are available for controlling acceleration, deceleration, distance, speed, current sense, voltage limits and more. In addition, RC and analog modes can be configured by user defined settings to control acceleration and deceleration rates.RoboClaw incorporates multiple protection features including temperature, current, over voltage and under voltage limits.The protection features are self monitoring and protect RoboClaw from damage in any operating condition. User definable settings such as maximum current limit, maximum and minimum battery voltages are provided for more refined control.RoboClaw’s regenerative capabilities will charge a supply battery during slow down or breaking. It’s advance circuitry can change direction during full throttle without damage! RoboClaw also incorporates a LiPo cutoff mode to prevent battery damage.Multimode InterfaceRoboClaw’s I/O are voltage protected and can handle up to 5VDC. The I/O only output a high of 3.3V. This allows RoboClaw to be interfaced to 5V or 3V logic easily with no translation circuits required. RoboClaw can be connected directly to a Raspberry Pi or Arduino. All of RoboClaw’s inputs are internally pulled-up to prevent false triggers. Inputs can also be configured using the Motion Studio application.User Regulated Power OutputRoboClaw provides regulated power (BEC) for user devices. A high efficiency switching regulator supplies 5VDC at up to1 Amp. This voltage can be used to power external sensors, encoders, MCUs and other electronics. The regulated userpower is automatically current limited and thermally protected.Main BatteryThe peak operational input voltage depending on the model can be up to 34VDC, 60VDC or 80VDC. The modelsmaximum input voltage can not be exceeded. If the maximum voltage is exceed the motors will be disabled. Fully charged batteries maximum voltage must be taken into account when in use. RoboClaw is a regenerative motor controller. During regeneration, voltages can peak over the maximum rated voltage in which RoboClaw is designed to handle these over voltage spikes by braking the motors.Logic BatteryRoboClaw accepts a logic battery. The logic battery is also known as a backup battery. The user regulated power output (BEC) is by default powered from the main battery, unless a logic battery is detected. The logic battery source is coupled to the main battery through an on board automatic switch. If the main battery voltage drops below the logic battery input level, the logic circuit and user regulated power output will be drawn from the logic battery.SoftwareRoboClaw can be easily configured using the Motion Studio software tool. The Windows based application enables users to quickly configure RoboClaw. The software can be used during run time to monitor and control several operational parameters. Motion studio is available from the website. It can also be found in the Downloads section of the Basicmicro website or listed under the Download tabs on the production page.User ManualThis data sheet only covers model specific information and basic wiring. To properly setup and use RoboClaw refer to the RoboClaw User Manual available for download from .CoolingRoboClaw will generate heat. The maximum current ratings can only be achieved and maintained with adequate heat dissipation. The motor controller should be mounted so that sufficient airflow is provided. Which will dissipate the heat away from the motor controller during operation. Some models of RoboClaw include a built-in automatic cooling fan controller, which can be used to help maintain continuous currents under extreme conditions.Emergency StopThe motor controller should be wired using an external contactor, relay or high amperage mechanical switch to control the main power input. A second power source should be used to power the logic section in situations where the main power will be under heavy load. Voltage drops can occur from constant full load or high speed direction changes. Voltage drop can cause logic brown outs if only a main battery is used without a logic battery.USBThe motor controllers USB port should be used for configuration and debugging. The USB protocol is not designed for electrically noisy environments. The USB port will likely disconnect and not automatically recover during operation in electrically noisy environments. To recover from a dropped USB port, the motor controllers USB cable may require being unplugged and re-plugged in. The TTL serial control should be the preferred method of control in electrically noisy environments.Firmware UpdatesFirmware updates will be made available to add new features or resolve any technical issue. Before using RoboClaw for the first time it is recommended to update to the latest firmware. Download and install Motion Studio. Refer to the RoboClaw User Manual or Application Notes for additional information on updating the RoboClaw firmware.Hardware Overview:Control InterfaceThe RoboClaw uses standard male pin headers with 0.100” (2.54mm) spacing. The pin headers are ideal for use withstandard servo cables and other popular interface connectors. The table below list the pins and their respective functions. All pins are 5V tolerant and output 3.3V for compatibility with processor such as Raspberry Pi and Arduino. R/C pulse input, Analog and TTL can be generated from any microcontroller such as a Arduino or Raspberry Pi. The R/C Pulse input pins can also be driven by any standard R/C radio receiver . There are several user configurable options available. Toconfigure RoboClaw, install Motion Studio and connect it to an available USB port.Logic Battery (LB IN)The logic circuit of RoboClaw can be powered from a secondary battery wired to LB IN. A logic battery will prevent brownouts when the main battery is low or under heavy load. The positive (+) terminal is located at the board edge and ground (-) is the inside pin closest to the heatsink.Encoder Power (+ / -)The pins labeled + and - are the source power pins for encoders. The positive (+) is located at the board edge and supplies +5VDC. The ground (-) pin is near the heatsink. On RoboClaws with screw terminals, power for the encoders can be supplied by the 5VDC and GND on the main screw terminal.Encoder Inputs (1A / 1B / 2A / 2B)The encoders inputs are labeled EN1 and EN2. EN1 is for encoder 1 and EN2 is for encoder 2 which also correspond to motor channel 1 and motor channel 2. Quadrature encoder inputs are typically labeled 1A, 1B, 2A and 2B. ChannelA of both EN1 and EN2 are located at the board edge on the pin header. ChannelB pins are located near the heatsinkon the pin header. Quadrature encoders are directional. When connecting encoders make sure the leading channel for the direction of rotation is connected to A. If one encoder is backwards to the other you will have one internal counter counting up and the other counting down. Use Motion Studio to determine the encoders direction relative to the motors rotation. Encoder channels A and B can be swapped in software using Motion Studio to avoid re-wiring the encoder or motor.Control Inputs (S1 / S2 / S3 / S4 /S5)S1, S2, S3, S4 and S5 are configured for standard servo style headers I/O (except on ST models), +5V and GND. S1 and S2 are the control inputs for serial, analog and RC modes. S3 can be used as a flip switch input, when in RC or Analog modes. In serial mode S3, S4 and S5 can be used as emergency stops inputs or as voltage clamping control outputs.When configured as E-Stop inputs, they are active when pulled low. All I/O have internal pull-ups to prevent accidental triggers when left floating. S4 and S5 can be configured as home switch and limit switch inputs. The pins closest to the board edge are the I/0s, center pin is the +5V and the inside pins are ground. Some RC receivers have their own supply and will conflict with the RoboClaw’s 5v logic supply. It may be necessary to remove the +5V pin from the RC receivers cable in those situations.Cooling Fan ControlThe cooling fan control will automatically turn on and off a fan based on RoboClaws temperature. The fan will turn on when the board temperature reaches 45°C and will automatically turn off when the board temperature falls below 35°C.The fan control circuit can power a 5VDC fan at up to 230mA. A wide range of fans can be used. The CFM rating of the fan will determine how effective the fan is at cooling. A tested fan is available from DigiKey under part number:259-1577-ND. However any fan can be used provided it meets the electrical specifications outlined above.Main Battery Screw TerminalsThe main power input can be from 6VDC to 34VDC on a standard RoboClaw and 10.5VDC to 60VDC or 80VDC on an HV (High Voltage) RoboClaw. The connections are marked + and - on the main screw terminal. The plus (+) symbol marks the positive terminal and the negative (-) marks the negative terminal. The main battery wires should be as short as possible.Do not reverse main battery wires or damage will occur.DisconnectThe main battery should include a quick disconnect in case of a run away situation and power needs to be cut. The switch must be rated to handle the maximum current and voltage from the battery. Total current will vary depending on the type of motors used. A common solution would be an inexpensive contactor which can be sourced from sites like Ebay.A power diode rated for approximately 2 to 10 Amps should be placed across the switch/contactor to provide a return tothe battery when power is disconnected. The diode will provide the regenerative power a place to go even if the switch is open.Motor Screw TerminalsThe motor screw terminals are marked with M1A / M1B for channel 1 and M2A / M2B for channel 2. For a typical differential drive robot the wiring of one motor should be reversed from the other. The motor and battery wires should be as short as possible. Long wires can increase the inductance and therefore increase potentially harmful voltage spikes.Control ModesRoboClaw has 4 main functional control modes explained below. Each mode has several configuration options. The modes can be configured using Motion Studio or the built-in buttons. Refer to the RoboClaw User Manual for installation and setup instructions.RCUsing RC mode RoboClaw can be controlled from any hobby RC radio system. RC input mode also allows low powered microcontrollers such as a Basic Stamp to control RoboClaw. Servo pulse inputs are used to control the direction and speed. Very similar to how a regular servo is controlled. Encoders are supported in RC mode, refer to the RoboClaw user manual for setup instructions.AnalogAnalog mode uses an analog signal from 0V to 2V to control the speed and direction of each motor. RoboClaw can be controlled using a potentiometer or filtered PWM from a microcontroller. Analog mode is ideal for interfacing RoboClaw with joystick positioning systems or other non microcontroller interfacing hardware. Encoders are supported in Analog mode, refer to the RoboClaw user manual for setup instructions.Simple SerialIn simple serial mode RoboClaw expects TTL level RS-232 serial data to control direction and speed of each motor.Simple serial is typically used to control RoboClaw from a microcontroller or PC. If using a PC, a MAX232 or an equivalent level converter circuit must be used since RoboClaw only works with TTL level inputs. Simple serial includes a slave select mode which allows multiple RoboClaws to be controlled from a signal RS-232 port (PC or microcontroller). Simple serial is a one way format, RoboClaw can only receive data. Encoders are not supported in Simple Serial mode.Packet SerialIn packet serial mode RoboClaw expects TTL level RS-232 serial data to control direction and speed of each motor. Packet serial is typically used to control RoboClaw from a microcontroller or PC. If using a PC a MAX232 or an equivalent level converter circuit must be used since RoboClaw only works with TTL level input. In packet serial mode each RoboClaw is assigned a unique address. There are 8 addresses available. This means up to 8 RoboClaws can be on the same serial port. Encoders are supported in Packet Serial mode, refer to the RoboClaw user manual for setup instructions.USB ControlUSB can be used in any mode. When RoboClaw is in packet serial mode and another device, such as an Arduino, is connected commands from the USB and Arduino will be executed and can potentially override one another. However if RoboClaw is not in packet serial mode, motor movement commands will be overiden by Analog or RC pulse input. USB packet serial commands can then only be used to read status information and set configuration settings.There are several wiring configurations for RoboClaw. Each configuration will have unique wiring requirements to ensure safe and reliable operation. The diagram below illustrates a very basic wiring configuration used in a small motor system where safety concerns are minimal. This is the most basic wiring configuration possible. All uses of RoboClaw should include some kind of main battery shut off switch, even when safety concerns are minimal. Never underestimate a system with movement when an uncontrolled situation arises.In addition, RoboClaw is a regenerative motor controller. If the motors are moved when the system is off, it could cause potential erratic behavior due to the regenerative voltages powering the system. The regenerative voltages can cause problems if a power supply is used for main power. A voltage clamping circuit is recommended to dump the excessive voltages. See the RoboClaw user manual or Application Notes for voltage clamping setup and wiring diagrams.R/C ModeThe below wiring diagram is very basic and for use with R/C mode. R/C mode can be used when pairing RoboClaw with a standard R/C receiver. R/C mode can also be used with a microcontroller and using servo pulses to control RoboClaw. The RoboClaw supplies power to the R/C system. If the R/C receiver used, has its own power the 5V pin on the 3 pin header must be remove otherwise it will interfere with RoboClaw’s BEC.In all system with movement, safety is a concern. This concern is amplified when dealing with higher voltages. The wiring diagram below illustrates a properly wired system. An external main power cut off is required (SW1). The external cut off can consist of a high amperage mechanical switch or a contactor.When the RoboClaw is switched off or a fuse is blown, a high current diode (D1) is required to create a return path to the battery for potential regenerative voltages. In addition a pre-charge resistor (R1) is required to reduce the high inrush currents to charge the on board capacitors. A pre-charge resistor (R1) should be around 1K, 1/2Watt for a 60VDC motor controller which will give a pre-charge time of about 15 seconds. A lower resistances can be used with lower voltages to decrease the pre-charge time.Closed Loop ModeA wide range of sensors are supported for closed loop operation. RoboClaw supports dual quadrature encoders (up to9.8 million PPS), absolute encoders, potentiometers and hall effect sensors. The wiring diagram below is an exampleof closed loop mode using quadrature encoders. Quadrature encoders are directional. RoboClaw’s internal counters will increment for clockwise rotation (CW) and decrement for counter clockwise rotation (CCW). When wiring encoders A andB channels it is important they are wired to match the direction of the motor. If the encoder is wired in reverse it cancause a run away condition. All motor and encoder combinations will need to be tuned (see the RoboClaw user manual).Logic BatteryAn optional logic battery is supported. Under heavy loads the main power can suffer voltage drops, causing potential logic brown outs which may result in uncontrolled behavior . A separate power source for the motor controllers logic circuit, will remedy potential problems from main power voltage drops. The logic battery maximum input voltage is34VDC with a minimum input voltage of 6VDC. The 5V regulated user output is supplied by the secondary logic battery if supplied. The mAh of the logic battery should be determined based on the load of attached devices powered by the regulated 5V user output.Logic Battery JumperThe configuration below utilizes a logic battery. Older models of RoboClaw have a logic battery jumper . On models where the LB-MB header is present the jumper must be removed when using a separate logic battery. If the header for LB-MB is not present, then the RoboClaw will automatically set the logic battery power source.R1D1Bridging ChannelsRoboClaws dual channels can be bridge to run as one channel, effectively doubling its current capability for one motor.Damage will result if RoboClaw is not set to bridged channel mode before wiring. Download and install Motion Studio.Connect the motor controller to the computer using an available USB port. Run Motion Studio and in general settings check the option to combine channels. Then click “Write Settings” in the device menu. When operating in bridged mode the total peak current output is combined from both channels. Each channel will indicate the amount of current being drawn for that channel. The peak current run time is dependant on heat build up. Adequate cooling must be maintained.For more information see the RoboClaw user manual.Bridged Channel WiringWhen bridged channel mode is active the internal driver scheme for the output stage is modified. The output leads must be wired correctly or damage will result. One side of the motor is connected to M1A and M2B. The other side of the motor is then connected to M1B and to M2A.DimensionsNotes:1. Peak current is automatically reduced to the typical current limit as temperature approaches 85°C.2. Current is limited by maximum temperature. Starting at 85°C, the current limit is reduced on a slope with a maximumtemperature of 100°C, which will reduce the current to 0 amps. Current ratings are based on ambient temperature of 25°C.3. RS232 format is 8Bit, No Parity and 1 Stop bit.4. Condensing humidity will damage the motor controller.WarrantyBasicmicro warranties its products against defects in material and workmanship for a period of 1 year. If a defect is discovered, Basicmicro will, at our sole discretion, repair, replace, or refund the purchase price of the product in question.*******************************.Noreturnswillbeacceptedwithouttheproperauthorization.Copyrights and TrademarksCopyright© 2015 by Basicmicro, Inc. All rights reserved. All referenced trademarks mentioned are registered trademarks of their respective holders.DisclaimerBasicmicro cannot be held responsible for any incidental or consequential damages resulting from use of products manufactured or sold by Basicmicro or its distributors. No products from Basicmicro should be used in any medical devices and/or medical situations. No product should be used in any life support situations.ContactsEmail:********************Techsupport:**********************Web: Discussion ListA web based discussion board is maintained at Technical Support*******************************************************************,byopeningasupportticketontheIon Motion Control website or by calling 800-535-9161 during normal operating hours. All email will be answered within 48 hours.。
TrueBasic常用命令简介-完整
TrueBasic常⽤命令简介-完整True Basic 常⽤命令简介1. 将两个Hello程序以及SUBS拷到⾃建的⽬录下。
双击Hello(应⽤程序),屏幕将分为上下两窗⼝,上窗⼝称为编辑窗⼝,下窗⼝成为操作窗⼝。
2. 按F1键,光标移到上窗⼝。
按F2键,光标移到下窗⼝。
3. Save ⽂件名――-将当前程序以该⽂件名存盘。
4. New---清除当前内存。
5. Bye ---退出True Basic6. Files ---列出当前⽬录中的所有TB⽂件。
7. Old ⽂件名-――读⼊⼀个True Basic程序⽂件。
8. Replace ---将修改后的程序覆盖原程序⽂件。
9. Run 或按F9 ---运⾏程序。
10.Include ⽂件2 --将⽂件2插⼊到当前⽂件刚才光标所在⾏的下⼀⾏。
然后Replace11. CTRL+Break---中断运⾏12. !或Rem――――注释语句(不执⾏)13. F4键--将⾏进⾏标志。
若要将某⼀段进⾏标志,则将光标移到这段的第⼀⾏,按F4键,然后将光标移动这段的最后⼀⾏,再按F4键,则整段都被标志了。
14. Back Space---被标志⾏与上⼀⾏合并15. F5键---将被标志⾏(段)复制到光标所在的下⼀⾏16. F6键---将被标志⾏(段)移到到光标所在的下⼀⾏17. OPTION NOLET ------ 可以省略所有赋值语句前的LET。
常⽤绘图语句:1. Set window Xmin,Xmax,Ymin,Ymax---设置窗⼝。
注:(Xmax-Xmin):(Ymax-Ymin)=4:32. PLOT XA,YA;XB,YB ---------画AB连线。
3. PLOT XA,YA;XB,YB;XC,YC -----画ABC折线。
4. Pause 秒数----暂停⼏秒。
5. Box Circle Xmin,Xmax,Ymin,Ymax -------画椭圆。
Robocode说明
Robocode 是一个很容易使用的机器人战斗仿真器,可以在所有支持Java 2 的平台上运行。
您创建一个机器人,把它放到战场上,然后让它同其他开发者们创建的机器人对手拼死战斗到底。
Robocode 里有一些预先做好的机器人对手让你入门,但一旦您不再需要它们,就可以把您自己创建的机器人加入到正在世界范围内形成的某个联盟里去和世界最强手对阵。
每个Robocode 参加者都要利用Java 语言元素创建他或她的机器人,这样就使从初学者到高级黑客的广大开发者都可以参与这一娱乐活动。
初级的Java 的开发者们可以学习一些基础知识:调用API 代码、阅读Javadoc、继承、内部类、事件处理等等。
高级开发者们可以在构建“最优品种”的软件机器人全球竞赛中提高他们的编程技巧。
在本文中,我们将介绍Robocode,并指导您从构建您平生第一个Robocode 机器人开始征服世界。
我们还将看一下迷人的“后台”机制,正是它使得Robocode 起作用。
首先需要安装java编译环境和运行环境,编译环境简称JDK,在这里我们使用JDK6u18,运行jdk-6u18-windows-i586.exe,默认安装,中途会自动安装java运行环境JRE6u18。
注意:安装32位JDK即可,64位暂时有问题,请谨慎安装。
安装完成后,我们就要配置java在系统中的环境变量了:用鼠标右击“我的电脑”->属性->高级->环境变量系统变量->新建->变量名:JAVA_HOME 变量值:E:\Program Files (x86)\Java\jdk1.6.0_18 (这是默认的JDK安装路径)系统变量->编辑->变量名:Path 在变量值的最前面加上:%JAVA_HOME%\bin;(若已经有Path 项,无须另外新建,直接在后面加,但需用;与前面已有的项分隔开)系统变量->新建->变量名:CLASSPATH 变量值:.;%JAVA_HOME%\lib;%JAVA_HOME%\lib\dt.jar;%JAVA_HOME%\lib\tools.jar;最后测试下环境变量是否设置成功在左下角的搜索框中键入cmd回车输入javac如果出现如下信息用法:javac <选项> <源文件>其中,可能的选项包括:-g 生成所有调试信息-g:none 不生成任何调试信息-g:{lines,vars,source} 只生成某些调试信息-nowarn 不生成任何警告-verbose 输出有关编译器正在执行的操作的消息-deprecation 输出使用已过时的API 的源位置-classpath <路径> 指定查找用户类文件的位置-cp <路径> 指定查找用户类文件的位置-sourcepath <路径> 指定查找输入源文件的位置-bootclasspath <路径> 覆盖引导类文件的位置-extdirs <目录> 覆盖安装的扩展目录的位置-endorseddirs <目录> 覆盖签名的标准路径的位置-d <目录> 指定存放生成的类文件的位置-encoding <编码> 指定源文件使用的字符编码-source <版本> 提供与指定版本的源兼容性-target <版本> 生成特定VM 版本的类文件-version 版本信息-help 输出标准选项的提要-X 输出非标准选项的提要-J<标志> 直接将<标志> 传递给运行时系统恭喜,您的Java环境变量配置成功!若出现'javac' 不是内部或外部命令,也不是可运行的程序或批处理文件。
Robot命令
Robot命令Robot 命令Robocode 机器人的命令集都收录在 Robocode API Javadoc 中。
这些命令都是 robocode.Robot 类的公共方法。
(1)移动机器人、炮和雷达移动机器人及其装备的基本命令:turnRight(double degree) 和 turnLeft(double degree) 使机器人转过一个指定的角度。
ahead(double distance) 和 back(double distance) 使机器人移动指定的像素点距离;这两个方法在机器人碰到墙或另外一个机器人时即告完成。
turnGunRight(double degree) 和 turnGunLeft(double degree) 使炮可以独立于坦克车的方向转动。
turnRadarRight(double degree) 和turnRadarLeft(double degree) 使炮上面的雷达转动,转动的方向也独立于炮的方向(以及坦克车的方向)。
这些命令都是在执行完毕后才把控制权交还给程序。
此外,转动坦克车的时候,除非通过调用下列方法分别指明炮(和雷达)的方向,否则炮(和雷达)的指向也将移动。
setAdjustGunForRobotTurn(boolean flag):如果flag 被设置成 true,那么坦克车转动时,炮保持原来的方向。
setAdjustRadarForRobotTurn(boolean flag):如果 flag 被设置成 true,那么坦克车(和炮)转动时,雷达会保持原来的方向。
setAdjustRadarForGunTurn(boolean flag):如果 flag 被设置成true,那么炮转动时,雷达会保持原来的方向。
而且,它执行的动作如同调用了 setAdjustRadarForRobotTurn(true)。
(2)获取关于机器人的信息getX() 和 getY() 可以捕捉到机器人当前的坐标。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
RoboBASIC 语言不支持负数。因此,运算表达式中不可以在数字之前添加 “+”与“-”来表示正负数,否则表达式运算会出错。 变量声明应选用合适的数字类型,以便于节省存储空间。 进制数 由于 roboBASIC 用来控制硬件,因此使用十六进制数、二进制数以及八进制 数比使用十进制数更为方便。在 roboBASIC 中,可以使用二进制数(BIN) 、八 进制数(OCT) 、十进制数(DEC)以及十六进制数(HEX) ,各个进制数的表示 方法如下表所示。 进制数 二进制数 八进制数 十进制数 十六进制数 常量和变量 在程序执行过程中,常量的值不发生变化。roboBASIC 语言可定义类似于字 节类型(BYTE)和整型(INTEGER)的常量。常量类型根据数的范围自动确定。 一旦常量被定义,就不能再被定义了。定义常量对程序大小没有影响。当使用某 些频繁的数字时,可把它们定义为常量,这样程序修改会变得更为方便可靠。 例如: 声明 &B &O 无 &H 可用数字 0,1 0,2,…,7 0,1,2,…,9 0,1,2,…,9, A,B,…F 例子 &B111101 &O75 61 &H3D
③ ③
AIMOTOROFF AIMOTORIN SETON ALLON
③
SETOFF
③
退出 setup 功能 对所有电机设置 setup 功能 退出对所有电机的 setup 功能 读取电机当前值并保持当前位置 设置电机模式
ALLOFF③ GETMOTORSET③ MOTORMODE④
电机组分配相关参数 G6A③ G6B③ G6C③ G6D③ G6E③ G8A③ G8B G8C G8D G12 G16 G24
数字信号输入输出命令 IN OUT BYTEIN BYTEOUT INKEY② STATE PULSE TOGGLE KEYIN
③
从输入端口读取数据 发送信号到输出端口 从输入端口读取字节型数据 发送字节型数据到输出端口 从输入端口输入键值 输出端口状态 发送脉冲信号到输出端口 反转输出端口状态 接受模拟键盘输入
roboBASIC v2.10 命令手册
第一章 roboBASIC 命令概要
命令概要 roboBASIC 语言以通用 BASIC 编程语言为基础,为了方便控制机器人而开 发的专用性编程语言,是(株式社会)迷你机器人公司研制并登记注册的编程软 件。roboBASIC 语言与 BASIC 语言相比,其最大特点是添加了方便控制机器人 的专用命令。 与声明/定义相关的命令 DIM AS CONST BYTE INTEGER 流程控制命令 IF THEN ELSE ELSEIF ENDIF FOR TO NEXT GOTO GOSUB RETURN END STOP RUN WAIT DELAY BREAK② 条件语句开始 条件语句为真时执行下一条语句 条件语句为假时执行下一条语句 开始另一个条件语句 条件语句结束 循环语句开始 指定一条循环语句的循环次数范围 循环语句结束 无条件转移 调用子程序 从子程序返回 结束程序 停止程序执行 连续执行程序 等待直到程序完成 延迟一定时间再执行程序 暂停程序执行并转换到调试模式 声明变量 在声明变量时指定变量类型 声明常量 声明变量时定义为字节类型 声明变量时定义为整型
使用逻辑异或条件表达式 对所有位求反
设置电机0点(中心点) 开启电机 关闭电机 同时操作多个电机 设置电机速度 设置电机加速度 设置电机方向 开启/关闭同时电机控制操作 控制单个电机 直流电机的脉冲宽度控制 以最大速度转动伺服电机 开启/关闭伺服电机的高速模式 根据声明的位置转动电机 设置机器人特定姿势 改变脉冲宽度和频率 同时操作 24 个电机 设置初始运动姿态 读取电机当前位置值 设置使用 AI 电机 取消使用 AI 电机 读取 AI 电机当前位置值 设置使用 setup 功能
第二章 roboBASIC 语法概要
由于 roboBASIC 语法是基于通用 BASIC 编程语言之上的,因此 roboBASIC 类似于 BAISC 语言。以下主要叙述 roboBASIC 的常见语法。 标识符集 roboBASIC 标识符集由汉字、英文字母、数字和特殊文字组成。列于下表中 的符号,在 roboBAISC 语言中具有其特殊含义。 符号 + * / % . & ?? ?? : = < > << >> 表达式及运算符 表达式是可以计算出数值的组合,该组合由常数、变量以及数字与可用操作 运算符连接组成。运算符对给定值执行算术或者逻辑运算。在 roboBASIC 语言 中,运算符分类如下表所示。 类别 算术运算符 关系运算符 逻辑运算符 位运算符 功能 执行算术计算 比较数值大小 比较组合条件或者执行位运算 按位运算 说明 加 减 乘 除 求余 位指定号 数字 文本 字符串 标志 相等或赋值 小于 大于 位左移 位右移
G32③ 与声音控制相关的命令 BEEP② SOUND② PLAY② MUSIC③ TEMPO③ 与外部通信相关的命令 RX② TX
② ② ②
用压电蜂鸣器发出警告声 用压电蜂鸣器发出声音 用压电蜂鸣器播放歌曲 用压电蜂鸣器播放音乐 设置声音节奏
通过RX端口接收RS232信号 通过TX端口传输RS232信号 通过mini通讯端口接收miniBUS信号 通过mini通讯端口传输miniBUS信号 通过RX端口接收RS232信号 通过TX端口传输RS232信号
MINIIN ERX
③
MINIOUT ETX③
模拟信号处理相关命令 AD③ REMOCON③ SONAR③ 从AD端口读取模拟信号值 从红外远程控制器中读取按键值 从超声波端口读取距离
RCIN③ GYRODIR③ GYROSET③ GYROSENSE③ 处理跳转命令
ON...GOTO
从RC(遥控器)读取输入值 根据陀螺仪(gyro)输入的设置电机转动方向 给电机组分配相应的陀螺仪进行控制 设定相对应电机组里电机的陀螺仪传感器灵敏度
CONST OFF = 0 CONST motor_1 = 3 CONST motor_1_speed = 200 用于程序中的变量是数据存储位置的名字。在迷你机器人控制器中,使用的 变量数是有限, 因此变量声明应设计为在符合对象要求的情况下使变量所占用的 存储量最小。 DIM motor_1_delay AS INTEGER DIM sensor_left AS BYTE 声明常量或变量时,遵守以下规则: 1) 首字母用英语字母或者汉字。汉字、英文、数字与“_”可用在变量名和常 量名中。 2) 常量名和变量名的长度不可超过 64 个字符。 3) 相同常量名和变量名只能声明一次,即不能重复声明,不区分大小写。 4) 声明的常量值不得超过 65535,否则会出错
同一条指令中使用多个运算符时,将以下顺序计算。 1) 算术运算/位运算 2) 关系运算
3) 逻辑运算 数字、变量、常数以及其它语法解释 因为 roboBASIC 为控制硬件专门开发的语言,所以不支持通用 BAISC 所支 持的与字符串相关的变量或者常量。 数据类型 roboBASIC 语言中,数据类型分为字节类型与整型两类。相对应数据类型的 数值范围如下表所示。 数字类型 字节型(BYTE) 整型(INTEGER) 存储大小 1 个字节(8 位) 2 个字节(16 位) 范围 0~255 0~65535
算术运算符 算术运算符是执行计算的标识符。和一般 BASIC 语言一样,+、-、*、/、%(或 MOD)在 roboBASIC 中也可以使用,但在 roboBASIC 和 BASIC 间有些不同的地方。 1)运算符中没有优先级 在 roboBAISC 中,不准使用括号()运算符号。 例: A=1,B=2,C=3 对于常规的 BAISC 语言,A+B*C=1+2*3=1+6=7,即乘法优先于加法。对于 该式,如果要先进行加法,则需要把该式改为(A+B)*C; 而对于 roboASIC 语言,运算符没有优先级,按顺序从左往右运算,如 A+B*C=1+2*3=3*3=9; 2)复杂的数学计算会产生意想不到的错误 因此,复杂数学计算式应该分解为2次或3次计算。 例: D=A*B+C F=A*B/C*D+E 将被忽略。 求余计算使用%或MOD,输出结果为余数。 关系运算 关系运算符用来比较两个值。数值比较结果为 TRUE 或 FALSE。数值比较结果 主要用于 IF 语句中的程序流向控制。 运算符 = <> < > <= >= 关系 等于 不等于 小于 大于 小于等于 大于等于 表达式 A= B A <> B A< B A> B A <= B A >= B (通过) (避免复杂算术计算)
③ ③ ③ ③ ③ ③
将0-5号电机分配给A组 将6-11号分配给B组 把12-17分配给C组 把18-23分配给D组 把24-29分配给E组 把0-7分配给A组 把8-15分配给B组 把16-23分配给C组 把24-31分配给D组 分配0-11号伺服电机 分配0-15号伺服电机 分配0-23号伺服电机 分配0-31号伺服电机
每个运算的输出如下表所示。下表中的“T”代表 TRUE,“F”代表 FALSE X 与 Y 的值 X T T F F 位运算 位运算可以为机器人控制器中每个变量执行计算,这样更容易对输入/输出 端口进行按位控制。 位运算有位或(OR)、位与(AND)以及位异或三类。在 roboBASIC 语言中,运算 符左移“<<” 、右移“>>”和“.”用来移动某一位到指定位置。 设 A 的值为 33(二进制形式 为 00100001),B 的值为 15(二进制形式为 00001111),对两数使用相应的位运算符时可得到以下结果。 运算 A AND B A OR B A XOR B A << 1 A >> 1 A.0 结果 1(0000 0001) 47(0010 1111) 46(0010 1110) 66(0100 0010) 16(0001 0000) 1(A 的第 0 位) Y T F T F X AND Y T F F F 结果 X OR Y T T T F X XOR Y F T T F