Discussion:
Problem opening multiple .tdms files in subroutine
(too old to reply)
physicsdan
2008-08-12 19:40:07 UTC
Permalink
Heya- I'm using LabVIEW 8.2, professional development system.I'm using the Open / Read / Close TDMS functions as part of a subroutine in a larger program.  The subroutine is supposed to open one of several TDMS files (each of which contains bulk data saved previously), extract the data, then restructure into a 3D array, which is passed back to the main program.  The particular file TDMS file to open is controlled by the main program.  The TDMS Close function is used after the data is extracted.When running solo, the subVI performs as expected.  When running as a subVI, it functions fine on the first call, but subsequent calls to open different data sets fail to actually open the TDMS file (or at least, the Read TDMS function generates an empty array).  However, returning to the orginal file that was opened, the subVI works fine - it opens the TDMS file.  It doesn't matter which file was intially used - whichever one was opened first functions fine, any others do not.  That would make me think that the first TDMS file isn't being closed, except that I am using the Close TDMS function after reading.Attached are the subVI (TDMS_to_3D_array), a quick test program that uses the subVI, and a .zip of two data setsNot sure if the global variables located in the SubVI will default, so they are: UpperMaxCol: 55, UpperMinCo: 0, UpperMaxPixel: 48, UpperMinPixel: 6Thanks in advance for the helpDan


Data.zip:
http://forums.ni.com/attachments/ni/170/348764/1/Data.zip


TDMS_to_3D_array.vi:
http://forums.ni.com/attachments/ni/170/348764/2/TDMS_to_3D_array.vi


TDMS_loadfault_tester.vi:
http://forums.ni.com/attachments/ni/170/348764/3/TDMS_loadfault_tester.vi
physicsdan
2008-08-13 18:40:06 UTC
Permalink
I wired constants in for the missing global variable... 


TDMS_to_3D_array.vi:
http://forums.ni.com/ni/attachments/ni/170/349079/1/TDMS_to_3D_array.vi
Pie56694
2008-08-13 19:40:10 UTC
Permalink
Hi Dan, Perhaps you would try a few things.- Use the TDMS Flush VI in the subVI before the TDMS Close VI.
- Try running the program with the subVI open.
- Wire the TDMS File refnum from the subVI back to the parent and observe its value as the program switches between TDMS files.
- Perform the TDMS read in the parent VI, wire the TDMS Data and the Array Size of the TDMS dataset to the subVI.  Does this make any difference?
- Try the subVI without the Channel Name string indicator.
- Include error cluster wires throughout the entire subVI.  Wire them through the TDMS VIs, then through the nested For structures, and then back to the parent VI.
Let us know what happens.

Loading...