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.)
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.
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.
- 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,
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.
million thanks for help.