The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK

2019/12/2312:55:10 technology 2726

ABB robot not only has an excellent control system, but also extends a rich secondary development interface, namely PC SDK. Use the PC SDK interface to develop a custom operation interface on the PC to control any ABB robot with an IRC5 controller. At the same time, it can also develop plug-ins for RobotStudio simulation software for interacting with the controller. Using the PC SDK, you can create an application that can be connected to one or more, real or virtual robot IRC5 controllers. In this issue, I will introduce you to the first step of connecting the robot controller, which is to scan the robot controller in the network.

SDK version: PC SDK.6.08

Robotstudio software version: RobotStudio 6.08

Development software version: Microsoft Visual Studio Professional 2019

1. Project creation

in Visual Studio To create a new project in the project template, select "Windows Forms Application (.NET Framework)" under C, which is a Windows window application based on the .NET development framework.

The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK - DayDayNews

2. Window layout

1. Add a ListBox common control and a Button common control to the automatically generated window of the project, and set the two common controls Property parameters.

2cfedb7#Button common control properties#

Text: Scan controller

After setting the properties, adjust the size of the control and make a reasonable layout in the window, as shown in the figure below.

The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK - DayDayNews

3. Development interface reference

After the ABB robot secondary development kit is installed, the default installation location is C:\Program Files (x86)\ABB Industrial IT\ Robotics IT\SDK\PCSDK 6.08, so browse to the file directory location, and add ABB.Robotics.Controllers.PC.dll to the project reference.

The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK - DayDayNews

IV. Code writing

1. Double-click the Botton common control to open the code editing window. First, add the namespace related to the secondary development of ABB robots in the upper part of the code editing page. The code is shown below.

//Add namespace using ABB.Robotics.Controllers; using ABB.Robotics.Controllers.Discovery;

2. Declare the machine in the Form1 window classThe member variable of the network scanner of the human controller, the code is shown below.

private NetworkScanner scanner = null;//Declare the network scanner member variable 

3. Write the scanning robot controller code under the click event function of the button Botton1.

private void button1_Click(object sender, EventArgs e) {this.scanner = new NetworkScanner();//Create a network scanner instance object this.scanner.Scan();//Start scanning ControllerInfoCollection controllers = scanner.Controllers;//Store the scanned controller in the controller information collection ListViewItem item = null; //Traverse the controller information in the controller information collection and add the required information to the list display control in turn foreach (ControllerInfo controllerInfo in controllers) {item = new ListViewItem(controllerInfo.SystemName);//System name item.SubItems.Add(controllerInfo.IPAddress.ToString());//IP address item.SubItems.Add(controllerInfo.Version .ToString());//System version item.SubItems.Add(controllerInfo.ControllerName);//Controller name this.listView1.Items.Add(item);}}}} }

The complete program code is as follows Show:

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Tex t;using System.Threading.Tasks;using System.Windows.Forms;//Add the namespace using ABB.Robotics.Controllers;using ABB.Robotics.Controllers.Discovery;namespace WindowsFormsApp3{ public partial class Form1: Form {public Form1( ) {InitializeComponent();} //Robot controller scanning private NetworkScanner scanner = null;//Declare network scanner member variablesprivate void button1_Click(object sender, EventArgs e) {this.scanner = new NetworkScanner();//Create a network scanner instance object this.scanner.Scan();//Start scanning ControllerInfoCollection controllers = scanner.Controllers;// Store the scanned controller in the controller information collection ListViewItem item = null; //Traverse the controller information in the controller information collection and add the required information to the list display control in turn foreach (ControllerInfo controllerInfo in controllers ) {item = new ListViewItem(controllerInfo.SystemName); item.SubItems.Add(controllerInfo.IPAddress.ToString()); item.SubItems.Add(controllerInfo.Version.ToString()); item.SubItems.Add(controllerInfo. ControllerName); this.listView1.Items.Add(item);}} }}

5. Run test

There are two ways to run test of ABB robot PC SDK secondary development software:

The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK - DayDayNews

The secondary development of ABB robots: the programming of robot controller scanning program based on PC SDK - DayDayNews

Note: When testing the software, be sure to keep the PC SDK version consistent with the RobotWare version, or higher than the RobotWare version.

The End


Previous article: C-based Robotstudio software secondary development basis

technology Category Latest News