Home > Software engineering >  A serial port receives the data
A serial port receives the data

Time:09-18

SerialPort SeialPortcom=new SerialPort ();
Int Datenums=SeialPortcom. BytesToRead;

Why SeialPortcom. BytesToRead shows that receives the number of data but int Datenums no data is small white consult

CodePudding user response:

This code is a little problem, to search the serialport c # example,
Before connection, you need to specify the specific port parameters, such as port, baud rate, etc., if the dynamic creating serialport class, need to manually register data receive events, use entrusted to asynchronous processing, send also had better use asynchronous, or simply, simply use. Net own serialport controls, into the properties window configuration required several attributes, and then from the IDE automatically create events to write,

CodePudding user response:

Well such as serial port configuration baud rate has been configured
Int Datenums=SeialPortcom. BytesToRead;
SeialPortcom. The number can be seen but int Datenums BytesToRead data shows zero

CodePudding user response:

"Compiler principle" reference of lexical analysis and the finite state automata,
  • Related