04-21-2011 02:10 AM
Hi all.
Haven't posted for a bit but interested to hear whether it is possible to determine what is in a data set without physically loading it into the data portal? I think certain things are possible by accessing the TDM Header file using the DataFileHeaderAccess method which is what I am experimenting with at the moment. Maybe there are limitations though with what can be done?
I am specifically interested in determining information regarding the number of channels in each channel group and channel names etc. Is this possible using DataFileHeaderAccess or are there more appropriate ways to do it?
Thanks in advance for any replies.
Matthew
04-21-2011 03:44 AM
Hi Matthew,
DataFileHeaderAccess is one way to approach this, another could be to use the DataFinder API. In case the file(s) of interest are in a search area of DataFinder you can access all descriptive information such as number of channels or channel names without loading the file into the data portal.
You can either search for whole files, groups within a file or even channels which match certain criterias (such as having the same name).
The attched snippet search for channels with a specific name prefix in file(s) with a given file name and load it into the data portal.
Greetings from sunny Aachen
Stefan
------------------
Option Explicit 'Forces the explicit declaration of all the variables in a script.
' Connect to the DataFinder
Dim oMyDataFinder, oMyQuery, oMyResults, oMyConditions
Set oMyDataFinder = Navigator.ConnectDataFinder("My DataFinder")
' Create a query to search for channels with a specific name prefix in a a specific file
Set oMyQuery = oMyDataFinder.CreateQuery(eAdvancedQuery)
oMyQuery.ReturnType = eSearchChannel
Set oMyConditions = oMyQuery.Conditions
Call oMyConditions.Add(eSearchFile,"fileName","=","Example.tdm")
Call oMyConditions.Add(eSearchChannel,"name","=","Noise*")
Call oMyDataFinder.Search(oMyQuery)
' Load results
Navigator.LoadData(oMyDataFinder.Results)
04-21-2011 04:53 AM
Hi Stefan,
Thanks for the reply. Something new for me to think about.
Since posting earlier it occurred to me that I could add "custom property" details for each group. I think this would allow me to use the DataFileHeaderAccess method to extract the information that I require.
Always nice to have an alternative method of doing something so I'm gratefull for your post.
I've visited Aachen on a few occassions on trips to Ford there. Very nice place.
Good luck always.
Matthew