[C#] Experience in processing signals read from Handy

Error encountered

  • An error occurs when scanning a barcode or image but the data is continuously filled into 2 text boxes instead of 1 specified text box. Checked all the code to fill in data in the incorrectly filled textbox but still didn’t see the problem. Errors occur infrequently, so it is difficult to debug.

Cause

  • The reading processing code dumps data in first and then turns off Handy’s reading eyes, so after data is poured into the reader, it continues to record data< /span>
  • Right after data is poured into the first textbox, there is a code that automatically focuses on the second textbox immediately after, at this time the reader has not turned off and is still reading. So the data is immediately poured into textbox 2. Debugging this section cannot be done because textbox 1’s events are still running so the cursor still follows textbox 1.

How to edit

  • Turn off Handy’s reader immediately after receiving data to avoid the reader continuing to read and filling in the data.
Bài viết liên quan