LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I write array data to TDMS file with channel names

Greeetings, 

 

I have a VI that collects data from an HP 34980A and the data is output as an array of doubles each time the multiplexer finishes sampling the channels.When I try to write this array data to TDMS by first changing it to dynamic data and then setting channel properties using a for loop only one channel is named. The rest of the channels show up as untitled and without units.

 

I created the attached VI to illustrate the problem as I cannot attach the original for proprietary reasons. Can anyone tell me what I'm doing wrong and how to assign properties to each channel ? Also I'm not particularly atached to using dynamic data , if anyone has a way to do it using waveform or other data type, I'd appreciate it.

 

Thanks!

 

Yin the novice  

0 Kudos
Message 1 of 6
(7,836 Views)

Here is a screenshot to illustrate my current approach

labview_block.png

0 Kudos
Message 2 of 6
(7,829 Views)

You have to wire channel names to TDMS Write or TDMS will automatically give names.  I'm not quite sure about the intention of your VI, do you want to create 11 channels with only one sample for each channel ? If this is the case, you can wire double data to TDMS Write and using TDMS Set Properties for each channel instead of using dynamic data.

0 Kudos
Message 3 of 6
(7,813 Views)

I may be flogging a dead horse but I'm doing almost the exact same thing. We have a 34970A  we are using a index array to break out our individual channels Comma seperated, manipulate the data and then pass it back into a build array to which we write into a Fractional to String followed into a Insert Into Array and then wire to Write Spreadsheet To File. This works very well but I know their has to be a better way. within the week I'm planning on writing to TDMS our channels varry some times upto 40 channels or more. Normally i create a comma seperated Header and allow a single for loop to write data from their out.

I'm wondering if their is a best practices approach that I can apply to this?

 

 

0 Kudos
Message 4 of 6
(7,368 Views)

This is a Screenshot of some sample code illuistrating the current method.

Example VI.png

0 Kudos
Message 5 of 6
(7,365 Views)

So to Season the pot, I went ahead and coded a simple (most likely wrong, at the very least crude) TDMS writing code to go along with the code I supplied from earlier. I am almost sure their is another method to pass Channel Label for each header without multiple builds or discrete TDMS write blocks. Note I'm showing writing both the *.xls and *.tdms simultaneously to exemplify what I'm currently using and what I will eventually adopt. Also I chose only some of the channels for TDMS writing this was a time saving step.

 

Please comment on my coding practices and use of elements I'm still new at this so any advice or assistance is welcome.Example with TDMS.png

0 Kudos
Message 6 of 6
(7,358 Views)