Use this. Controller. Logon (the UserInfo. DefaultUser); There is an error
My code:
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.Discovery;
using ABB.Robotics.Controllers.RapidDomain;
using ABB.Robotics.Controllers.MotionDomain;
namespace _3
{
public partial class Form1 : Form
{
private NetworkScanner scanner = null;
private Controller controller = null;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
this.scanner = new NetworkScanner();
this.scanner.Scan();
ControllerInfo[] controllers = scanner.GetControllers();
ControllerInfo aControllerInfo = controllers[0];
if (aControllerInfo.Availability == Availability.Available)
{
if (this.controller != null)
{
this.controller.Logoff();
this.controller.Dispose();
this.controller = null;
}
this.controller = ControllerFactory.CreateFrom(aControllerInfo);
this.controller.Logon(UserInfo.DefaultUser);
}
else
{
MessageBox.Show("控制器不可用");
}
}
}
}
}
Tagged:
0
Comments
-
I tried to run your code and in my case it works without any problems. Did you import the correct references? And as check you have to open RobotStudio with a system.0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings