07-13-2016 07:48 AM
Good afternoon forum users!
I'm after some help, and I'm wondering if anyone out there has any idee or helpful hints in resolving the issues I'm having. I'll do my best to describe the situation.
I am currently working on a script that allows users to select a root folder, containing one or a series of TDMS files that are all different but contain the same header information. The main reason for this script is to load in, sequentially, each of the TDMS files - present the user with a dialog box that populates a list of channels, as per the header information.
I have succeeded in populating the dialog box, using the CreateDataFileHeaderAcces function and the user the able to select the channels they wish to keep. However, in order to help with the error handling of the script I wish to ensure that each TDMS file, in the chosen directory, has the same number of channels. In order to test this I used an existing set of TDMS files, generated from a run of the script previously taking each data file from 21 channels to 3. However, upon accessing the header of the new files (that once had 21 channels) in, the
' oMyDataStore.RootElements(1).Children(1).Children(1).Properties.Count ' function still returns a value of 21, not 3.
Is this a bug? Or do I need to refresh the header information (even though it is loaded in each time)? Is there another means of obtaining a channel count from the header? Am i doing something wrong?
Kind regards
Dan
07-18-2016 02:40 AM
You are not counting the channles but the properties of the fisrt channels
oMyDataStore.RootElements(1).Children(1).Children.Count
will give you the amount of channels in the fisrt group.