‎07-18-2019 08:03 AM
Hey guys,
I will try to explain what I want to achieve. I measure different gas concentrations and store them in TDMS. During one measurement session, the number of gases can increase or decrease, so at the beginning I do not know all gas substances which might occur or not.
I have a picture how I want the data to be structured/stored in my TDMS file (and hopefully also displayed in the excel TDMS importer) and how it is structured according to excel at the moment.
I want the cells empty where gas 3 was not present, however, TDMS stores the gas 3 values as depicted. Since I usually also have a column with a timestamp where the data was acquired stored together with the gas concentrations the concentration of the gases kicking in at some time are not in the same row as their corresponding timestamp.
Any idea how I can achieve this?
Solved! Go to Solution.
‎07-18-2019 09:25 AM
I would recommend either writing 0's or NaN for the measurements where gas 3 is not present, otherwise there's no way that I am aware of to make the data appear as shown on the left. Another option would be to write to a CSV rather than TDMS file in which case the data would appear as you want it to.
‎07-18-2019 02:45 PM
Hey thank you for your answer,
I'd go with your first idea, however, since I dont know how many and which gases will be present I cannot create the channels in advance. So I was thinking, if gas 3 appears to be in the measurement matrix, than I would check how many rows the other channels already contain, add that much zeroes and then continue writing the new data of gas 1, 2 and 3 into its corresponding channel.
So in my example, when the 4th sample is acquired and I notice that a new gas has appeared, than I check how many columns have already been written into the file, so in this example 3. Then I create a new channel called "gas 3" add 3 zeroes and after that, I write the new data array containing the concentration of gas 1, 2 and 3. If later on gas 3 disappears out of my measurement matrix I can easily continue writing zeroes or NaN. And if I notice that another gas (e.g. gas 4) appears I can proceed as before.
Would you think this is an elegant solution?
kind regards
Slev1n
‎07-18-2019 02:55 PM
‎07-26-2019 04:39 AM
Update:
I sticked to my approach and it works.
However, I think your approach is possible but rather complicated since organizing them afterwards means you need a timestamp in each group and then you need to organize your NaN or 0s using these timestamps which I think could be a pain in the a** if many gases have entered/left the matrix several times 🙂