Hello, I would like to ask you to share information on a subject, I am experiencing a problem related to data transmission and data retrieval on an Indicator device connected to a serial port on a project I am developing. Code I Write For Trial Purpose As Below, SerialPortTLB_DataReceived Event Overflow Should Not Send on Textbox as Byte, How can I print the incoming data as Bytes? I'm Waiting For You About This Issue, Good Work ...
using DevComponents.DotNetBar.Metro;
using System;
using System.Windows.Forms;
namespace VeriOkuma
{
public partial class VeriOkuma : MetroForm
{
public VeriOkuma()
{
InitializeComponent();
}
private void BTNVeriGonder\_Click(object sender, EventArgs e)
{
if (!SerialPortTLB.IsOpen)
SerialPortTLB.Open();
SerialPortTLB.Write(System.Convert.ToChar(2).ToString() + System.Convert.ToChar(1).ToString() + "DNG" + System.Convert.ToChar(13).ToString());
}
private void VeriOkuma\_Load(object sender, EventArgs e)
{
if (SerialPortTLB.IsOpen)
{
SerialPortTLB.Close();
}
}
private void SerialPortTLB\_DataReceived(object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
if (!SerialPortTLB.IsOpen) SerialPortTLB.Open();
TXBGelenVeri.Text = SerialPortTLB.ReadExisting();
SerialPortTLB.Close();
}
}
}