DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

access channel data without loading entire data file

I am trying to use VBScript to analyze some channel data from TDMS files that are found using a navigator query. The files are all stored on the network, and are pretty large. I can do everything I need to do with VBScript if I first load the data into the data portal. This takes a really long time though, since some data queries return dozens of files.  I only need two channels out of each file.

 

Is there some way to grab just the channel data that I need from the TDMS files without having to load the entire file into the data portal?

0 Kudos
Message 1 of 3
(5,978 Views)

Jo Jo

 

I would look at using the command CallDataFileLoad(MyFolders(0)&"test.tdms","TDMS","Register")

 

If you register load the file it loads very fast,but when you access the channels of interest, it then loads the channel into memory.

 

Works great when you don't need to process all the channels.

 

Paul

0 Kudos
Message 2 of 3
(5,973 Views)

@Jo-Jo wrote:

Is there some way to grab just the channel data that I need from the TDMS files without having to load the entire file into the data portal?


Hello Jo-Jo,

 

Yes, DIAdem allows to load just a few selected channels from a file using the following function, and you can combine this with a search in the Navigator and put into into a Script for automatic loading after a Navigator search hasd returned results:

 

Call DataFileLoadSel("TR_M17_QT_32-1.TDM","TDM","[1]/[1,2]","")

 

Command: DataFileLoadSel

Loads selected channels from a data file into the DIAdem Data Portal.

ReturnValue = DataFileLoadSel(DataFilename, FileImportFilter, ImportSelection, [ImportAction])

Input Parameters

DataFilename Specifies the name of a data file with the filename extension and the path.
String variable
  Note  If you do not specify a path, DIAdem uses the NAVIGATOR user path for loading or saving.
FileImportFilter Specifies the loader you use to load an external data file into the DIAdem Data Portal.
String variable

If you do not specify the loader, DIAdem automatically uses the loader associated with the file type.

The valid values for this variable vary according to the registered file filters. The following values are valid:

Value of the variable Meaning Filename Extension
TDM DIAdem TDM files TDM
DAT DIAdem DAT files DAT
LVM LabVIEW LVM files LVM
SQL SQL data format MDB
CSV Comma Separated Values CSV
  Note  To specify the value of the FileImportFilter variable for GPI or DataPlugin file filters, enable the Recording mode and open a file with the appropriate filename extension in the Open dialog box. In the script recorded in the script editor, you then receive the value of the variable as a parameter of the DataFileLoad command.
ImportSelection Specifies the data channels to load from a data file.
String variable

If you do not set this parameter, DIAdem loads all data channels.

Use the syntax [Group index]/[Channel index] for the ImportSelection variable. For the channel index you also can use the * wildcard to load all the channels of a group into the Data Portal. For example, the syntax [2]/* loads all the channels from the second group of the data file, into the Data Portal.

You also can specify channel ranges. The syntax [2]/[2,5-8] loads channel 2 and channels 5 to 8 of the second group in the data file, into the Data Portal.

If you use the wildcard *, DIAdem generates a new group in the Data Portal. If you enter channel numbers, DIAdem appends the selected channels to the default group in the Data Portal.

[ImportAction] Specifies how DIAdem imports data into the Data Portal. The default value of the ImportAction variable is Load.
Enumeration variable
Enumeration variable with the following selection terms
Script Term Interface Term, Explanation
"Load"
Load
"Register"
Register

Return Parameters

ReturnValue The return value is a ElementList object type. The ElementList contains all data elements created in the Data Portal by the command. A superordinate element describes its subordinate element if the superordinate element was created. If the Data Portal is empty during the loading process, DIAdem returns the Root element. If DIAdem creates a channel group containing several channels, the channel group is returned. If DIAdem loads a channel into the default group, the channel is returned.
Otmar D. Foehner
0 Kudos
Message 3 of 3
(5,945 Views)