in reply to Re^4: Breaking issue
in thread Breaking issue

Your example does not tell me when your program reads from the keyboard or barcode scanner.

The place(s) where your program reads from the keyboard or barcode scanner are where your program hangs. You need to wrap these places in a timeout so that your program only waits the alloted amount of time instead of forever.