Barcode input

I have a interface that when the operator scans the internal ID barcode an sql query runs in the background for part id and part serial number from table x. I have a timer that runs every half a second and if the serial and part number have a length greater than 4 it updates table y.
This works but i will get duplicates some times and it seems a bit clunky.
The reason that i did it this way was so the operator can scan 5 to 20 parts quickly and add them to a batch in a table.
If there is any ideas on how to streamline this or any resources that you can direct me to that I might be able to find an answer it would be appreciated.

Thanks

I would have it scan to a tag and then use the Tag Change script on the tag to do the logic and upload.
That way it will only happen if the value of the tag changes when you scan.

If you’re using text fields for the actual input, take advantage of the ‘Defer Updates’ property - use a propertyChanged event script, monitoring the ‘text’ property - but with defer updates checked the script will only run when the text entry is ‘confirmed’ by the barcode scanner sending ENTER to move to the next text field.