From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Page through a large query (Element Search)

We have about 4 million recordings in our database. DiAdem 2017 offers a limit
of 32000 elements in Element Search and 2.5 million in Column Search (for one column). Most of
our search queries on the database will have results in excess of 32000 and
sometimes we also need to export these results to a text file using a script (which is not possible with
Column Search).

Is there any way to access all results all at the same time or access all results a bunch at a time? (with / without code)

Thanks!

0 Kudos
Message 1 of 3
(1,877 Views)

Why is the export not possible using the column search.

Just load the properties into DIAdem channels and loop over the lines in the channels.

 

Option Explicit

dim oMyDataFinder : Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder")
Dim oMyQuery : Set oMyQuery = oMyDataFinder.CreateQuery(eAdvancedQuery)
oMyQuery.ReturnType = eSearchFile
dim oMyConditions : Set oMyConditions = oMyQuery.Conditions

Call oMyConditions.Add(eSearchFile,"dataPluginName","=","TDMS")
oMyConditions.Logic = "C1" 

Dim oMyResultsColumns : Set oMyResultsColumns = oMyDataFinder.CreateResultsColumns()
call oMyResultsColumns.RemoveAll
call oMyResultsColumns.Add(eSearchFile, "folder")
call oMyResultsColumns.Add(eSearchFile, "fileName")
call oMyResultsColumns.Add(eSearchFile, "indexStatus")
call oMyResultsColumns.Add(eSearchFile, "dataPluginName")
Call oMyDataFinder.SearchProperties(oMyQuery, oMyResultsColumns, 2000000)

Dim oMyImportParameter : Set oMyImportParameter = Navigator.Settings.CreateImportParameter("Load")
oMyImportParameter.LoadReturnMode = eLoadReturnChannelElements

data.root.clear
data.Root.ChannelGroups.Add("target").Activate
dim channels : set channels = Navigator.LoadProperty(oMyDataFinder.ResultsProperties, ,oMyImportParameter)

dim nrOfresults : nrOfresults = channels(1).size
dim i : for i = 1 to nrOfresults
  logfilewrite channels(1).values(i) & channels(2).values(i) & " " & channels(4).values(i)
Next
0 Kudos
Message 2 of 3
(1,852 Views)

Thank You Andreas!

This works. I was able to export results with your sample code.Smiley Happy

0 Kudos
Message 3 of 3
(1,834 Views)