Here is how I used a WonderWare window script to check to make sure the batch number entered by the operator meets the following requirements:
- must be 9 digits
- first digit is a 8
- 2nd and 3rd digit are the 2-digit year number
- 4th to 9th digits are numbers
A bunch of nested IF-THEN statements is messy, but works. The “StringTest” function only checks the first digit, so I repeated 6 times to check the last 6 digits.