Rearrange TDMS

So we are writing data to TDMS, and then doing post-processing and reporting in Excel.  Someone asked me if it would be possible to swap a few columns in Excel.  That means rearrangeing the order of the channels in the TDMS data.  Normally the answer is nope can't do it.  TDMS is write only and you can't edit it.  But then I realized well that's not entirely true you can read the whole file, then re-order the data and write a new file but that will take a while and very memory intensive if the data size is large.
But I thought of another way to rearange the data.  TDMS has what I think is an undocumented features, which allows you to perform a binary copy function, combining multiple TDMS files into one.  The channel order will be defined by the first file in the combine function.  So I made two TDMS files, one with a channel Time at the beginning, and one with Time at the end.  If I perform a "copy /b File2.tdms + File1.tdms Output.tdms" the order will be changed.  The down side is that the data from File2 will be at the beginning of the new file.  So I tried making a "Header.tdms" which contained no data, only the order by setting properties of the channels.  This does create the proper order in the Header file, but when I combine them the file is corrupted and can't be opened.
Attatched is my example.  Run the VI, reorder the channels then click Save.  It will make Header.tdms (which is fine) and then it will combine Header.tdms and Temp.tdms into Broken.tdms which can't be opened.  But If I simply combine Temp2.tdms and Temp.tdms (there is a button for this) the output is reordered and good.
So my question (finally I know), is there a way to reorder the TDMS channels?  Other than reading and writing the whole file, and other than controlling how the TDMS file is first made (by writing the correct order first).  I feel like I am close because I can do this if data gets appended, but don't want new data in front of Temp.tdms I just want the new order.  Thanks.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
Attachments:
Rearrange TDMS.zip ‏40 KB

deppSu wrote:
Hi Hooovahh,
The columns order displayed in Excel is determined by the channel order logged in the first segment of the TDMS file. This explains why you make a new TDMS file with different order and concatenates with the original TDMS file and the order can be changed to the header TDMS file. Unfortunately, as far as I know, there is no other way to accomplish that except for rewriting the TDMS file or appending new header. 
However, I think your VI is a good solution to such requirement.
I realize where the order comes from, which is why I made this example.  I also realize that this is the most efficent way of doing this because I don't have to recreate the TDMS file.  Imagine if my temp.tdms was several GB in size.  It would take a long time to read all the data channel by channel, group by group to recreate it with a new order.
Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

Similar Messages

  • Read multiple tdms files

    Two questions:
    1) how can i rename the different signals in the tdms file? Now they are names "untitled x". I am looking for an elegant solution, because i record about 200 different Signals.
    2) Is there an "easy way"  to select, read and concatenate multiple TDMS files to show them in a graph?

    I had a similar goal with grouping plots and  rearranging them on the X-axis, so I put together this pretty quickly to search a range of TDMS files for a specific channel, should be able to adapt it pretty easy to suit your needs, once you manage to rename your channels.
    Attachments:
    Record Grouping.vi ‏48 KB

  • Can't boot up in TDM mode

    My G4 will not boot up in Target Disk Mode. I've restarted it with the T key pressed three times and it just ignores it and boots up as normal. I'm running 10.3.9 on a G4 at 350 mhz.
    I'm puzzled.

    Hi-
    Are you using an Apple wired keyboard? If not, could be the problem.
    Try setting Startup Disk preferences to Firewire TDM, and restart from there.

  • TDMS: is it possible to use sender and receiver client within the same SID

    Hi all
    I have a general question about TDMS: i always read that it is possible to refresh data from a productive system/client to a test system/client, e.g. PRD100 => DEV100. But is it also possible to refresh data from one sender-client to the receiver-client inside the same system using TDMS, e.g. DEV100 => DEV200.
    i'm asking because if i start to build up a new client using tdms the first step is to build up the client using package "ERP Initial Package for Master Data & Customizing". This includes under point "data transfer" the step "lock the system" with teh following description:
    Lock System
    Activities
    During data deletion in the receiver client, the tables are dropped. All clients in the system are affected by this procedure. Consequently, all users in all clients in the receiver system must be temporarily locked while the data deletion takes place.
    The function for this activity locks only the current client. If the receiver system is a single client system, it is sufficient to execute the function. If, however, the receiver system is a multi-client system, the user in the other clients must be locked using standard means.
    Anyone has any experience with this scenario inside the same system?
    Regards
    Adrian

    You can run TDMS package on the same system and between different clients. However SAP don't recommend to run TDMS package on the same system.
    There are 2 ways to delete data in receiver system: Array delete and drop insert.
    You have to use Array Insert only which is usually very slow as it first select all the relevant entries from the tables in the target client and then drop it. So, it is slow.
    Drop insert is much optimized and fast but the same can not be used in this use case.
    That is the reason SAP don't recommend to have TDMS run in same system.

  • USB 6009 and TDMS write

    Dear all!
    I'm using USB-6009 device to adquire data from a physical channel. In the following vi, the number of samples to be adquired is set to 1000, with a 100Hz rate. Therefore, as I understand, the number of samples that should be read inside the while loop where DAQmx read is placed should be 10 for each iteration. However, I've tried to store this information in a TDMS file and I'm getting less number of samples as expected. I wouldn't like to lose any data.
    I've read overthere that the USB-6009 is a software-timed device, so, can this be the reason of this anomaly? Moreover, if I analyze the adquired samples using DIAdem software, I see some samples are being repeated. In this case, am I overwriting some data and reading past values?
    If I need to replace my data adquisition device with a hardware-timed one, which one should I get?
    Thank you very much in advance,
    Miren  
    Attachments:
    USB6009_TDMS.vi ‏25 KB

    When you run the sample clock in  "Continuous Samples" mode, the # of samples only determines the buffer size.  This is outlined in the help for that function.
    As a result, you have nothing pacing the internal loop: If there are samples available when it reaches the DAQmx Read, it passes out as many as are available in the buffer.  You might get 1, 2, 100; it depends on how long the other operations in the loop take.
    In general, DAQmx loops like this can be paced either by time or by # of samples.  Looks like you want sample pacing: wire the number of samples you want to collect to the "# of samples per channel" input of the DAQmx read.  Then the loop will wait at the daqmx read until that many samples are ready, and then it will proceed.
    -Barrett
    CLD

  • Error reading TDMS file with inconsiste​nd dt

    Hello all,
    I would like to ask your help to understand how to read a TDMS file which I am opening and closing based on a user input.  As a result the data in the TDMS file does not have a consistent time step, which may be causing my problem, but I really don't know.  I keep getting the error 2501, that I have an invalid reference. 
    Or, if I continue and bypass the error, the extract portion VI gives me an error stating that I need to define an integer multiple of dt.
    I am not sure how to solve the first point as I have the reference wired directly to the read TDMS vi.
    I have attached a screen shot of the error and the portion of the VI with the offending error (it is the code connected to the read TDMS read vi).
    My goad is to extract a portion of the data to do calculations on and display a result to the user.
    thanks for any comments.
    A. Lopez
    Attachments:
    error-2501.JPG ‏198 KB

    I think you open multiple times the same TDMS file, you should open it before the while loop. And I don't see a close tdms function...
    Also check for errors on the open TDMS function.
    Ton
    Message Edited by TonP on 02-14-2007 07:45 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Can t send photo using whatsapp on iphone 4s. Choose existing photo from camera roll then, I can only see cancel, send , key and it says press and hold over a thumbnail to rearrange but chosen photo is black... should say blank...what happened?  Re

    Dear all,
    I want to upload photo form photo gallary while using whatsapp on iphone 4s either it was blank or the statement written over " pree and over a thumbnail to rearrange" comes at the bottom of white window haveing sing of cross at top left hand side...some of pics were able to send and some of them are not pl help me..

    PORT YOUR NUMBER OUT...T MOBILE WILL PAY YOUR ETF IF YOU GIVE THEM YOUR VERIZON PHONES.

  • Datagrid rearranging columns?

    I'm having a problem. This code i have written will import
    the XML but it rearranges the fields when i do this:
    "for (var subKey:String in data[0])"
    All of the fields come through but the subKey order is not in
    the order of the actual XML. Is there any way to get the
    "$ColumnNames[$w]" var from php over to flex in the same order?
    I don't know if i just reinvented the wheel, but it was
    definitely a good learning experience.
    MXML is first then PHP is second. Some of the code is copied
    off other examples. I didn't see any copyrights but let me know if
    there are any problems. O and the error thing doesn't work on the
    PHP page.

    I am look for a solution to a similar problem.
    I've got this nice little .fla that displays a DataGrid component (Flash CS3 Professional) using a DataProvider created from XML loaded from URLRequest/URLLoader (.asp source, but could be PHP, etc.).
    It works great except for one little annoying item.  The order of the columns seems to be totally arbitrary.
    I was expecting the order of the column to be the same as they occur in the XML DATA element.
    Here is a sample DATA element (there are serveral such DATA elements in the XML:
    <DATA>
      <AreaID>TNV</AreaID>
      <AreaName>TN, VA</AreaName>
      <MaxDvrHT>4</MaxDvrHT>
      <BoardName>TN, VA</BoardName>
      <RegionName>SOUTHEAST</RegionName>
      <salesGroup>David</salesGroup>
    </DATA>
    Here is the function that builds DataGrid:
    function returnAJAXcallback(evtObj:Event):void{
    // executed by URLLoader event listener "complete"
    // load the XML returned from .asp into XML object
    var myXML:XML = XML(evtObj.target.data);   
    // create a data provider from the XML
    var myDP = new DataProvider(myXML);  
    // create a DataGrid
    var myDataGrid:DataGrid = new DataGrid;  
    // set the data provider
    myDataGrid.dataProvider=myDP;   
    myDataGrid.width = 900;
    myDataGrid.height = 500;
    // show DataGrid on stage
    addChild(myDataGrid);     
    for each (var child:XML in myXML.DATA) {
      trace(child) ;  // list each DATA segment
    Here is the order that the columns appear in the DataGrid (left to right):
    AreaName
    RegionName
    salesGroup
    AreaID
    MaxDvrHT
    BoardName
    So, how in the world does Flash come up with this order?
    Why not default to the order in which the columns appear in the XML?
    Now, if some nice person knows the answer (I'm pretty new to Flash), what do I need to do (with as little code as possible) to get the columns ordered in a similar fashion to the order in which the XML data elements appear?
    Thanks to all.

  • When I sync my ipod to add new material, sometimes itunes will automatically rearrange the song order of my pre-existing albums by number of plays. Why does it do this? And is there a way to stop it?

    When I add an album to itunes and subsequently to my ipod, everything is arranged by track number of the album. Sometimes when I sync in order to add new material to my ipod, itunes for some reason automatically rearranges some of my pre-existing material by songs with the greatest number of plays to least (though sometimes it seems to be completely random). When I check itunes on my computer, everything still appears to be in order but the way it appears on the device often is in the previously mentioned disorder. Why does it do this? Is there any setting that I can adjust to make it stop because the only way I've found so far is to delete the rearranged material and re-import the cd and then re-sync. It might sound picky, but I prefer that my music be in order by track number as the artists themselves intended for various reasons the foremost being that I often listen to whole albums from start to finish and this glitch makes such problematic. I have found some settings in preferences that focus on how material is arranged but this seemed to be focused on the actual folders where the music is located on my hard drive and not the way it appears on the ipod. If anyone knows the reason it does this or has suggestions on fixing it, I would be greatly appreciative. Thanks.

    Did the original songs that do not appear on the car player play in the Music app on the iPod? Sometimes glitches happen and they do not. Also, If y ohave a 5G iPod/iOS 7, purchase songs  will show with an cloud icon by them if they are not downloaded if Shall All is turned on in Settings>iTunes and App Store

  • Having downloaded and installed the latest Maverick Ios I now have a problem with mail.All my mailboxes were in alphabetical order now they are arrange randomly under my mail account, sync does not rearrange them whilst the order in the ISP account is in

    I have downloaded Maverick 10.9 and installed , now my mailboxes in mail are randomly arranged as opossed to being in alphebetical order from A at the top to Z at the bottom how do you rearrenge the mailboxes in an alphbetical order.
    Sync with my provider Gmail does not rearrange them on my Imac

    Thanks for that .
    My actual problem I may not have made very clear - sorry.
    i.e.
    [email protected]
    AA insurance
    Xero
    apple
    building
    insurance
    etc.
    Shows the way the mailboxes are listed in the mail program under any particular provider, in my case I have three mail provider accounts with mail moved from the inbox to the appropraite mailbox eg [email protected] , Xero - where the incomeing mail is filed.
    My problem is to arrange these mailboxes/folders in an alphabetical order under the [email protected] account

  • TS3775 Hi I am trying to connect my mba mid 2011 with an imac 27" 2011 with target display mode tdm. When I am using a thunderbolt cable nothing will work. When I use a minidisplay cable, both screens turn blue but eventually nothing happens. What is the

    Hi I am trying to connect my mba mid 2011 with an imac 27" 2011 with target display mode tdm. When I am using a thunderbolt cable nothing will work. When I use a minidisplay cable, both screens turn blue but eventually nothing happens. What is the problem

    Your answer is likely in Target Display Mode: Frequently Asked Questions (FAQ) - Apple Support If you are familiar with this document, please re-read it and I suspect you may find something you either missed or are doing incorrectly.

  • How can I open a tdms file and replace a subset of data then save that change without re-writing the entire file again?

    Hi all,
    Is it possible to open a tdms file and make a small change an an array subset then save the file without having to save the whole dataset as a different file with a new name? That is to say, is there something similar to "Save" in MS Word rather than "Save As"... I only want to change a 1D array of four data points in a file of 7M data points.
    I am not sure if this make sense? Any help is apreciated.
    Thanks,
    Jack

    You can use either one, but for your application, I would use the synchronous.  It requires far less setup.  When you open the file, set both enable asynchronous and disable buffering to FALSE to enable you to use synchronous with arbitrary data sizes.
    Attached code is LabVIEW 2011.
    This account is no longer active. Contact ShadesOfGray for current posts and information.
    Attachments:
    UpdateTDMS.zip ‏20 KB

  • Why do my bookmarks rearrange themselves every time I start Firefox 3.6?

    I recently installed Windows 7 on this computer and upgraded to Firefox 3.6. I used Fierfox Sync to import my old links, and right away I noticed that the order of my list of links changes every time I open Firefox. Thinking it had something to do with Firefox Sync, I uninstalled the addon, but the problem persists. It's not exactly crippling, but it's enough of an annoyance that I'm ready to switch to another browser. What's going on?
    Here are a few additional observations:
    * It doesn't appear that Firefox is trying to arrange the list by alphabetic or numeric order. Every time I open the program, the list appears in a completely different order.
    * It also doesn't appear that Firefox is trying to arrange them in order of "most visited" or "most recently visited". There's at least one site that I have visited only once or twice that keeps creeping up the list. While sites I visit several times a day seem to move around at random.
    * Links in folders (and folders within other folders) seem to be unaffected. Although the top-level folders do move around the list.
    * When I try to rearrange my list, the space between the first and second items on the Bookmarks Menu is untouchable. I cannot place links, folders or seperators there. But I can move the first and second items to other places on the list, and I can place items just above or just below them.
    * I also occasionally have trouble placing links in other spots on the list. When I drag them to a location and release them, they appear 2, 3 or 4 spots below where I expect them to appear. It feels like Firefox is trying to force them into a specific order, but it's not based on their names, addresses or frequency of use.
    * Items at the top of the list move around a lot more than items at the bottom. I have a few links that I keep at the bottom of my list "just in case" I need to visit an old business site. And they have been unaffected by this problem.
    * I have the same problem with my Bookmarks Toolbar list and my Bookmarks Menu List. Fortunately links haven't jumped from one list to another.

    MikeClark - removing Viewpoint Media Player did the trick for me too. Thank you.

  • Photos being duplicated and rearranged

    There are two issues I've been having with iWeb in regards to photos. The first is that whenever I make a slideshow it looks fine in iWeb, and it even works when I open up the index.html file in Safari, but it doesn't work when I actually upload my site to my host server.
    So, since I couldn't get the slideshow to work, I decided to just build a more stripped down photo gallery. All it is is a bunch of images on an otherwise blank page, nothing fancy. Again, it looks fine in iWeb and in Safari, but as soon as I upload it to my host server it ends up rearranging and duplicating images so that not all of my images are there, and some of them are in places they definitely shouldn't be.
    I'm using iWeb 08, and I use Fetch to upload my pages to a GeoCities website.
    This is my website:
    http://darkfan.com/PhotoGallery.html
    As you can see near the bottom, one photo is duplicated and two are missing and have been replaced with images I created for the "photo gallery" and "home" links.
    Any and all help will be greatly appreciated. Thanks!

    Many people have fixed this by connecting their phone, then disconnecting it and re-connecting it again. Odd I know, but they report it works.

  • How to get the last data point from a TDM file in LabVIEW?

    Hello,
    I am using LabVIEW to analyze some rather large TDM files, and I need a way to get only the last data point.  So far, the only way I have been able to accomplish this is by reading the entire file.  Is there a property in the TDM file or a function in LabVIEW that will allow me to get the index of the last item in a channel?  
    Thanks!
    Christina

    Do you want to avoid reading whole file and want to be able to reach or get the index of last value of channel? is there any specific reason? I am not sure you could do it without loading the whole file. But the easiest way would be just to use array functions "array size" would give you the index of last element. 
    -Nilesh
    Kudos are (always) welcome for the good post. :-)

Maybe you are looking for

  • J2MEWTK 1.0.2 and J2MEWTK 1.0.3

    I've installed version 1.0.3 and it runs well, but I want to know if I can use other classes for version 1.0.2, because it can for version 1.0.3. Thanks.

  • How do I enable sounds in the finder in 10.8.2?

    When I deleted a file in the Finder or emtied the trash I would have a sound that I don't have in ML. How do I enable it? Do I need Tinker Tool, or am I missing a setting somewhere? Thanks

  • Trouble using external iSight with MacBook Pro (which has built in camera)

    Hey Jim, Have a question for you. I have a new MacBook Pro 17". I also have a 23" Cinema Display, and a left over Firewire external iSight camera (which I used to love). Frequently I "dock" my MBP with my 23". I either use the dual-screen between the

  • Converting old analog camcorder video tapes to DVD

    After spending days scouring the web I still have the following question: I have old small Video 8 camcorder tapes, a Mac with a SuperDrive and iMovie/iDVD, but no camera anymore to put the tapes in - what do I buy in order to convert my little tapes

  • Network printer printing raw data

    The printer is an HP PSC 1610 attached via USB to a Windows XP computer. It is shared over the network, and I located it on my Mac, but whenever I print something out of any program, it just prints something like this with increasing indents: %!PS-Ad