12-28-2010 01:30 PM
I get a directory listing of TDMS files, then loop through file by file, using TDMS List Contents to retreive the groups found in the particulare file. I open each file, list its contents, and close it before opening and listing the next file.
If a file has no groups, TDMS List Contents returns the group list from the previous file.
How can I prevent this behavior?
12-28-2010 11:37 PM
Hi Matt, Thank you for reporting this problem. Is it convenient for you to post a reproducible VI here? It would be very helpful for us to investigate.
12-29-2010 08:22 AM
Unfortunately, the original VIs were developed on a Classified system, so I can't include them here. However, I've created similar VIs that demonstrate the equivalent problem.
Run the 'create files' VI to generate appropriate TDMS files, and the 'list contents' VI to demonstrate the issue.
Note that these VI's were created in LabVIEW 9 SP1 (Version 9.0.1 32-bit).
Thanks for taking a look it this!!
12-30-2010 02:38 AM
Hi Matt,
Thank you for posting the VIs and I could reproduced this issue in LabVIEW 2009. This is a known bug in LabVIEW 2009 and was already fixed in LabVIEW 2010. The reason is that the group name out value of TDMS List Contents is not released in time, so next time if there was no group name out returned, it would use the value from last time running. There are a couple of workaround, for example, if you don't have too many files, you can avoid using TDMS List Contents in a loop, instead, you can use multiple TDMS List Contents instances in you VI, secondly, if you already know the group name and only focus on channel names, please wire a value to "Group Name" input terminal if possible.
Thank you and please let me know if you have any question.
12-30-2010 10:44 AM
YongqingYe,
Thanks for the feedback.
I had already checked the LV2009 and LV2009SP1 Known Issues and the LV2010 Bug Fixes on the NI.com website. A few TDMS entries exist, but none related to the problem I'm seeing.
Obviously, if I knew the group names I would not be trying to list them. And without knowing how many TDMS files I will find in a directory, I can't use a separate instance for each file.
I did discover that once I have the Group names, I can try reading the Properties for each Group. If I get error -2507 (Invalid group name and/or channel name.) I assume the Group was erroneously reported. Check the updated attachement.
-- Matt
12-30-2010 07:48 PM
Hi Matt,
Yes, it's a good idea of your way, -2507 error means the group or channel doesn't exist.