Example #1
0
        void HeartBeatThreadFunc(object obj)
        {
            int HeartBeatMissedCnt = 0;

            while (!HeartBeatThreadExit)
            {
                System.Threading.Thread.Sleep(1000);

                if (ExecHeartBeat())
                {
                    HeartBeatMissedCnt = 0;
                }
                else
                {
                    HeartBeatMissedCnt++;
                }

                if (HeartBeatMissedCnt >= HeartBeatMissedCnt_MAX)
                {
                    _ConnectStatus = ConnectStatusEnum.CONNECTLOST;
                    StopHeartBeat();
                    if (ConnectLost != null)
                    {
                        CommArgs args = new CommArgs();
                        args.ReaderID = 0;
                        args.addr     = AddrStr;
                        args.port     = port_baud;
                        ConnectLost.BeginInvoke(this, args, null, null);
                    }
                }
            }
        }
Example #2
0
 public GPITriggerEventArgs()
 {
     comm = new CommArgs();
 }
Example #3
0
 public AutoReadEventArgs()
 {
     comm = new CommArgs();
 }