Example #1
0
 public void Open()
 {
     if (strCom != string.Empty)
     {
         clsSn.Open();
     }
 }
Example #2
0
        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();
        }
Example #3
0
 /// <summary>
 /// 연결을 연다.
 /// </summary>
 public void Open()
 {
     if (clsSn == null)
     {
         clsTcp.Open();
     }
     else
     {
         if (strCom != string.Empty)
         {
             clsSn.Open();
         }
     }
 }
Example #4
0
        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;
            }
        }
Example #5
0
 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();
 }