public static PLCCommand2 GetInstance() { if (instance == null) { lock (syncLock) { if (instance == null) { instance = new PLCCommand2(); } } } return(instance); }
public static void Dispose() { if (instance != null) { try { foreach (var item in instance.opcGrpsDic) { item.Value.Remove(false); } instance.opcSrv.Disconnect(); instance = null; } catch (Exception ex) { LogImpl.Error(string.Format("{0}{2}{1}", ex.StackTrace, ex.Message, System.Environment.NewLine)); } } }