Пример #1
0
        public static CustomSerial getGCodeSerial()
        {
            if (gCodeSerialChannel == null)
            {
                gCodeSerialChannel = new CustomSerial();

                try
                {
                    gCodeSerialChannel.configure("COM4", "57600", "8", "One", "None");

                    //PCAN.ctrCanConnector temp = new PCAN.ctrCanConnector();
                    //temp.connect("51");

                    gCodeSerialChannel.Open();
                }
                catch (Exception e)
                {
                }
            }
            return(gCodeSerialChannel);
        }
Пример #2
0
 private void ConfigureSerialPort(CustomSerial gcodeChan)
 {
     string portName = cmbPortName.SelectedItem.ToString();
     string baudRate = txtBaudeRate.Text;
     string dataBits = txtDataBits.Text;
     string stopBits = cmbStop.SelectedItem.ToString();
     string parityBits = cmbParity.SelectedItem.ToString();
     gcodeChan.configure(portName, baudRate, dataBits, stopBits, parityBits);
 }