08-21-2012 11:38 AM
It's been a while since I fiddled with TDMS and even then, not all that extensively. So take these thougths with a grain (or more) of salt.
- Could you store your channels as waveforms? If any given channel's dt's are constant, that seems like a convenient way to store independent t0's for each channel. What I *don't* know is whether you could store multiple discontinuous chunks for a particular channel and still recover all the separate t0's.
- Only other thought is to make use of channel properties to store t0's as a delimited string. But you'd probably have to do a TDMS Read to recover the existing delimited string, then append the new info before re-writing the property.
-Kevin P
08-21-2012 11:41 AM
I don't think you will be deleting channel B, you will just stop logging to that channel in the TDMS and start logging to channel E.
I meant deleting channel B from the config.
There's still a lot for me to handle. Suppose we record TIME, A, B, C, D into GROUP 1.
Then we record TIME, A, E, C, D, into GROUP 2.
Does that go back and expand group 1 to have a channel E? No, or else what I'm doing now would work.
So group 1 has 5 signals, and group 2 has 5 signals.
If I just concat the two arrays, then I get B + E looking like one channel.
Even worse:
Suppose we record TIME, A, B, C, D into GROUP 1.
Then we record TIME, A, C, D, E into GROUP 2.
If I just concat the two arrays, I get B & C looking like one channel, C & D looking like another, and so on.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-21-2012 11:49 AM
- Could you store your channels as waveforms?
I don't think so. They are not necessarily regularly-sampled. Dependin on engine speed and user activity, the recording interval could vary. It's not high speed, but it's important to keep everything straight as to which goes with which.
Only other thought is to make use of channel properties to store t0's as a delimited string.
Yeah, that assumes Waveforms with equal sampling. Don't think I can guarantee that.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-21-2012 01:00 PM
Ok, sounds like you might be acquiring off an encoder or something analogous. Based on the simplified example, it looks like you plan to store a master time channel in the TDMS file. Difference is that in your real app, the dt's can vary so you can't use a simple constant-dt waveform. Three more thoughts:
- (don't know if this makes sense in your app). If you have constant-position based sampling, you could store the analogous position info in a waveform's t0 and dt elements. Feed them with a p0 and dp.
- instead of storing actual time values in "t0" properties (whether waveform or TDMS channel properties), store something like an index into that master time array. At read time, you could then know which subset of the full master time array to reference for a given channel's data. (I guess you'd need to store another delimited property for the # samples stored with each individual chunk).
- (don't like this one much). Create a separate time channel for each actual channel that needs one. So if you have a channel named "Pressure", you'd also manage a channel named "t_Pressure".
-Kevin P
08-21-2012 01:15 PM - edited 08-21-2012 01:23 PM
you might be acquiring off an encoder
---- Actually I'm doing a "Flight-data recorder" on an engine test setup. (it's not actually flying). I'm recording the main data another way (straight into RAM, then to disk when test is over), but in case of power failure/ catastrohic crash, this TDMS idea provides some data on disk to diagnose the issue. the point is to have something ON DISK.
recording rate is 1 Hz or slower.
Requirements are to do this only if engine speed is above X, so recording times may change if engine speed dips.
If you have constant-position based sampling,
--- No. Your guess was just a bit outside.
instead of storing actual time values in "t0" properties, store something like an index into that master time array.
Clever, but still assuming a deltaT that is constant. I can't guarantee that.
Create a separate time channel for each actual channel that needs one.
Yeah, that's brute force and ugly. TDMS does nothing for me if I have to do that.
Looks like it's not going to do the management for me.
I'm going to have to either force the user to accept multiple groups or files if the config changes, or do a whole bunch of housekeeping stuff myself to make it look like one file.
Thanks for the ideas though.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-21-2012 03:07 PM
OK, it looks like there is no solution to doing what I want.
The Excel Importer recognized groups, and puts them on different sheets. the time is kept aligned.
The Diadem importer is bound to be just as smart.
So, I'll move to the groups idea: If the config has changed, then start a new group.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
08-21-2012 04:36 PM
This may not be exactly the same, but I think it's a bit similar. I had to go with a similar workaround.