public void Open() { if (strCom != string.Empty) { clsSn.Open(); } }
private void InitXml(string strSystemID, XML xml) { xml.chNode2Root(); xml.chSingleNode(@"SETTING/" + strSystemID + "/MINIPLC"); strCom = xml.GetSingleNodeValue("COMPORT"); string strBaudrate = xml.GetSingleNodeValue("BAUDRATE"); string strPARITY = xml.GetSingleNodeValue("PARITY"); string strDATABITS = xml.GetSingleNodeValue("DATABITS"); string strSTOPBITS = xml.GetSingleNodeValue("STOPBITS"); clsSn = new Function.Comm.Serial(strCom, int.Parse(strBaudrate), strPARITY, int.Parse(strDATABITS), strSTOPBITS); clsSn.Open(); }
/// <summary> /// 연결을 연다. /// </summary> public void Open() { if (clsSn == null) { clsTcp.Open(); } else { if (strCom != string.Empty) { clsSn.Open(); } } }
public void Open() { if (clsSn == null || strCom == string.Empty) { return; } try { LastLog = string.Format("장비와 연결을 시작합니다. [Port]{0} [BaudRate]{1} [Parity]{2} [DataBits]{3} [StopBits]{4}", clsSn.PortName, clsSn.BaudRate, clsSn.Parity, clsSn.DataBits, clsSn.StopBits); clsSn.Open(); IsConnected = enConnectionStatus.Connected; } catch (Exception ex) { IsConnected = enConnectionStatus.Disconnected; LastLog = ex.Message; throw ex; } }
public clsM80S(string portName, int baudRate, string parity, int dataBits, string stopBits) { strCom = portName; clsSn = new Function.Comm.Serial(portName, baudRate, parity, dataBits, stopBits); clsSn.Open(); }