Exemple #1
0
        public void openRealTimeMonitorPort()
        {
            int ret = DllC0402.setRTLogCMD(ipAddress);

            if (ret != 0)
            {
                return;
            }
            readTimeMonitorHandle = DllC0402.connectLOG(ipAddress);
            if (readTimeMonitorHandle <= 0)
            {
                return;
            }

            isrealwatch = true;

            real = new Thread(realWatch);
            real.IsBackground = true;
            real.Start(readTimeMonitorHandle);
        }
        private void button3_Click(object sender, EventArgs e)
        {
            string ipaddress = kryptonComboBoxControllerIp.Text.Trim();

            int ret = DllC0402.setRTLogCMD(ipaddress);

            if (ret != 0)
            {
                return;
            }

            StringBuilder Buffer = new StringBuilder(1024);

            int handle = DllC0402.connectLOG(ipaddress);

            if (ret != 0)
            {
                return;
            }
            while (true)
            {
                int flag = DllC0402.getRTLog(handle, Buffer, 5);
                if (flag <= 0)
                {
                    continue;
                }
                string strCount = Buffer.ToString().Substring(0, 4);
                int    intCount = int.Parse(strCount);

                flag = DllC0402.getRTLog(handle, Buffer, intCount);
                if (flag <= 0)
                {
                    continue;
                }


                textBox2.Text = Buffer.ToString();
            }
        }