Home > Net >  C # serial timers sent automatically send interference and buttons
C # serial timers sent automatically send interference and buttons

Time:09-16

As title, I use a timer, send a 50 ms per isolation, AA 01, 02, 03 05 FF to the next bit machine, then can send AA 02, 03 04, 05 FF manual buttons, to the next bit machine, found that sometimes the player put to is wrong,
Excuse me, how to change in the upper machine, automatic and manual data to send the past can be complete

CodePudding user response:

Data validation, write their own one of the most simple CRC16 algorithm, odd parity, parity checking, such as resend check wrong,

CodePudding user response:

This thing will check the same and network communication, PC put commands in the queue, connection, execution, disconnect and another under each message need machine calibration, calibration is successful, the execution result to PC a reply; Similarly, upper machine also need to check the news of the lower machine, not successful message to resend,

In addition there is a need to pay special attention to, the connection of the port baud rate not too high, enough, high baud rate leads to high error rate,

CodePudding user response:

Sent out the check, please? Or what? The key is, send data, it is not return success or what,

CodePudding user response:

Lock to ensure that every time can only send a bunch of data

CodePudding user response:

A queue is a correct solution,

CodePudding user response:

refer to 6th floor Amon Amon response:
queue is a correct solution,

Queue?? How to implement? Feeling what you say is very reasonable, just don't know where to get the truth ~! ~

CodePudding user response:

1. The queue first in first out,
2. All you need to issue the command team,
3. Send the application, make a column operation, will break the ranks of commands sent to the machine,

CodePudding user response:

Queue should be feasible, however, to handle feel where is wrong, still see
  •  Tags:  
  • C#
  • Related