From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem opening multiple .tdms files in subroutine

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 sets

Not sure if the global variables located in the SubVI will default, so they are: UpperMaxCol: 55, UpperMinCo: 0, UpperMaxPixel: 48, UpperMinPixel: 6

Thanks in advance for the help
Dan



Download All
0 Kudos
Message 1 of 3
(2,165 Views)

I wired constants in for the missing global variable...

 

0 Kudos
Message 2 of 3
(2,137 Views)

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.

0 Kudos
Message 3 of 3
(2,129 Views)