예제 #1
0
 public void Dispose()
 {
     if (_modbus != null)
     {
         StopTakingData();
         _modbus.Close();
         _modbus = null;
     }
 }
예제 #2
0
        /// <summary>
        /// 端口关闭函数
        /// </summary>
        public void MB_Close()
        {
            bWorking = false;

            if (m_nProcotol == 2)
            {
                tcp_svr.Close();
            }
            else
            {
                ser_svr.Close();
            }
        }