static public bool OpenDevice(out short _nModuleIP) { _nModuleIP = m_nModuleIP; if (bOpened) { return(true); } short nRet; if (NMC2.nmc_PingCheck(m_nModuleIP, 200) != 0) { Log.ShowMessage("PAIX", "Ping Test Error 192.168.0." + m_nModuleIP.ToString()); return(false); } nRet = NMC2.nmc_OpenDevice(m_nModuleIP); if (nRet == 0) { bOpened = true; } else { Log.ShowMessage("PAIX", "NMC2 Open Failed"); return(false); } return(bOpened); }
static public bool ReOpenDevice() { NMC2.nmc_CloseDevice(m_nModuleIP); if (NMC2.nmc_PingCheck(m_nModuleIP, 200) != 0) { Log.Trace("PAIX", "ReOpen Ping Test Error 192.168.0." + m_nModuleIP.ToString()); return(false); } short nRet = NMC2.nmc_OpenDevice(m_nModuleIP); if (nRet == 0) { Log.ShowMessage("PAIX", "ReOpen Success! 192.168.0." + m_nModuleIP.ToString()); return(true); } Log.Trace("PAIX", "ReOpen Failed! 192.168.0." + m_nModuleIP.ToString()); return(false); }