Exemple #1
0
        private void btnOpenPort_Click(object sender, EventArgs e)
        {
            CCRS232Protocol protocol = new CCRS232Protocol();

            protocol.PortBoudrate = int.Parse(this.cmbBaudRate.Text);
            protocol.PortDataBits = int.Parse(this.cmbDataBits.Text);
            protocol.PortNumber   = this.cmbPortName.Text;

            // ¦r¦êÂ૬¦¨Enum
            protocol.PortStopBits = (StopBits)Enum.Parse(typeof(StopBits), this.cmbStopBits.Text);
            protocol.PortParity   = (Parity)Enum.Parse(typeof(Parity), this.cmbParity.Text);

            m_RS232Interface.TextUI = rtfTerminal;

            m_RS232Interface.Protocol = protocol;

            m_RS232Interface.EnableRetry = false;

            m_RS232Interface.Create();
        }
Exemple #2
0
        private void btnOpenPort_Click(object sender, EventArgs e)
        {
            CCRS232Protocol protocol = new CCRS232Protocol();

            protocol.PortBoudrate = int.Parse(this.cmbBaudRate.Text);
            protocol.PortDataBits = int.Parse(this.cmbDataBits.Text);
            protocol.PortNumber = this.cmbPortName.Text;

            // ¦r¦êÂ૬¦¨Enum
            protocol.PortStopBits = (StopBits)Enum.Parse(typeof(StopBits), this.cmbStopBits.Text);
            protocol.PortParity = (Parity)Enum.Parse(typeof(Parity), this.cmbParity.Text);

            m_RS232Interface.TextUI = rtfTerminal;

            m_RS232Interface.Protocol = protocol;

            m_RS232Interface.EnableRetry = false;

            m_RS232Interface.Create();
        }