Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

serialdatareceivedEventargs problem

$
0
0

Hi everyone,

I am doing one project by using VC++. Data come every 1.8 second pass through serial port. Sometime, incoming data receive 3.1 second. How to receive every 1.8 second from VC++? anything need to do priority for this port?

My code is very sample as belows: 

private: System::Void Pusher_port_DataReceived(System::Object^  sender, System::IO::Ports::SerialDataReceivedEventArgs^  e) 
{
int nBytesToRead = 0;
nBytesToRead = Pusher_port->BytesToRead;
if(nBytesToRead>=11){
array<Byte> ^szBuff1 = gcnew array<Byte>(nBytesToRead);
Pusher_port->Read(szBuff1, 0, nBytesToRead);
parse_insert_PusherPortData_array(szBuff1);
}

}

Please help me to find out.

Thanks in advance

Dorasu


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>