ABB机器人IRC5 系列控制器配套的示教器本身也是一台计算机,在其上微软的嵌入式操作系统Windows CE。机器人出厂时通常带有通用的操作界面,但是,不同的应用场合可能需要不同的操作处理,ABB机器人示教器也支持用户进行定制化的二次开发。对于一些简单的操作界面的开发,用户可以在虚拟仿真软件Robotstudio中使用ScreenMaker功能完成。但是对于一些较为复杂的操作界面,用户则需要使用Visual Studio软件,通过调用示教器二次开发接口FlexPendant SDK进行开发。本期就来为大家介绍一下使用Visual Studio软件对机器人示教器进行二次开发的一些基础知识。

Robotstudio软件版本:RobotStudio 6.08

SDK版本:FlexPendant SDK.6.08.01

开发软件版本:Microsoft Visual Studio Professional 2008 EN

注:VS软件一定要使用VS 2008的英文版本,否则无法加载开发模板,记住:一定要安装VS 2008英文版、VS 2008英文版、VS 2008英文版,重要的事情说三遍。

一、开发环境搭建

ABB机器人示教器二次开发的环境搭建比较简单,只需要先安装开发编译软件VS 2008,然后在安装RobotStudio软件,最后安装示教器二次开发接口FlexPendant SDK即可,这里要注意的是必须先安装VS 2008,后安装二次开发接口FlexPendant SDK,若是使用真实机器人测试开发程序的话RobotStudio软件可以不安装。

二、开发项目创建

1.打开VS 2008软件,创建一个新项目,创建时项目类型下选择Visual C#下的“FlexPendant”类型,左侧的模板下选择“ABB Application 6.08”。下方可以设置项目名称、项目保存位置、项目解决方案名称。




java robot无法操作DNF robotstudio无法加载dll_java robot无法操作DNF


注:项目名称一定要以“TpsView”开头,否则在编译项目时将无法通过ABB验证工具的验证,并生成错误。

2.在FlexPendant SDK Project Wizard对话框中Name后设置名称,如Hello World,其他暂时参数保持默认即可。


java robot无法操作DNF robotstudio无法加载dll_System_02


三、专业工具开发控件添加

1.右侧项目浏览窗口中,点击“View Designer”工具按钮,打开示教器界面设计窗口。

2.左侧点开Toolbox窗口,并将其固定。

3.Toolbox窗口空白处任意位置右击鼠标,在弹出的快捷菜单中选择“Add Tab”,弹出控件选项卡,这里可以设置选项卡名称,如FlexPendant Controls。


java robot无法操作DNF robotstudio无法加载dll_System_03


4.选项卡添加完成后将其展开,在其下的空白处任意位置右击鼠标,在弹出的快捷菜单中点选“Choose Items…”,在弹出的Choose Toolbox Items对话框中,浏览至FlexPendant SDK安装目录,然后添加以下三个.dll文件。

  • ABB.Robotics.Tps.Windows.Forms.dll
  • ABB.Robotics.GTPU.Windows.Forms.dll
  • ABB.Robotics.DataBinding.dll


java robot无法操作DNF robotstudio无法加载dll_c# 无法加载oraops.dll_04


说明:FlexPendant SDK 安装目录为C:Program Files (x86)ABB Industrial ITRobotics ITSDKFlexPendant SDK 6.08bin。

5.加载完成后,左侧Toolbox窗口FlexPendant Controls选项卡下出现ABB机器人示教器专用开发控件。


java robot无法操作DNF robotstudio无法加载dll_Windows_05


四、示教器测试程序窗口配置

从FlexPendant Controls选项卡下分别拖拽1个Button控件与1个TpsLabel控件至示教器界面设计窗口中。


java robot无法操作DNF robotstudio无法加载dll_Windows_06


五、测试程序代码编写

1.双击添加的Button1控件,打开Button1控件Click事件代码编辑窗口。在按钮控件的Click事件函数下编写如下代码:


java robot无法操作DNF robotstudio无法加载dll_java robot无法操作DNF_07


完整程序代码如下所示:

using System;using System.Drawing;using System.Collections;// ABB namespacesusing ABB.Robotics.Controllers;using ABB.Robotics.Tps.Taf;using ABB.Robotics.Tps.Windows.Forms;// Compliance Tool Info [assembly: TpsView("Hello World", "tpu-Operator32.png", "tpu-Operator16.png", "TpsViewIRC5App1.dll", "TpsViewIRC5App1.TpsViewIRC5App1", StartPanelLocation.Left, TpsViewType.Static, TpsViewStartupTypes.Manual)]namespace TpsViewIRC5App1{    ///     /// Summary description of the view.    ///     public class TpsViewIRC5App1 : TpsControl, ITpsViewSetup, ITpsViewActivation    {        private Button button1;        private TpsLabel tpsLabel1;        public TpsViewIRC5App1()        {            //            // Required for Windows Form Designer support            //            InitializeComponent();            //            // ToDo: Add any constructor code after InitializeComponent call            //        }        ///         /// This is where you clean up any remaining resources used by your application before         /// the application itself is disposed of by the host (TAF - TeachPendant Application Framework).         /// The method is called by the host when the application is closed down.        ///         protected override void Dispose(bool disposing)        {            if (!IsDisposed)            {                try                {                    if (disposing)                    {                        //ToDo: Call the Dispose method of all FP SDK instances that may otherwise cause memory leak                    }                }                finally                {                    base.Dispose(disposing);                }            }        }        #region Windows Form Designer generated code        ///         /// Required method for Designer support - do not modify        /// the contents of this method with the code editor.        ///         private void InitializeComponent()        {            this.tpsLabel1 = new ABB.Robotics.Tps.Windows.Forms.TpsLabel();            this.button1 = new ABB.Robotics.Tps.Windows.Forms.Button();            this.SuspendLayout();            //             // tpsLabel1            //             this.tpsLabel1.BorderStyle = System.Windows.Forms.BorderStyle.None;            this.tpsLabel1.Font = ABB.Robotics.Tps.Windows.Forms.TpsFont.Font12b;            this.tpsLabel1.Location = new System.Drawing.Point(262, 89);            this.tpsLabel1.Multiline = true;            this.tpsLabel1.Name = "tpsLabel1";            this.tpsLabel1.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(172)))), ((int)(((byte)(182)))));            this.tpsLabel1.Size = new System.Drawing.Size(129, 24);            this.tpsLabel1.TabIndex = 0;            this.tpsLabel1.TextAlignment = System.Drawing.ContentAlignment.TopLeft;            this.tpsLabel1.Title = "tpsLabel1";            //             // button1            //             this.button1.BackColor = System.Drawing.Color.White;            this.button1.BackgroundImage = null;            this.button1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;            this.button1.Font = ABB.Robotics.Tps.Windows.Forms.TpsFont.Font12b;            this.button1.Image = null;            this.button1.Location = new System.Drawing.Point(236, 145);            this.button1.Name = "button1";            this.button1.SelectionColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(172)))), ((int)(((byte)(182)))));            this.button1.Size = new System.Drawing.Size(140, 70);            this.button1.TabIndex = 1;            this.button1.Text = "button1";            this.button1.TextAlign = ABB.Robotics.Tps.Windows.Forms.ContentAlignmentABB.MiddleCenter;            this.button1.Click += new System.EventHandler(this.button1_Click);            //             // TpsViewIRC5App1            //             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;            this.Controls.Add(this.button1);            this.Controls.Add(this.tpsLabel1);            this.Size = new System.Drawing.Size(640, 390);            this.ResumeLayout(false);        }        #endregion        #region ITpsViewSetup Members        ///         /// This method is called by TAF when the control is closed down (before Dispose is called).        ///         void ITpsViewSetup.Uninstall()        {            // TODO:  Add TpsViewIRC5App1.Uninstall implementation        }        ///         /// This method is called by TAF when the control is installed in the framework (after the constructor is called).        ///         bool ITpsViewSetup.Install(object sender, object data)        {            // TODO:  Add TpsViewIRC5App1.Install implementation            return false;        }        #endregion        #region ITpsViewActivation Members        ///         /// This method is called by TAF when the control goes from the active state to the passive state,         /// and is no longer visible in the client view. This happens when the user presses another application button         /// on the task bar, or closes the application. Normally, any subscriptions to controller events are removed here.        ///         void ITpsViewActivation.Deactivate()        {            // TODO:  Add TpsViewIRC5App1.Deactivate implementation        }        ///         /// This method is called by TAF when the control goes from the passive state to the active state,         /// i.e. becomes visible in the client view. Normally, this is where subscriptions to controller events are set up.        ///         void ITpsViewActivation.Activate()        {            // TODO:  Add TpsViewIRC5App1.Activate implementation        }        #endregion        private void button1_Click(object sender, EventArgs e)        {            tpsLabel1.Text = "Hello World!";        }    }}

2.对项目进行编译,编译完成后在项目文件目录的Debug文件夹下生成与项目名称相同的TpsViewIRC5App1.dll、TpsViewIRC5App1.gtpu.dll两个文件,这两个文件就是示教器定制界面的运行文件。


java robot无法操作DNF robotstudio无法加载dll_c# 无法加载oraops.dll_08


六、测试运行

ABB机器人示教器二次开发程序测试同样有两种方式,一、在真实的机器人上进行测试,二、在虚拟仿真软件Robotstudio中测试,这里主要介绍在Robotstudio软件中的测试。

  • 真机测试

1.在真实的机器人上进行测试需要在机器人RobotWare中安装“617-1 FlexPendant Interface”选项。


java robot无法操作DNF robotstudio无法加载dll_System_09


2.在FlexPendant SDK 安装目录中运行abbct.exe程序,使用ABB GTPU Compliance Tool-2005工具将编译生成的TpsViewIRC5App1.dll文件部署到机器人控制器中。


java robot无法操作DNF robotstudio无法加载dll_Windows_10


3.重新启动机器人,打开机器人示教器即可看到新开发的示教器界面。

  • 仿真软件测试

1.在ABB机器人虚拟仿真软件Robotstudio中新建一个机器人系统,系统选项保持默认即可。

2.软件“控制器”菜单下,左侧控制器浏览树中右击“HOME”,在弹出的快捷菜单中点选“打开文件夹”。


java robot无法操作DNF robotstudio无法加载dll_Windows_11


3.将编译生成的TpsViewIRC5App1.dll、TpsViewIRC5App1.gtpu.dll两个文件复制到打开的HOME文件夹下。


java robot无法操作DNF robotstudio无法加载dll_c# 无法加载oraops.dll_12


注:如果已经打开虚拟示教器,在复制粘贴二次开发.dll文件之前,需要先将虚拟示教器关闭。

4.打开虚拟示教器,点击“ABB菜单”,在其下可以看到二次开发的窗口选项“Hello World”。


java robot无法操作DNF robotstudio无法加载dll_System_13


5.打开Hello World窗口,点击其中的button按钮,可以看到标签TpsLabel中的文本显示“Hello World!”。


java robot无法操作DNF robotstudio无法加载dll_c# 无法加载oraops.dll_14


The End