Search for a Specific Module Instance

You can search for a specific module instance using a Boolean expression. This will be evaluated in the scope of each instance of the selected module. Note the last two words of the previous sentence. Only instances of the selected module are searched, not all modules in the module tree list.

Use this feature to locate a specific module instance among many. Each module in turn for which the expression evaluates to true is made the selected module. Use the Next button in the Find dialog to step through instances that match the expression if there is more than one.

To search for a specific instance of a module:

  1. Click the Find Module tool in the toolbar.
    The Find Module dialog will open.
  2. Enter a Boolean expression in the field provided.
    Every variable reference must start with a scope resolution operator ( \ or . ).
  1. Click the Find button at the top of the Find Module dialog.

This facility can be extremely useful where you are diagnosing a problem in a large application that may have many instances of the same module (such as a tag), and you need to locate a specific instance.

Find a Module Instance

Using the Completed Tutorial application as an example, perhaps you wish to locate the instance of the module "AnalogStatus" that corresponds to the tag "Tank Level". This module instance can be identified easily enough because you know that the variable "ShortName" within that module holds the tag's name. As a result, you would first select the AnalogStatus module in the module tree, then open the find tool. The script expression would be:

\ShortName == "Tank Level"

Note that the text value of the name is contained within quotes, as per a normal string literal, and that the variable "ShortName" is preceded by a scope resolution operator (\).

Three instances will be found and one loaded in the module content window. Press the "Next" button in the find dialog to step through the instances. A pop-up message will let you know when there are no more instances to find.

If no instances can be found or if the Source Debugger is unable to compile the supplied expression, an error dialog is displayed, describing the error.