LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write multiple arrays to TDMS file or excel file

Dear LabVIEW user,

 

I have a problem with writing my arrays to a file (TDMS or excel). So I have 2 or more 1D arrays, some with strings (Channel names etc), some with double (Scale, offset, etc). Each channel has his own Scale and his own offset value, so in the file those need to be in 1 column per channel. 

 

How can I do this? I've already tried multiple solutions, but they don't work...

 

With kind regards,

 

Peter

0 Kudos
Message 1 of 6
(6,353 Views)

Please provide the code that you've already tried, so that we know how best to help you. There are a million examples of how to write to a TDMS or spreadsheet file, I would suggest starting with those.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(6,351 Views)

Thank you for your fast reply.

 

The thing is, I have a big program that writes data of the multiple channels to a TDMS file. I've tried some solutions in a new vi, and when I saw they don't work, I've deleted them, so I have no vi's where I try. The best thing would be if I could write the scale and offset (= zero element) information to the same TDMS file and appand the data after it. But it doesn't really matter if there would be 2 files, one with the data, and one with the scale and offset. 

 

I've attached my program, so you could see how it works until now. The main vi i'm working on right now is mainv2.43. 

 

 

I hope you can suggest me the best solution to accomplish this.

 

 

With kind regards, 

 

Peter

0 Kudos
Message 3 of 6
(6,335 Views)

Really, you should look at the examples provided by LabVIEW. This is a good resource as well.

What you're trying to do it very simple.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 4 of 6
(6,319 Views)

Hi Pete,

 

As James has already said the best way to learn how to manipulate TDMS files is to look at the help files online and the examples found in the LabVIEW example finder. In particular I would suggest looking at “TDMS Append Multiple Headers” and “TDMS Advanced Overwrite”. If you are still looking for help on this problem these examples show some of the advanced TDMS functions being used that you could use to manipulate your data.

 

It sounds like all you want to do is add the scaling and the offset to the corresponding column of data in your TDMS file. You could potentially do this by adding the scaling to the header of each channel and adding the offset as an initial data point before any of the data is written or at the very end. I would suggest looking at the detailed help for various functions in the TDMS palettes and see if any of these could help you. You could also edit the data as arrays using the array functions to add data points like the offset at the beginning.

 

Regards,

 

George

0 Kudos
Message 5 of 6
(6,223 Views)

It sounds like you should be looking at the TDMS Set Properties function.  This will allow you to attach any number of named properties to a channel.

 

 TDMS Property.png

 

If you open the TDMS file in Excel, all of the set properties and values will be listed on the root page.

 

TDMS Example.PNG

0 Kudos
Message 6 of 6
(6,200 Views)