public static void ForceStopUpdate() { if (QPLCQueryThread.IsAlive) { QPLCQueryThread.Abort(); } qplcu.CloseComm(); /*if (IODataUpdateThread.IsAlive) * { * IODataUpdateThread.Abort(); * }*/ }
//not in use, use acs's as master // private static void IODataUpdate() // { // while (true) // { // Thread.Sleep(10); // IODataCollection.UpdateDataSetIOFromQueryList(); // IODataCollection.RemoveOldFromChangeDict(); // } // } private static void StopThreadQPLCQuery() { QPLCThreadAbort = true; int i = 0; while ((!QPLCThreadAborted) && (i < 10)) { Thread.Sleep(100); i++; } ; try { QPLCQueryThread.Abort(); } catch { } qplcu.CloseComm(); QPLCThreadAbort = false; QPLCThreadAborted = false; }