Click here to Skip to main content
15,889,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i have below code when i execute the machine, the machine returns "q?". which is not suitable that i want from machine. what i do please please help....

What I have tried:

public void SettingRS232()
       {
           try
           {
               serialPort1.PortName = comportName.Text;
               serialPort1.BaudRate = Convert.ToInt32(combaudrate.Text);
               serialPort1.DataBits = Convert.ToInt32(comdatabits.Text);
               serialPort1.StopBits = (StopBits)Enum.Parse(typeof(StopBits), comstopBits.Text);
               serialPort1.Parity = (Parity)Enum.Parse(typeof(Parity), comparityBits.Text);
               serialPort1.Handshake = (Handshake)Enum.Parse(typeof(Handshake), comparityBits.Text);
               serialPort1.ReadTimeout = 2000;
               serialPort1.WriteTimeout = 500;

               serialPort1.DtrEnable = true;
               serialPort1.RtsEnable = true;

               serialPort1.Open();

               serialPort1.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
               lblstatus.Text = "Port is now ready...";

           }
           catch (Exception ex)
           {
               lblstatus.Text = ex.Message;
           }
       }
       public void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
       {
           SerialPort sp = (SerialPort)sender;
           string indata = sp.ReadExisting();

           this.Invoke(new Action(delegate() { richTextBox1.Text = indata; }));
       } private void btnStart_Click(object sender, EventArgs e)
       {
           if (serialPort1.IsOpen)
           {
           }
           else
           {
               btnStart.BackColor = Color.Green;
               SettingRS232();
               btnStop.BackColor = default(Color);
           }

       }
Posted
Updated 28-Mar-18 0:04am

1 solution

You should talk to the people who created it - Abacus 380 – 3-part Differential Hematology Analyzer – Diatron[^] - they should provide technical support and will know more about their product than we will. If they don't, then find another supplier and demand your money back!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900