hexagon logo

Starting the measurement procedure with a barcode scanner

Good day.
I have a lot of similar looking parts to measure, which differ only by the part number. I would like the operator to run the program. then a comment window appears where you need to scan the barcode from the part. if the barcode is correct, the measuring procedure starts, if not, the program is stopped. the problem is that the barcode is 20 letters and the part number is the first 6 letters.
In MS Excel there is an option to extract the first 6 letters from the cell and this is the way I try to solve this problem - unfortunately ineptly.
any ideas?  https://drive.google.com/file/d/1g1L...w?usp=drivesdk https://drive.google.com/file/d/1O2yqVweo1vfrnOeVJZ_C1uwXnxb0bwdy/view?usp=drivesdk

https://drive.google.com/file/d/1O2yqVweo1vfrnOeVJZ_C1uwXnxb0bwdy/view?usp=drivesdk