public void Dispose() { if (_modbus != null) { StopTakingData(); _modbus.Close(); _modbus = null; } }
/// <summary> /// 端口关闭函数 /// </summary> public void MB_Close() { bWorking = false; if (m_nProcotol == 2) { tcp_svr.Close(); } else { ser_svr.Close(); } }