TIA Portal - Basics of project search

Share

Basics of project search

Introduction

You can search the open project for a specific text (search term). The search term may include one word, several words or parts of words. Only spaces are considered as word limits. You can use search terms up to 255 characters long. You can create any complex search terms using wildcards. You can also limit your search to specific areas, objects or object properties. Upper and lower case letters are not taken into account in the search.

A searchable index of editors' texts is automatically created for background searches in the project. The search index is updated with each change. You cannot start a search before the index is complete. You can re-generate the search index at any time.

Note that the search index is saved with the project. This may increase the file size of the project. If you want to pass the project on, you can reduce the file size by archiving or minimising the project. The search index is deleted in this case. If necessary, you can also deactivate the search in the project completely.

If there are changes to STEP 7 objects, e.g. changes to tag names, PLC data types or blocks, you must update the point of use of these objects before any search in your project so that the search can take these changes into account . To do this, you can, for example, recompile your programme.

The search only includes texts in the set editing language. The search index is generated again when the editing language is changed. This may take some time, depending on the number of texts in the project.

The search editor helps you with your search. You can specify search options and start the search. When the search is complete, the search editor displays a list of objects containing the searched text. You can open individual objects directly from the search editor. If the objects have visible properties, you can display them in the Inspector window.

search options

The following search options are available:

  • Narrow down your search:
    • Search in: You can select the sections of the project to be searched.
    • Find exact match: Finds the exact text entered. The search term is searched for as a single word or as a phrase. If you use this option, you cannot use wildcards in the search term, for example, when you enter "*" or "?" the search is for exactly these characters.
    • Limit the search: You can limit the search to specific object properties or object types.
  • Use "*" as a wildcard for any number of characters and "?" as a wildcard for exactly one character in a word:

When you use "*" or "?" wildcards in a search term, you will get whole words matching that search term as hits. For example, when you type 'Motor*start', you will get hits such as 'Motor starter' or 'Motor1_Start', but not 'Starting motors' or 'Start motor1'.

A hidden wildcard search is always carried out. If, for example, you enter "Motor" as a search term, the search will also find the texts " Motor_ON ", "Starter motor" and "123_Motor". This corresponds to an explicit wildcard search with the search term "*Motor*". You can deactivate the hidden wildcard search by enabling the "Find exact match" option.

Replace texts in the project

You have the option of replacing individual texts in the project. To do this, you can open the location immediately after the search by double-clicking on the hit list and editing the text. After the change, the text is automatically re-indexed. If you then want to open the next match, you will receive a message offering to refresh the hit list. In this way, you can replace the text throughout the project until the hit list no longer displays the results.

Overview of the search editor

Search editor function

The search editor searches the entire project for specific texts and presents the search results in a clear table.

Search editor layout

The figure below shows the elements of the search editor:

05 image1

① Search mask

② Status bar

③ Search filter

④ List of results

Look for the mask

Enter the search term in the search mask and narrow down the search area. You also have the option of selecting the 'Find exact match' option, which means that the search is limited exactly to the search term entered in the project and similar text fragments are ignored. You start the search in the search mask.

Status bar

The status bar contains information about the search result.

Search filter

You can use the search filter to further narrow down your search results. If you have not activated any filters, the search includes all objects and object properties. If you activate a filter, only search results matching the filter settings will be displayed.

List of results

The results list shows all objects that contain the search term. Double-click the search result to open the corresponding editor and highlight the reference.

Search throughout the project

Requirement

The project is open.

Procedure

To search the current project for a specific text, follow these steps:

  1. Enter a search term in the search text box on the TIA Portal toolbar.
  2. Click "Search in project".

The search editor will open and the search term will be searched for throughout the project. Objects containing the searched text will be displayed in the overview.

Note

No search options can be entered in this search. The entire project is searched and all searchable objects are included in the search. If you want to narrow the search even further or use search options, you can start the search again. To do this, follow the alternative instructions in the "Or" section from step 2 onwards.

Or:

  1. Open the search editor in one of two ways:
    • In the "Edit" menu, select "Search in project".
    • Right-click the object in the project tree and select "Search in project" from the shortcut menu. The object is set as the default search area in the "Search in" field.
    • Ensure that the focus is outside the editor that supports editor-specific searches and press the shortcut .
  2. Enter a search term in the "Search" field or select a term from the list of terms you have already searched for.
  3. To accurately search for a search term, check the "Find exact match" checkbox. If you use this option, you cannot use wildcards in the search term, for example, when you enter "*" or "?" the search is for exactly these characters.
  4. To narrow the search area, under 'Search in' select the sections you wish to include in your search.
  5. To limit the search to specific objects or object properties, select the objects or object properties you wish to include in the search in the "Limit search to" option.
  6. Click "Start search".

The overview will display objects containing the searched text.

  1. Double-click the object to open it.
Manual creation of a new search index

A searchable index of editors' texts is automatically created for background searches in the project. The search index is updated with each change. You cannot start a search before the index is complete. You can also generate the search index manually at any time.

Procedure

To automatically generate a search index, follow these steps:

  1. From the "Options" menu, select "Settings".

The "Settings" window will be displayed in the work area.

  1. In the area navigation, select the group "General > Search in project".
  2. Click "Create search index again".

Result

The project indexes are generated again.

Enabling and disabling "Search in project"

You can centrally deactivate the "Search in project" option if you do not need it. If you need it, you can turn it back on at any time. By default, the "Search in project" option is enabled.

Procedure

To disable or enable the 'Search in project' option, follow these steps:

  1. From the "Options" menu, select "Settings".

The "Settings" window will be displayed in the work area.

  1. In the area navigation, select the group "General > Search in project".
  2. Check or uncheck the "Search in project" checkbox.
Examples of project searches

Examples of the use of property and object filters

The search editor offers filters in the "Restrict search to" area, with which you can limit your search to specific properties or objects. Please note the following mechanism:

  • If you do not enable any filters, the search term will be searched for in all objects and properties that can be searched within the set search area.
  • If you activate filters, only selected properties or objects will be searched.

Examples of the use of property and object filters:

  • Search for an object named 'Engine1':

Enter a search term and activate the "Name" filter. All objects that contain "Motor1" in their name will be found.

  • Search for an object containing the text 'Motor1' in the name or comment:

Enter a search term and activate the "Name" and "Comment" filters. All objects that contain "Engine1" in their name or comment will be found.

  • Search for the block named 'Engine 1':

Enter a search term and activate the "Name" and "Block" filters. All blocks that contain "Motor1" in their name will be found.

  • Search for a block containing the text 'Motor1' in the name or in the comment:

Enter a search term and activate the filters "Name", "Comment" and "Block". All blocks containing "Engine1" in the name or comment will be found.

  • Search for the block or technology object named 'Engine 1':

Enter a search term and activate the filters "Name", "Block" and "Technology object". All blocks or technology objects that contain "Motor1" in their name are found.

As you type in your search term, note the following examples of searching for one or more terms.

Examples of single term searches

If a search entry consists of only one term and the "Find exact match" option is deactivated, the search is always an implicit wildcard search. The system adds a wildcard symbol "*" before and after the search term. You can insert wildcards into the search term yourself to perform an explicit wildcard search. If you want to find the exact search term you entered, select "Find exact match". Upper and lower case letters are not taken into account in the search.

Examples of one search term:

  • Search "motor", option "Find exact match" is disabled

An implicit wildcard search is performed. The search term is interpreted as "*engine*" and all terms containing "engine" will be found, for example "engine", "engine_1", "Motorstart" or " Start_Motor ".

  • Search for 'm*tor' (direct wildcard search). The option "Find exact match" is deactivated

The search term is interpreted as "*m*tor*" in this search using wildcards. This means that terms such as "motor", "motor_1", " Start_Motor ", " GLOB.Mode.motor [1]" or " Mo_tor " can also be found.

  • Search "engine", option "Find exact match" is enabled

No wildcards are used in the search, which means that only the terms 'engine' and 'Motor' will be found.

  • Search for 'm*tor' (explicit search with wildcards). The option "Find exact match" is enabled

The '*' character is no longer a wildcard and is interpreted as a normal character. The search only finds the strings "m*tor" and "M*tor", but does not find the terms "engine", "", "Motormotor_1", for example.

Examples of applications:

  • If you want to determine from where the element "GLOB_DB.MODE.FG [ 6].IN.ERROR_DROP_START" of a data block is accessed, you can use the linkage list. If access is via indirect addressing (e.g. using "# GLOB.MODE.FG [# FgNr ].IN.ERROR_DROP_START := TRUE;"), however, the linkage list does not return any results. In this case, use a wildcard search for "MODE.FG[*]. IN.ERROR _DROP_START" throughout the project.
  • You want to find all occurrences where "ERROR_DROP_START" has been used. Search for "ERROR_DROP_START" throughout the project. The search also finds all elements of "ERROR_DROP_START" in the " FG[ ]" array.

Examples of multiple search terms

If you enter a search term consisting of multiple terms and turn off the 'Find exact match' option, objects containing all these terms will be found. The texts can appear in any order. If you want the terms to appear exactly as you typed them in the object, select the "Find exact match" option. Upper and lower case letters are not taken into account in the search.

Examples of multiple search terms:

  • Search for "engine start-up". The option "Find exact match" is deactivated

All objects containing 'engine' and 'start' are found. It does not matter how far apart they are or in what order they appear. Possible hits include therefore: "start engine", "start my engine", "my engine is in start mode".

Note

The column texts are treated as a text object in the data blocks and block interfaces. Therefore, the search also returns data blocks and blocks in which terms occur, arranged in different rows.

  • Search "engine start*", option "Find exact match" is disabled

As with a word search, an implicit search with wildcards is always carried out for all words in a multi-word search. This means that it is not necessary to enter the wildcard character explicitly. "engine start*" is interpreted as "*engine* *start*" and the same hits are detected as for "engine start".

  • Search "engine start", option "Find exact match" is enabled

When the 'Find exact match' option is enabled, only objects that contain both terms one after the other as a phrase will be found. The search will find the search term, for example, in objects containing the text "press engine start button" or "engine start on". No hits are returned for "start engine", " start engine ", "start my engine", "my engine is in start mode".

  • Search "engine start*", "Find exact match" option is enabled

The '*' character is no longer a wildcard and is interpreted as a normal character. The search only finds objects in which the character string "motor start*" appears in upper or lower case. "Motor start", "Start my motor", "Motor start", "Motor start", " motor start mode " do not result in any hits.

Examples of applications:

  • You want to find out where you used the " Setbit " function to set the " MotorOn " tag. To do this, search for "setbit motoron".
  • You want to find a specific web comment, but you only know that it contains the words "CPU" and "Cycle". To do this, start a search for the keyword "CPU cycle".
Share
Recommended course!
Until 20.09.2022 rebate -15% on:

SIMATIC S7 in action

Sign up for the newsletter!
Author of entries
Tomasz Gilewski

Hello, my name is Tomasz Gilewski. I am the author of books on the S7-1200 controller and HMI panels (i.e. Siemens hardware). I have been programming exclusively on Siemens hardware and engineering tools for several years.

Leave a Comment

Select currency
Scroll to Top

Search on