namespace SerialData
{
public partial class Form1 : Form
{
private const int V = 0;
string nonc;
string strNonc;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SerialPort port = new SerialPort("COM3", 9600, Parity.Even, 8, StopBits.One);
serialPort1.Open();
if (serialPort1.IsOpen)
{
try
{
byte[] arr1 = { 58, 23, 68, 68, 68, 0, 22, 167 };
serialPort1.Write(arr1, 0, arr1.Length);
Thread.Sleep(500);
byte[] arr2 = { 58, 23, 68, 68, 68, 0, 22, 167 };
serialPort1.Write(arr2, 0, arr2.Length);
byte[] arr3 = { 58, 23, 68, 68, 68, 0, 22, 167 };
serialPort1.Write(arr3, 0, arr3.Length);
byte[] arr4 = { 58, 23, 68, 68, 68, 0, 22, 167 };
serialPort1.Write(arr4, 0, arr4.Length);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
What I have tried:
But Serial Port Does Not Write any Data