05-31-2013 02:12 PM
I am reading data from channels of a TDMS file. The channels are different frequencies which data was recorded. However they are not in order. For example the channels might be arranged, 1 Hz, 2 Hz, 3 Hz, 7 Hz, 5Hz, 4Hz. I am trying to either sort these channels in my file. Or another option would be set and "lock" the channel order in the tdms before collecting data.
Solved! Go to Solution.
05-31-2013 02:18 PM
How are you saving to the TDMS file? Can you share some code?
05-31-2013 03:06 PM
So its a bit complicated. But basically I will call this vi to save data. I input into it different sample rates. So I might call it with input rates in the following order...1Hz, 2Hz, 4Hz, 1Hz, 1Hz, 2Hz, 1Hz, 2Hz, 4Hz, 8Hz, 1Hz, etc. until I am done.
06-02-2013 08:24 PM
If channels are logged with different frequencies. Than the total count of the channels diffs according to different frequencies, am I right? If so you can use property "NI_ChannelLength" to sort the channels.
06-03-2013 09:26 AM
Each channel will "fill up" once it hits a certain length. So that wouldn't work 100% of the time. I guess I know I could sort the channels, there doesn't seem to be too easy of a way to do it.
06-04-2013 01:16 PM
Programatically it makes more sense to me to sort your channels first. You could dynamically check to see if the "channel" is full then increase the length accordingly.
06-04-2013 05:06 PM
I'm pretty sure that first data points are being written to each channel with proper synchronization. But for some reason, the order of the channels is getting mixed up when I am writing to them. I assumed that once a channel is added to the file, its place is set. Is there a way to create empty channels in the beginning, so the orders are set?
06-04-2013 09:34 PM
Now I know what you mean. The mixing of channels is because of the "NI_MinimumBufferSize" property which will cache raw data until it reaches the amount you set.
You are right that once a channel is added to the file, its place is set. Thus, you can try to put a "TDMS flush" right after your "TDMS Set Properties" node. Once channel with properties is flushed to disk file, the place is set.
06-05-2013 10:12 AM
Ahhhhh. I thought it might have to do with the buffer size. That did the trick! Thank you.