SerialPort.ReadLine() ?
-
Hello, I am requesting you to help me on a topic, Indicator Device Connected to Computer with Serial Port The following information is coming when I watch Putty [url=https://hizliresim.com/5D6MAD\][img]https://i.hizliresim.com/5D6MAD.png\[/img\]\[/url\] When I Test On C # Using the Following Codes
string GelenVeri = SerialPortKBS.ReadLine();
GelenVeri.Substring(6, 6);
listBox1.Items.Add(GelenVeri);
LBLAgirlikDurumu.ForeColor = System.Drawing.Color.Red;
LBLAgirlikDurumu.Text = "";
LBLAgirlikDurumu.Text = GelenVeri;
listBox1.SelectedIndex = listBox1.Items.Count - 1;
listBox1.SelectedIndex = -1;string ReceivedString = "";
if (SerialPortKBS.BytesToRead > 0)
{
byte[] ret = new byte[SerialPortKBS.BytesToRead];
SerialPortKBS.Read(ret, 0, ret.Length);
ReceivedString = Encoding.ASCII.GetString(ret);
if (ReceivedString.Length > 6)
ReceivedString = ReceivedString.Substring(5, 6);
LBLAgirlikDurumu.Text = ReceivedString;
}When Weight is Weighted on a Scale Always Values Are as Below but Weight on the Indicator Always reads the first time I read it with SerialPort.ReadLine (). Does not Show Last Value Too Many Experiences But I Was Not Successful, Are You Help?
-
Hello, I am requesting you to help me on a topic, Indicator Device Connected to Computer with Serial Port The following information is coming when I watch Putty [url=https://hizliresim.com/5D6MAD\][img]https://i.hizliresim.com/5D6MAD.png\[/img\]\[/url\] When I Test On C # Using the Following Codes
string GelenVeri = SerialPortKBS.ReadLine();
GelenVeri.Substring(6, 6);
listBox1.Items.Add(GelenVeri);
LBLAgirlikDurumu.ForeColor = System.Drawing.Color.Red;
LBLAgirlikDurumu.Text = "";
LBLAgirlikDurumu.Text = GelenVeri;
listBox1.SelectedIndex = listBox1.Items.Count - 1;
listBox1.SelectedIndex = -1;string ReceivedString = "";
if (SerialPortKBS.BytesToRead > 0)
{
byte[] ret = new byte[SerialPortKBS.BytesToRead];
SerialPortKBS.Read(ret, 0, ret.Length);
ReceivedString = Encoding.ASCII.GetString(ret);
if (ReceivedString.Length > 6)
ReceivedString = ReceivedString.Substring(5, 6);
LBLAgirlikDurumu.Text = ReceivedString;
}When Weight is Weighted on a Scale Always Values Are as Below but Weight on the Indicator Always reads the first time I read it with SerialPort.ReadLine (). Does not Show Last Value Too Many Experiences But I Was Not Successful, Are You Help?