Using WonderWare Script to Check for Correct Number Format

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

Screenshot from 2014-04-22 15:50:21

Screenshot from 2014-04-22 16:06:33

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.

This entry was posted in Industrial Automation and tagged , . Bookmark the permalink.