Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: Receivie serial data on event in order

Receivie serial data on event in order 4 years 6 months ago #17045

  • Roshan
  • Roshan's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
Hi !
I am novice for c++. I have make a app, where i pick data from text box, by using loop connector,

i am receiving same data using serial event & working ok.

Now I want to receive data using STX & ETX.

where My STX = "#" & ETX = " ; "

STX + 16 byte data + ETX

on serial event if STX = "#" then start receiving till ETX received

otherwise not receive data

currently here is my code, but it does not test for stx.
private: System::Void serialPort1_DataReceived(System::Object^  sender, System::IO::Ports::SerialDataReceivedEventArgs^  e) {
		data1 = serialPort1->ReadExisting();
		
this->Invoke(gcnew EventHandler(this, &Form1::SetTextCallback));
}

private: System::Void SetTextCallback(System::Object^ sender, System::EventArgs^ e)
{
	label3->Text=data1;
}


I need help.
Time to create page: 0.205 seconds