当前位置: 首页>>代码示例>>C#>>正文


C# Controller.Logon方法代码示例

本文整理汇总了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";
            }
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:20,代码来源:Dynamo_TORO_comm.cs

示例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);
                    }
                }
            }
        }
开发者ID:JJAharon,项目名称:VxLab-can-demo,代码行数:68,代码来源:ECanDemo.cs

示例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();
            }
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:23,代码来源:Dynamo_TORO_comm.cs

示例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 }
            };
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:34,代码来源:Dynamo_TORO_comm.cs

示例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}*/
            };
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:59,代码来源:Dynamo_TORO_comm.cs

示例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;
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:14,代码来源:Dynamo_TORO_comm.cs

示例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;
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:17,代码来源:Dynamo_TORO_comm.cs

示例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 }
            };
        }
开发者ID:mjkkirschner,项目名称:DynamoToro,代码行数:25,代码来源:Dynamo_TORO_comm.cs


注:本文中的Controller.Logon方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。