Testing and Debugging a Vision Sequence

One of the first places to look to see if everything in a vision sequence is functioning properly or not is to look at the status of the vision sequence AllPassed result.
If any of the vision objects results was not accepted, the AllPassed result will be set to False. On the other hand, the AllPassed result may return the result as “accepted” by mistake if any of the vision objects is not set correctly. Therefore, eventually you need to test and debug your vision sequence because something isn't quite working properly.
The rest of this section describes some of the debugging features and techniques used with Vision Guide sequences.

Examining the Passed Color of the Vision Objects

One of the first things to always do when trying to find the source of a problem is to use the Pass/Fail colors which are placed on the vision objects on the image display.
Vision objects that are passed have their search windows and found position displayed in green (this can be changed by the PassColor property).
Vision objects that have failed display their search windows in red (this can be changed by the FailColor property). If any of the vision objects within your vision sequence display a red search window, this should be your first clue as to which vision object to more closely examine.
Note that if the Graphics property for a specific vision object is set to None, then no graphics will be displayed for that specific vision object. To ensure that all vision objects have their graphics displayed, click the [Force All Graphics On] button on the Vision Guide toolbar. This will cause all graphics to be displayed regardless of the individual Graphics property settings.

Examining Individual Vision Object Results

When running a vision sequence, you can display the vision sequence results on the Sequence window or you can display an individual vision object's results on the Object window.
If you suspect a specific vision object's performance or just want to closely monitor it after the vision sequence runs, you can do so with just a few clicks.

  1. Select the vision object from the flow chart or sequence tree.
  2. Examine the results for that vision object.

You can even switch vision objects or between the Object window and Sequence window while a vision sequence is running.
This gives you the ability to start a vision sequence running for 1 or more cycles and then examine the results for many of the different vision objects within that vision sequence without having to stop the vision sequence.

Single Stepping Through a Vision Sequence

One of the other nice debugging features for the Vision Guide 8.0 Development Environment is the Single Step feature.
Located on the Run Panel is the [Step] button. Clicking on this button causes the vision sequence to single step one vision object at a time.
You can also change properties for any of the vision objects prior to their execution during single stepping.
The first click of the [Step] button will cause all vision objects to go in an inactive state. They will become blue in color. The next click of the [Step] button will cause the first vision object in the Sequence to execute. It will be green in color if the object is found and red if it was not found.

Using the Statistics Feature

The Statistics feature is another debugging tool.
When testing a vision sequence for reliability, you may want to set the cycle count to a high number and then let the vision sequence run for a while.
Then check the statistical results for all the vision objects from the Statistics dialog box. You can see which vision objects performed reliably and which had varying results.
For details on the vision statistics features, refer to the following.
Using Vision Guide Statistics

Switching between the Run and Vision Guide Windows

There will be times when you have completed testing and think your system is OK to run from the Run window for final test and in fact something may still need adjustment. For these situations, we made the Vision Guide 8.0 Development Window accessible while running from the Run window.
Let’s take a look at an example.
Assume you are running a Vision Guide 8.0 application from the Run window and you would like to see the Score result for the Correlation object called “pin1” because you have had problems with this object in the past.
While the system is running from the Run window, click on the [Vision] button on the Vision Guide toolbar. This will bring up the Vision Guide 8.0 Development Window while the application is still running.
Select the “Pin1” object from the flow chart. You will now see the results for the object called “Pin1” without actually stopping the program from running.
To return back to the Run window simply click the [Open run window] button on the Epson RC+ toolbar.