Beispiel #1
0
        private void Connect()
        {
            try
            {
                master.PortName = mPortList.Items[mPortList.SelectedIndex].ToString();
                Log.Debug("Opening port: {0}", master.PortName);
                master.Open();
                msgReceived = false;
                timer.Start();
                initComm         = true;
                devID            = DeviceID.UNKNOWN;
                msgTimer.Enabled = true;
                Log.Status("Trying to connect");
            }
            catch (Exception ex)
            {
                Log.Error("Problem opening port: " + ex.Message);
            }

            SetupStates();
        }