예제 #1
0
 public static PLCCommand GetInstance()
 {
     if (_instance == null)
     {
         lock (SyncLock)
         {
             if (_instance == null)
             {
                 _instance = new PLCCommand();
             }
         }
     }
     return(_instance);
 }
예제 #2
0
 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, Environment.NewLine));
         }
     }
 }