Esempio n. 1
0
        static void Main(string[] args)
        {
            KVDH1 KV1 = new KVDH1();

            KV1.AxdbCm.PLC  = DATABUILDERAXLibLB.DBPlcId.DBPLC_DKV5000;
            KV1.AxdbCm.Peer = "192.168.1.10:8000";
        }
        static void Main(string[] args)
        {
            //LogTest log = new LogTest();
            //log.print();

            LogHelper.WriteLog("111112233");
            //int a;int b;
            //Thread th1 = new Thread(test);
            //th1.IsBackground = true;
            //th1.Start();
            //if (th1.ThreadState!=ThreadState.Running)
            //{
            //    th1.Start();
            //}

            //frmTest frmTest = new frmTest();
            //frmTest.ShowDialog();
            KVDH1 kv = new KVDH1();

            //DATABUILDERAXLibLB.DBCommManagerClass kv = new DATABUILDERAXLibLB.DBCommManagerClass();
            kv.PLC  = DATABUILDERAXLibLB.DBPlcId.DBPLC_DKV7K;
            kv.Peer = "192.168.250.111:8500";
            int[] a = new int[1000];
            int[] b = new int[2000];
            //for (int i = 0; i < a.Length; i++)
            // {
            //     a[i] = 1000+i;
            // }
            //string strWrite = "111111111111111111111122222222222222222233333333333333333333333";
            //string strResult = "";
            try
            {
                Thread.Sleep(1000);
                kv.Connect();
                kv.WriteMemory(DATABUILDERAXLibLB.DBPlcDevice.DKV7K_EM, 100, 1000, a);
                kv.ReadMemory(DATABUILDERAXLibLB.DBPlcDevice.DKV7K_EM, 100, 1000, ref b);
                //kv.WriteText(DATABUILDERAXLibLB.DBPlcDevice.DKV7K_EM, "100", 200, strWrite);*/
                //kv.ReadText(DATABUILDERAXLibLB.DBPlcDevice.DKV7K_EM, "100", 200, out strResult);
                //kv.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV7KXYM_RLY_B, "170000", 1);
                //kv.WriteDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV7KXYM_RLY_B, "170001", 1);
                //int i = kv.ReadDevice(DATABUILDERAXLibLB.DBPlcDevice.DKV7KXYM_RLY_W, "10");
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(ex);
                Console.WriteLine(ex.ToString());
            }

            //uint a = 16;
            //uint b = 17;
            //person a = new person();
            //a.Name = "duyangyang";
            //a.Age = 13;
            //a.eat();
            //person b = new person();
            //b.Name = "yanxiaocheng";
            //b.Age = 11;
            //b.eat();
            //Console.ReadLine();


            ////double result = Dint_to_Real(b, a);
            //double result1 = qp1(b, a);
            //Console.WriteLine(result.ToString());
            //Console.WriteLine(result1.ToString());
            //Console.ReadKey();
        }