Right, I need to program the scanner with rules to interpret the barcode which we print out. I'm using the 123Scan2 tool to program the scanner.
Here's examples of the barcode data:
Barcode Example #1:
HR30*001*
Barcode Example #2:
HR30*001*1601-TMA-0016-A*A****Active*
The rule needs to send a <TAB> whenever there is a <*>. So I created this ADF rule:
1. Move To All Patterns and Replace <*> with <TAB>
2. Skip to Start
3. Send All that remains
This rule works perfectly fine when scanning the barcode into Notepad. HOWEVER, it does not work with the inventory system we are using which I think uses some kind of field level validation before it takes the next chunk of data.
So I created a new ADF rule:
1. Send up to <*>
2. Send Extended Key <Tab>
3. Move Past a <*>
4. Send up to <*>
5. Send Extended Key <Tab>
6. Move Past a <*>
7. Send up to <*>
8. Send Extended Key <Tab>
9. Move Past a <*>
This works with the inventory software fine. But there is problem -- the number of repeating 3-rules have to match or be less than the number of <*> in the barcodes or it fails. Barcode Example #1 has 2, so it fails and Barcode Example #2 has 8 so it works but only up to the 3rd <*>.
What I think I need is this. I think I need a way to program a DO...WHILE loop until it reaches the end-of-text <ETX> since the number of <*> can vary. Is this somehow possible to program into the scanner?
DO WHILE NOT <ETX>
1. Send up to <*>
2. Send Extended Key <Tab>
3. Move Past a <*>
LOOP