05-20-2011 12:35 PM
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
05-20-2011 02:09 PM - edited 05-20-2011 02:11 PM
Here is a screenshot to illustrate my current approach
05-22-2011 09:56 PM
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.
05-28-2013 08:36 PM
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?
05-28-2013 09:02 PM
This is a Screenshot of some sample code illuistrating the current method.
05-28-2013 10:09 PM
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.