示例#1
0
        public void SendTaskToPlc(TaskProxy.Task task)
        {
            OpcUa opc = new OpcUa();

            opc.SendTask(task);
            Log.GetLog().logThis($"Испытание отправлено в ПЛК: {task.PrintToString()}");
        }
示例#2
0
        public void SendTask(TaskProxy.Task task)
        {
            using (client = new OpcClient("opc.tcp://192.168.10.2:4840"))
            {
                client.Connect();

                object[] result = client.CallMethod(
                    "ns=3;s=\"SendNewTask\"",
                    "ns=3;s=\"SendNewTask\".Method",
                    (Int16)task.ID,
                    (String)task.Number.Trim(),
                    (String)task.Item.Trim(),
                    (String)task.StartSerial.Trim(),
                    (Int16)task.TargetCount);
                Log.GetLog().logThis(task.PrintToString());
            }
        }