LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tdms problems with multipe channels

Highlighted

Hello,

 

I'm having a problem with my TDMS files that I'm writing. Basically I'm bringing in 8 channels of A/D data, scaling it and whatnot. Then I'm checking to see if the channel is "active" (as decided by the user) and zeroed out (setting the value to 0) the channels that are inactive. The result should be 8 columns of data with some filled with zeros. I'm simultaneously writing a CSV file with the same data and that is coming out as expected.

 

The problem with the TDMS file is that despite writing a header with 8 channels in it, the file will at most have 5 columns while still containing all the data points. The data for the missing columns is tagged on below each row of the 1st column; that is at time 1, column 1 will have 3 values while 2-5 have 1. So channel 1 may have 300 data points while the other columns have 100. I've attached a sample xls from the tdms here (with the data in the 2nd sheet). I've also attached the CSV file (also as xls) from the same test example as well.  

 

If all 8 channels are active, the same problem exists. The example actually has 6 active channels and 2 inactive channels. 

 

I'm using Labview 8.6 with the Excel TDMS add in. I've also checked in Signal Express (with the "Import from Labview TDMS" add in) and still had only 5 channels showing up, so I don't think it's the add-in. 

 

I'm writing data within a loop using DAQmx to acquire data and with a tdms read-write-close subvi that I've posted below. The "Channel Name(s)" and "units" arrays that I'm feeding in each have 8 elements. The overall VI seems inconsequential to me because I'm writing the same info to the CSV file which is coming out fine (8 columns of data with zeros in the columns where the channel is inactive.)

 

Do you have any ideas as to what might be causing the problem?

 

(The reason we zeroed out the inactive channels rather than just not recording them was so that a user could activate a channel mid-test.)

0 Kudos
Message 1 of 6
(1,707 Views)
you have connected a string array input to the For loop (with indexing enabled). Just check what is the size of this array. I doubt its not 8 always....
Message Edited by Guruthilak on 02-04-2010 10:10 AM
Regards
Guru (CLA)
0 Kudos
Message 2 of 6
(1,685 Views)
I believe that's "Channel name(s)" (passed through the TDMS write block). If it is (I don't have the vi in front of me at the moment), I checked that yesterday and it's always 8.
0 Kudos
Message 3 of 6
(1,670 Views)

Firstly, is that convenient for you to check in LabVIEW, by using TDMS File Viewer? Then it helps you know whether this is a problem of TDMS itself or it's the problem in TDM Excel Addin.

 

Secondly,  maybe you can make a chart as an indicator on the front panel, to see whether the signal does contain 8 channels.

 

Thirdly, what are the data types for the 8 channels? Are they all TDMS supported data types? For example, you cannot write timestamps as a TDMS channel. 

0 Kudos
Message 4 of 6
(1,662 Views)

The number of channels your VI will write is exactly the number of signals in your "Signals (Data)" array. If there are no signals in this array representing the channels that are "zeroed out", they will not be written. The only exception to that would be if you pass dupicate channel names into TDMS Write. Signals for channels with the same name will be concatenated. These two things is what I would check on first.

 

More details:

 

- The number of channel names doesn't matter. TDMS Write will extend or truncate the array of channel names as needed. The channel names output of TDMS Write will be an array of the names of the channels you have actually written. It might or might not match the incoming array of channel names.

 

- You could technically create more channels by calling "TDMS Set Properties", but since your for loop iterates over the channel names coming out of "TDMS Write", that can't happen in your VI.

 

- If what you're trying to do is pass 8 channel names and 5 signals into "TDMS Write" in order to create 5 data channels and 3 empty channels, you can simply wire the indexing tunnel of your for loop to the "channel name(s)" input of "TDMS Write" instead of the output. Since these channels would be empty (0 values as opposed to N values all of which are 0, I take it that this is not what you want.

 

Hope that helps,

Herbert

 

0 Kudos
Message 5 of 6
(1,640 Views)

hello herbert,

 

same situations of mine. i really need to have some basic reference (simple block diagrams) on how to start with to be able to perform data management in multiple TDMS files - multiple groups - multiple channels. I have a new post in the link below. kindly check out for details.

 

http://forums.ni.com/t5/LabVIEW/TDMS-group-by-date/td-p/1486182

 

million thanks for help.

 

Ivel R. | CLAD
0 Kudos
Message 6 of 6
(1,035 Views)