本文整理汇总了C#中Controller.Logon方法的典型用法代码示例。如果您正苦于以下问题:C# Controller.Logon方法的具体用法?C# Controller.Logon怎么用?C# Controller.Logon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Controller
的用法示例。
在下文中一共展示了Controller.Logon方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setProgramPointer
public static string setProgramPointer(bool run, string[] controllerData, int row)
{
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
using (Mastership.Request(controller.Rapid))
{
newTask.SetProgramPointer("MainModule", row);
}
return "Success!";
}
else
{
return "True to run";
}
}
示例2: listView_right_robots_ItemSelectionChanged
private void listView_right_robots_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
{
ListViewItem item = this.listView_right_robots.SelectedItems[0];
if (item.Tag != null)
{
try
{
ControllerInfo controllerInfo = (ControllerInfo)item.Tag; if (controllerInfo.Availability == Availability.Available)
{
if (controllerInfo.IsVirtual)
{
if ((controllerInfo.IsVirtual) && (controllerInfo.SystemName == "J-R-IRB_120_3kg_0.58m") &&
(controllerInfo.IPAddress.ToString() == "127.0.0.1"))
{
controller_101 = ControllerFactory.CreateFrom(controllerInfo);
controller_101.Logon(UserInfo.DefaultUser);
MessageBox.Show("Connected to local virtual controller 101 (RIGHT)");
}
}
else //real controller
{
if (MessageBox.Show("This is NOT a virtual controller, do you really want to connect to that?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
{
//Real left
if (!(controllerInfo.IsVirtual) && (controllerInfo.IPAddress.ToString() == "10.234.3.101"))
{
controller_101 = ControllerFactory.CreateFrom(controllerInfo);
controller_101.Logon(UserInfo.DefaultUser);
MessageBox.Show("Connected to REAL controller 101 (RIGHT)");
}
}
}
if (this.controller_101 != null)
{
this.controller_101.Rapid.Stop(ABB.Robotics.Controllers.RapidDomain.StopMode.Immediate);
this.listView_right_robots.Visible = false;
string real = "Real";
if (controllerInfo.IsVirtual)
{
real = "Virtual";
}
this.label_right.Text = "Connected to " + real + "\n" + controllerInfo.SystemName;
test_start();
}
}
else
{
MessageBox.Show("Selected controller not available.");
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}
示例3: sendProgramToController
/// <summary>
/// Send a .PRG file to controller.
/// </summary>
/// <param name="run">True to run</param>
/// <param name="controllerData">Controller data</param>
/// <param name="filePath">File to send</param>
public static void sendProgramToController(bool run, string[] controllerData, string filePath)
{
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
using (Mastership.Request(controller.Rapid))
{
newTask.LoadProgramFromFile(filePath, RapidLoadMode.Replace);
}
controller.Logoff();
}
}
示例4: readTargetData
public static Dictionary<string, List<string>> readTargetData(bool run, string[] controllerData)
{
List<string> rTargets = new List<string>();
List<string> jTargets = new List<string>();
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
using (Mastership.Request(controller.Rapid))
{
RapidSymbolSearchProperties sProp = RapidSymbolSearchProperties.CreateDefault();
sProp.Types = SymbolTypes.Data;
RapidSymbol[] datas = newTask.GetModule("MainModule").SearchRapidSymbol(sProp);
foreach (RapidSymbol rs in datas)
{
RapidData rd = controller.Rapid.GetTask("T_ROB1").GetModule("MainModule").GetRapidData(rs);
if (rd.Value is RobTarget)
{ rTargets.Add(rd.Value.ToString()); }
if (rd.Value is JointTarget)
{ jTargets.Add(rd.Value.ToString()); }
}
}
}
return new Dictionary<string, List<string>>
{
{"robTargets", rTargets },
{"jointTargets", jTargets }
};
}
示例5: readProgramData
public static Dictionary<string, List<string[]>> readProgramData(bool run, string[] controllerData)
{
List<string[]> progData = new List<string[]> { };
///List<string[]> currData = new List<string[]> { };
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
using (Mastership.Request(controller.Rapid))
{
RapidSymbolSearchProperties sProp = RapidSymbolSearchProperties.CreateDefault();
sProp.Types = SymbolTypes.Data;
RapidSymbol[] progDatas = newTask.GetModule("MainModule").SearchRapidSymbol(sProp);
foreach (RapidSymbol rs in progDatas)
{
RapidData rd = controller.Rapid.GetTask("T_ROB1").GetModule("MainModule").GetRapidData(rs);
if ((rd.Value is ToolData) | (rd.Value is WobjData))
{
string[] eachProg = new string[3]
{
rd.RapidType,
rd.Name,
rd.Value.ToString()
};
progData.Add(eachProg);
}
}
/*
RapidSymbol[] currDatas = newTask.GetModule("MainModule").SearchRapidSymbol(sProp);
foreach (RapidSymbol rs in currDatas)
{
RapidData rd = controller.Rapid.GetTask("T_ROB1").GetModule("MainModule").GetRapidData(rs);
if ((rd.Value is ToolData) | (rd.Value is WobjData))
{
string[] eachCurr = new string[3]
{
rd.RapidType,
rd.Name,
rd.Value.ToString()
};
currData.Add(eachCurr);
}
}
*/
}
}
return new Dictionary<string, List<string[]>>
{
{"programData", progData } /*,{"currentData", currData}*/
};
}
示例6: listenToRobot
public static List<object> listenToRobot(bool run, string[] controllerData)
{
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
int initRow = newTask.ProgramPointer.Range.Begin.Row;
newTask.ProgramPointerChanged += NewTask_ProgramPointerChanged;
}
return progList;
}
示例7: getExecutionStatus2
public static List<int> getExecutionStatus2(bool run, string[] controllerData)
{
List<int> posList = new List<int>();
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
newTask.MotionPointerChanged += MPChanged;
int pPos = newTask.ProgramPointer.Range.Begin.Row;
posList.Add(pPos);
}
return posList;
}
示例8: getCurrentPosition
public static Dictionary<string, string> getCurrentPosition(bool run, string[] controllerData)
{
string robotTarget = "";
string jointTarget = "";
if (run == true)
{
Guid systemId = new Guid(controllerData[1]);
Controller controller = new Controller(systemId);
controller.Logon(UserInfo.DefaultUser);
Task newTask = controller.Rapid.GetTask("T_ROB1");
using (Mastership.Request(controller.Rapid))
{
robotTarget = newTask.GetRobTarget().ToString();
jointTarget = newTask.GetJointTarget().ToString();
}
}
return new Dictionary<string, string>
{
{"robotTarget", robotTarget },
{"jointTarget", jointTarget }
};
}