Number of Groups in TDMS file?

Hello,
Is there a way I can read the number of groups in a pre-existing TDMS file? I want the groups to be named numerically so if I know how many groups there are in a file that was opened, I can automatically set the group name for the next one.
Kenny
Solved!
Go to Solution.

TDMS List Contents is what you're looking for.
You can then do an array size on the Group names list that comes out.

Similar Messages

  • Rename Group in TDMS File

    Does anyone know how to rename a group in a TDMS file?
    I have a TDMS file with 90 groups, each containing 4 channels.  I would like to rename the groups within the file while leaving everything else the same.  Thoughts?
    thank you,
    Scott Otterbacher

    Thanks for the great input.  However, I'm still having some problems.  I have a for loop that runs through all the group names and at each iteration takes in the original and revised group names as inputs into TDMS Set Properties.  Some of the groups go to the correct new names, but some get changed to incorrect ones.  Attached is a copy of the VI.  I'd include one of the TDMS files as well, but each are about 20Mb.
    The TDMS file contains about 90 groups that are decimal strings which relate to antenna azimuth direction.  When I collected the data I did not reference the azimuth to north, but rather I just pointed the antenna north and noted what position I was getting from the encoder (i.e. North = 156 deg).  Now I want to go through and change the group names to be referenced to north = 0 deg.  So I read in the array of group strings, convert to integer, subtract 156 or add 204, depending on the value, and then convert that new number back to a string and send it to the TDMS Set Properties function.
    I am unsure if my problem is how i'm passing the arrays into the for loop or if it's how i'm using TDMS Set Properties.
    Here is an example of what happens:
    original groups: 5,8,13,17,20,25,28,32,36,etc...
    desired groups: 209,213,217,221,224,229,232,236,240,etc...
    new groups: 53,57,61,65,224,73,232,236,240,etc...
    The first few are wrong, but then the 5th is correct along with the 7th, 8th, and 9th.  5 of the groups after that are also correct before it goes back to an erroneous one.  The wrong group names seem to be from the array of correct names, but just from the wrong index of the array.  This seems odd because the for loop should be reading in just one array value at a time, and in the correct order from beginning to end.
    Hope you can help out a confused labview newbie.
    Attachments:
    Change_Az_TDMS.vi ‏25 KB

  • Number of elements in TDMS file

    Is there a way to determine the number of elements in a TDMS file?  The files I am creating have several signals all of the same length.  The only way I can think of is to do this is put it in a loop and read one element at a time until it reaches the end of the file.  But, my files will have millions of elements.  Any suggestions?
    Thanks.
    --Robert

    Thanks Herbert
    For readers having similar problems, here are my experiences:
    It works either without wiring a property name and datatype, as you mentionned before.
    Resulting is a variant array. Result see attached solutionVariant.jpg
    It also works wiring the right datatype as in the TDMS File Viewer and your first explanations:
    Resulting is the channel length as Integer I64 or U64. Datatype constant representation and indicator representation must match!
    See attached solution.jpg
    My error has been wiring a string "I64" as datatype and a string indicator as value indicator. So stupid...
    Regards
    Klaus
    Attachments:
    solutionVariant.jpg ‏30 KB
    solution.jpg ‏8 KB

  • Channel count limit for tdm files

    Hello,
    I have not been able to find any documentation listing the maximum number of groups, channels/group for tdm files.  Does anyone know these values, or a document that lists them??

    Hello CAN_man,
    There is a DevZone document on the topic of TDMS files that can be found at the following link: TDMS File Format Internal Structure
    The document contains the answer to your question, and states that:
    "Each file can contain an unlimited number of groups, and each group can contain an unlimited number of channels."
    Please let me know whether you have more questions!
    Kameralina
    Ask NI (ni.com/ask)
    Search The KnowledgeBase
    NI Developer Zone
    Measure It. Fix It. ni.com/greenengineering/
    NI Vision ni.com/vision/

  • How does DIADEM import TDMS files? How gets every channel his number and groupindex? How can I determine which channel has which groupindex and number?

    I store different channels in a TDMS file.
    I like to have a time channel at the first position with group index 1 and number 1.
    When I read the TDMS file with DIADEM the time channel (Float64) is on a differernt position, and the channels are not sorted alphabetically.
    Here are my questions:
    How does DIADEM import TDMS files?
    How gets every channel his number and groupindex?
    How can I determine which channel has which groupindex and number?
    Best regards
    Joerg

    Hi Jörg,
    i suppose that you´re programme whose create the *.tdms file is writing on false position. Try to create datas with timechannel on first indes in diadem, then save it and then open it again. you see that all is correct. So please tell me what programm in what version do you use and please attache it here.
    Did you use the library for creating *.tdms files like in the link ?
    http://zone.ni.com/devzone/cda/tut/p/id/6471
    Here you find the gtdms_8.x.zip - when you extract it and opened the *.llb you find vi´s for all functions e.g. writing 2d array of strings to *.tdms file
    when you open the subvi´s then you see how created and writing datas/structure to *.tdms files. Because *.tdms is binary you can´t see structure with open it in editor.
    When you don´t have Labview you can use the 30 days test of current version 8.5 under following link
    german version download link
    https://lumen.ni.com/nicif/d/lveval/content.xhtml
    english version download link
    https://lumen.ni.com/nicif/us/lveval/content.xhtml
    Hope it helps
    Best Regards

  • Error -2500 while writing new channel groups / channels to tdm-file

    I'm creating a tdm-file using the express vis provided by LabView. Everything goes fine in opening the file and setting the file parameters.
    When i'm using the write data-express vi to create a new channel group and setting it's parameters i receive an "error -2500" accompanied with the call chain of the vi.
    I'm setting the parameters by using a terminal on the express vi and by using the value setting in the express vi configuration. Any ideas what might cause this error?

    I solved it. I made the error to begine some of the properties names with a number, eg. 1s for 1 sigma. I renamed them to sigma_1s and it works.

  • Script to auto zero channels in a TDM file with multiple channel groups

    Hi friends,
    I am trying to process some data but am having trouble modifying a script to autozero channels across multiple channel groups. The following script works to zero channels across one group. I use this script to process data in a TDM file with only one channel group. I need to be able to zero channels across multiple groups (5 groups). But the amount of groups I will have may change so I might need an option to enter the amount of groups or have the script determine the amount of groups in my TDM file. 
    Here is the code I use to zero the data. Thanks in advance for your help!
    Sub UserDlg_Select
    Call USERDLGINIT()
    USERDLGCAPTION="Auto Zero Channel Based on Specified Points "
    USERDLGTXT(5)="Number of points to Average"
    USERDLGCOMMAND(5)="t1"
    Call USERDLGOPEN()
    End Sub
    Call UserDlg_Select()
    T2="1-"&T1
    For I= 1 To ChnNoMax 'For all data channels except time
    T4=CHNNAME(I) 'Create string for Channel name (I)
    T3=ChnDim(T4) 'Create text variable for channel dimension
    STATSEL(6)="Yes" 'Arith mean
    STATCLIPCOPY="yes"
    STATCLIPVALUE="No"
    Call StatBlockCalc("Channel",T2,T4) 'Calculate Stats for Channel (I)
    'Subtract Mean of first (T1) points for Channel (I)
    Call FormulaCalc("Ch('temp1') := CH('"&T4&"') - statarithmean")
    CHNCOMMENT("temp1")=("Channel zeroed over first "&T1)+"pts" 'Add Comment
    ChnDim("temp1")=T3 'Add Dimension
    CHNNAME("temp1")=T4+"-Z" 'Save updated data with -Z
    'Delete Stat Channels
    Call CHNDEL("ArithmeticMean")
    Call CHNDEL("Sum")
    Next 'End For loop
     

    Hi rvillalta319,
    Sounds like you'll need to adapt your code to use both a for loop and some implementation of the GroupCount variable (or ChannelGroups.Count) as seen here:
    http://zone.ni.com/reference/en-XX/help/370858K-01/varoff/groupcount/
     

  • Create sub-group or sub-channel in TDMS file?

    Hello All,
      I have been presented with a situation where I am required to log data that is arranged in a multi-level hierarchy.  My preferred method for data logging is the TDMS format, but it is unclear if I can log more than 2 levels of hierarchy with this option.  In the terminology of TDMS file, I would need to create "sub-groups" or "sub-channels" so that all of the data can still be arranged within the same parent group.  Is this type of data arrangement possible with a TDMS file?
    Thanks,
    GSinMN 

    My understanding is that TDMS files are set at 3 levels of hierarchy: File, Group, Channel.  You could probably name the groups to show a parent group such as "Parent:Group".
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do you save arrays in tdm files?

    Hi,
    As part of a university project I am trying to save some program data to a .tdm file.  On each channel I wanted a number of different types of data including an analogue wave form and a couple of 1-D DBL arrays.  I have found an NI presentation that says that you can store arrays in them but dont seem to be having any luck.  Any ideas what Im doing wrong?  I am using labview 8.5.
    Regards,
    James

    Hi James,
    in a channel, you can save only one array as data. If you want to save more arrays then use several channels. You can organize them in groups. If the arrays must be in the same channel, then convert them to a spreadsheet string (in string palette) and save the string as a property.
    Greetings,
    shb

  • Read time of tdm file increases

    Hello,
    I recently recorded a lot of data in tdm format. I originally saved it in an excessively organised and complex way which resulted in large header files and was very slow. I changed it and most of the data is fine, except 6 files in the old format. Just trying to read them to get the data out and then convert it into an easier format is taking far too long. Each file has ~15000 channel groups, each with 3 channels (I won't do this again...). I have witten a small vi to test the reading speed. Excluding opening and closing of the file, if I just find a channel group by name, reading one channel from that group takes about 1 second. This would still take days to read it all but would be acceptable. The strange thing is, is that if I do this in a loop for successive channel groups which is clearly necessary, it takes longer and longer each iteration. This is behaviour that I have always seen when reading tdm files, but it hasn't caused a serious problem before. I can't find any information about why though, so I hope I'm just doing something stupid. I have attached the speed testing vi (Labview 2010). Running it for 5 iterations, the time taken to read the channels is
    0.82304 s
    1.58809 s
    2.42514 s
    3.56820 s
    5.60632 s
    The channels it is reading all have the same number of values, and it makes no difference if I start at a different channel group (by adding a number to i in the loop).
    Does anyone have any explanation for this behaviour?
    Thank you very much for your help, and I'm sorry if it's something tht has been asked before,
    James 
    Solved!
    Go to Solution.
    Attachments:
    ReadBadTDMSpeedTest.vi ‏44 KB

    TDMS is an all binary format whereas TDM posses an XML header, otherwise they are very similar. Being a binary format you would expect it to read faster especially as you mentioned that the header was complex.
    There are a number of un-closed references in your code and I wonder if this was partly the issue, although this wouldn't explain why converting to TDMS fixed the problem?
    Beyond that, it would be nice to try this without using the express VIs to see if the problem still occurs. 
    Also, where you able to see if this was a memory issue? And if the read time continued to increase beyond what you posted?
    Anyway, I am glad we found a solution to your problem.
    Nick C.
    Cardiff University

  • Extra empty groupName in TDMS file when using DAQmx Start New File & stop DAQmx while waiting for trigger?

    I wrote a VI that listens to an external trigger coming from a PFI line and saves a user-defined number of pretrigger+posttrigger samples into disk, and then the DAQmx restarts to wait for the next trigger. I used the DAQmx Start New File.vi to change the filename of each of the next file. However, I found that for each of the resulting TDMS files, there is an additional group that is added in addition to the real data. For example, if the groupName is set to "task_voltage", then there is an additional groupName called "task_voltage #1".
    I suspect that this is because the program preallocate diskspace using the old filename for the pretriggered samples, but when the trigger happens and the samples are ready to be written into disk, an actual new file is opened and saved. The reason I think this might be the case is because, say each file would be 50kB and I already have 1 file triggered and saved, before the second trigger comes in, I can see that the file size of the first file is twice as much as it should be (100kB), but the file size will return to noraml (50kB) after the second trigger happens and a second file is created.
    Does anyone know if this is really the case? Is there a way to configure the task so that this doesn't happen?
    Another question I have is that the program currently set up so that the VI will wait until a trigger happens to return the values. However, this means that if a trigger doesn't happen, the VI waits indefintely, and the "stop" button in the while loop is useless. I have to use the "Abort Execustion" button on the tool bar to stop the VI. Is there a way to interrupt and stop the DAQmx task even if the trigger doesn't happen?
    Thanks in advance for any help!
    Attachments:
    pretrigger_loop_new_file.vi ‏29 KB

    I don't believe there is a way to programmatically change/delete the group name in a TDMS file. What you can do however, is convert between TDMS and TDM using the VIs found in the Data Storage palette and then perform whatever modifications you need using the TDM utilities.
    Applications/Systems/Test
    National Instruments | AWR Group

  • Break large TDMS file into small files

    hello all
    My TDMS file is around 3g, and needs changed into around 10M size files. 
    I ran McRorie's splitFiles.vi ‏15 KB in this page.  and set the number of samples per file as 5000000, however, I cannot get the results I need. every small file is only 1KB, and no data inside. What is the possible problem in this?
    Also, I tried to write a vi based on sample vi(Read TDMS File) by adding one "write to measurement file.vi". However, when I set the small file size as 10M Byte inside the"write to measurement file.vi", the first file could be around 20M, and the next few files may be correct as 10M, and then it just stop splitting, edding with a file even much larger than original file. I uploaded my vi here, maybe someone  can help to find some mistake for me. 
    Thanks very much!
    Wuwei Mao
    Solved!
    Go to Solution.
    Attachments:
    Read TDMS File.vi ‏54 KB

    Hi Wuwei,
    After giving the correct data type to TDMS Read node in splitFiles.vi, it works as expected. ( See the attached two VIs: createFile.vi and the modified splitFiles.vi)
    Because I don't know how you created your TDMS file, I write a new 3G bytes TDMS file, which has one group and one channel. The data type of samples is unsigned 16-bit Integer. The total number of samples is 1610612736. Then I set the number of samples per file to 5000000 as you did. So after splitting, each file size is 5000000*(16/8) bytes (around 10M bytes).
    Please make sure the followed steps have been done before you run the splitFiles.vi:
    1. The TDMS file will be split has been put on the proper path;
    2. The correct group and channel names have been given;
    3. The correct data type to TDMS Read node has been given.
    Because your second option using "write to measurement file.vi" to split TDMS file will lose some information, such as group and channel names. So I suggest using the method used by splitFiles.vi to accomplish your goal.
    Jie Zheng
    NI R&D

  • TDMS file update in CVI

    Hi Everyone,
    I am new in CVI development.. My current work is on TDMS inside CVI 8.5 , I been through CVI help on TDMS and one white paper on NI website..
    My current requirement is that user is running application and see the data on graph of user interface.. if user accepts the data and press control buttoon accept the data will get saved in TDMS file.. otherwise user will redo the data acqusition process to see another iteration result to accept or deny..
    I am able to write data first time but as i accept another set of data it throws an error
    -6604
    TDMS_FileCouldNotBeOpened
    The file could not be opened.
    Inside TDMS_CreateFile function, i understand it may be as file is already created in first iteration..
    Is there any way to update the same channel data by appending every iteration with time stamping ?
    Thanks for your time and support
    Regards
    HS
    Solved!
    Go to Solution.

    Hi,
    my syntax for control button "Accept" press is as below
    int CVICALLBACK DataSave (int panel, int control, int event,
      void *callbackData, int eventData1, int eventData2)
     TDMSChannelHandle mainChannel;
        TDMSChannelGroupHandle mainChanGroup;
        TDMSFileHandle tdmsFileHandle;
     switch (event)
      case EVENT_COMMIT:
        TDMS_CreateFile ("d:\\CVI\\signal.tdms", TDMS_Streaming, "signal", "", "", "",&tdmsFileHandle );
        TDMS_AddChannelGroup (tdmsFileHandle, "Main Group", "Dev1",&mainChanGroup);
        TDMS_AddChannel (mainChanGroup, TDMS_Double, "Main Channel", "ai0", "", &mainChannel);
        TDMS_AppendDataValues (mainChannel, sine, 100, 1);
        TDMS_CloseFile(tdmsFileHandle); 
       break;
      case EVENT_RIGHT_CLICK:
       break;
     return 0;
    This works fine as i press Accept first time, this create signal.tdms and save data in mainChannel... But as i press it to save second time it throws error code "-6604" in TDMS_CreateFile syntax...
    I want to append the data in mainchannel with time stamp over and over with acceped iteration results.. number of iteration is not predefined sothat ian initialize any array for mainchannel...
    Anyway around to get it solved ?
    Thanks HS

  • How to compare signals from two different .tdms files?

    i'm developing a lie detection system in labview.so inorder for that i need to compare the threshold physiological signals from the .tdms file with the signals i acquire continuelsy from the subject for each question asked.i use respiration monitor and heart beat monitor together with the sensorDAQ to acuire the physiological signals.so which are the function i should make use of?i have the following toolkits
    1. advanced signal processing toolkit
    2. adaptive filter toolkit
    3. digital filter design toolkit
    4. biomedical toolkit
    please give me advise on this.
    thank you.
    Solved!
    Go to Solution.

    Lie detector systems (polygraphs) generally work by looking at the physiological responses to the own subjects baseline, and do this in real-time.  You could use a file that represents the stored "baseline" for the subject, but the overall environment, circumstances, general state of the subject, etc. may not be similar enough to easily see subtle changes.
    From the stored file, you might determine a set of parameters or thresholds that indicate "normal, relaxed" for each signal.  You could read the file into your LabVIEW program, process each channel, and save these parameters.  Then when you have the new data, you can read the new data file in and process it in a similar way and then determine whether the parameters are outside the limits that you established for a "lie".
    You may get more responses to this question if posted in the Biomedical User Group
    Visit the NI Biomedical User Group at:
    www.ni.com/biomedusers

  • .tdm file storage vi's slow editing vi's

    I am developing software using Labview 8.5 and have recently added some file storage vi's for the .tdm format for use in DIAdem 10.2.  Upon using the open storage, set file properties, write channel group, write channel, and close storage vi's, the editing has become extremely slow - for any operation I try to perform there is a 10-15seconds delay before it occurs.  If I remove the .tdm vi's from my diagram then the editing goes back to normal and changes/operations occur almost instantaneously as expected.  My project is not large as far as I am concerned (Front panel - 121k, block diagram=1538k, code=0.2k, data=957k, total=2617k, total vi size on disk=389k)
    I saw a similar post to the .tdm storage vi's causing this to occur back in 2005 and was supposed to have  been on the fix list but it does not appear that it has 3 years later.  I am sure many others are using these vi's so not sure what I may have done differently to cause the editing to slow down so much.  
    Anyone with ideas and fix would be greatly appreciated as I cannot afford to sit around 10-15 seconds for every step of my developement.

    Yes, sometimes Storage VIs are slow. But They are Express VIs, supplying the easy configuration for users. If you feel they are too slow, I suggest that you can use TDMS files instead.

Maybe you are looking for

  • Turn Pricing Off in Service Contracts

    Hi, We are imlplementing R12.0.6 Service Contracts. In our business scenario the price is finalized even before the contract is created. So for us when we create the contract we just need to update the price of the contract line and not reprice it. I

  • Display problem in Mail 6.6

    Hi, The other day, I had huge font problems, so I did a «Clean System Fonts Folders-» via FontExplorer X Pro. It solved my font problems, but since then, I have a display problem in Mail. Here are two screen shots: Is there a solution? Thanks for eve

  • How to check the date of an Oracle session

    hello How to check how long a session was opened? thx

  • Wish to find out number of rows returned from query

    hi, is it possible to determine how many rows have been returned after a query has been executed? thank you.

  • Name of PRESETS file in LR2

    Does anybody know the NAME and the LOCATION of the USER PRESETS file in LR2? Thanks, Oliver