Skip to Main Content
Cognex Support Hub
Logo

How to Set Up and Use Match String Validation on DataMan 8700 Reader

This article shows how you can set up match string validation for your DataMan 8700 reader.

16.05.2025

Question

How can I set up match string validation for my DataMan 8700 reader?

Answer

This is how you can set up match string validation for your DataMan 8700 reader.

  1. Connect your DataMan 8700 reader to DataMan Setup Tool.
  2. From the top menu bar, navigate to Settings > Data Validation. Select the code type that is to be read (Data Matrix, QR Code, ID). Enable Match String Validation for that code type.
  3. Click on Save Settings at the bottom left to apply these changes to the reader.

    placeholder
  4. Open the Reader Configuration Codes guide. It can be found in the documentation listed under the Help tab in Setup Tool. Here is a direct link: Reader Configuration Codes.

    placeholder
  5. The codes we need are on page 35 (according to version 25.2.0.8 of the documentation). In case of documentation changes, you can also use the look up function and type “match” to find the code needed.

    Note: Even though the DataMan 8700 is not explicitly listed under the code, it still works

    placeholder
  6. Scan this code with your DataMan 8700 and Save Settings to apply the changes to your reader.

    Best Practice: Print this code out and have it near the operator’s workstation.

    placeholder


    SCRIPTING

  7. In DataMan Setup Tool, navigate to Format Data under Application Steps on the left-hand-side.
  8. Under Basic, select Script-Based Formatting.

    placeholder
  9. Open the Scripting tab at the top of the window. This is where you can input your script.

    placeholder
  10. Using the script below we can achieve the following function:
    Good “Match” Validation – output barcode (data string) result, beeps positively, ring light flashes green, vibrates, & displays “Good Match” on OLED
    Bad “Match” Validation – output nothing, beeps negatively, ring light flashes red, does not vibrate, & displays “Bad Match” on OLED
  11. You can also customize the script to the your desired effect. Below is a script that has blocks for what to do when the validation succeeds and fails:

 

function onResult (decodeResults, readerProperties, output)

{

     if (decodeResults[0].decoded)

     {

            var dataToPLC = "";

           var dataToOLED = "";

          

           switch(decodeResults[0].validation.state)

{

                //---------------------------------------------------------------------------------------------

                case 1: //Validation Failure -> Customize user feedback and data output for a failure here

                     dataToPLC = "";

                     dataToOLED = "Bad Match";

                     break;

                //---------------------------------------------------------------------------------------------

                case 2: //Validation Success -> Customize user feedback and data output for a success here

                     dataToPLC = decodeResults[0].content;

                    dataToOLED = "Good Match";

                     break;

                //---------------------------------------------------------------------------------------------

               case 0: //Validation Not Tried -> Not expected to occur for normal use cases

                     validationMessage = "Script Error: Validation Not Tried";

                     break;

                default: //Error case, should never happen

                     validationMessage = "Script Error: Validation Not Recognized";

           }

          

           //Send Validation Message

            output.content = dataToPLC;

                output.OLED = dataToOLED;

 

Verwandte Materialien