static void Main(string[] args) { bool loop = true; QMNetCoreFrame.Log.Log.InitLog(); //QMNetCoreFrame.MSSql.MSSql.ConnStr = "Server=127.0.0.1,1433;Database=EXLD;User ID=mes;Password=Fy861213"; QMNetCoreFrame.MSSql.MSSql.ConnStr = "Server=127.0.0.1,1433;Database=EXLD;User ID=mes;Password=Krones1itk"; //ReadPLC(); RowConfig.InitData(); Log.Info("Init Device IP Datapoint Finished"); RowConfig.InitDic(); Log.Info("Init Dic Finished"); RowConfig.InitTagDic(); Log.Info("Init TagDic Finished"); // //FuncAsyn.RunP0(JobGetPLCData.GetFirstDataFromPLC); EqpKPI.Init(); Log.Info("EqpKPI Dic Init Finished"); QMNCPLCS7.OEM.DBChange.Init(); QMNCPLCS7.OEM.DBChange.Run(); JobGetPLCData.GetFirstDataFromPLC(); Thread.Sleep(60000); FuncAsyn.RunP0(JobGetPLCData.Run); Thread.Sleep(180000); FuncAsyn.RunP0(JobDT.Run); while (loop) { Log.Info("[Program Main Thread][Loop]"); Thread.Sleep(1000000000); // JobGetPLCData.GetDataFromPLC(); } Console.ReadLine(); }
public static void Run() { while (loop) { Log.Info("[GetPlc Data Thread][Loop]"); Thread.Sleep(1000); try { JobGetPLCData.GetDataFromPLC(); } catch (Exception ex) { Log.Error(ex.ToString()); } } }