Searching for Data with a Script Using the Navigator Interface

DIAdem 2018 Help

Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)

DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help
DIAdem 2020 SP1 Help

Use the script interface in DIAdem NAVIGATOR to search for data with a script. For example, to create a script that opens the DataFinder My DataFinder in the DIAdem NAVIGATOR interface and that runs a quick search for files, groups, and channels with properties that start with the letter W, complete the following steps. If the number of found elements exceeds 10, the example only searches for files that contain groups with names that start with the letter W. If the DataFinder finds files that meet these conditions, the program loads these files into the Data Portal:

  1. Select DIAdem SCRIPT.

  2. Select File»New»VBS Script to create a new script.

  3. Enter or copy the following text into the script editor:

    Dim oMyQuery, oMyCurrDataProvider, bRet, oMyResults
    bRet = Navigator.Display.OpenDataFinder("My DataFinder")
    If bRet = TRUE Then
      Set oMyCurrDataProvider = Navigator.Display.CurrDataFinder
      Set oMyQuery = Navigator.CreateQuery(eTextQuery)
      ' Searching for W*
      oMyQuery.Text = "W*"
      Call oMyCurrDataProvider.QueryForm.SetCurrQuery(oMyQuery)
      Set oMyResults = oMyCurrDataProvider.ResultsList.Elements
      If(oMyResults.Count > 10) Then
        ' Restraining search and searching only for files with groups with the name w*
        Set oMyQuery = Navigator.CreateQuery(eAdvancedQuery)
        oMyQuery.Returntype = eSearchFile
        Call oMyQuery.Conditions.Add(eSearchChannelGroup, "name", "=", "w*")
        Call oMyCurrDataProvider.QueryForm.SetCurrQuery(oMyQuery)
        'Optional: Call oMyCurrDataProvider.QueryForm.Condition.Add(eSearchChannelGroup, "name", "=", "w*")
        If(oMyResults.Count > 0) Then
          ' Showing results and loading data
          Call Navigator.LoadData(oMyResults)
        End If
      ElseIf (oMyResults.Count > 0) Then
        Call Navigator.LoadData(oMyResults)
      End If
    End If
  4. Select Script»Run VBS Script to start the script.

Note  Refer to Searching for Data with a Script for further information on the script interface in DIAdem NAVIGATOR.


Brake Tests for Trucks | Checking DataPlugins for Timeout | Combining DataFinder Search Results | Context Menu for the Search Results of the DataFinder | Creating ATFX Files from the Context Menu of an ASAM Data Store | Evaluation Wizard for the Search Results of the DataFinder | Filtering Data with a Dialog Box | Filtering Data without a Dialog Box | Search and Evaluation Functions in User Dialog Boxes | Searching for and Evaluating Channels | Searching for Channels in the NAVIGATOR | Searching for Data Sets Marked "Failed" in Data Stores | Searching for Data Sets Marked "Failed" | Searching for Properties and Evaluating the Associated Channels | Varying Browse Settings of a Data Store


Not Helpful