annuler
Affichage des résultats de 
Rechercher plutôt 
Vouliez-vous dire : 

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
0 Compliments
Message 1 sur 11
8 231 Visites
Use "TDMS List Contents" in order to find out which objects your file contains. Loop over the results and read the property NI_ChannelLength from all objects. Some objects (e.g. groups) will not have this property, but all channels will have it. This is the number of values in the channel. Add up the numbers and you're done.

Hope that helps,
Herbert
Message 2 sur 11
8 227 Visites

That should do it.  Thanks!

--Robert

0 Compliments
Message 3 sur 11
8 199 Visites
Sorry, I jumped the gun.  I thought that I might be able to use get property from signal, but all I have is the channel name.  How do I read the length from the object? 
 
Thanks.
--Robert
0 Compliments
Message 4 sur 11
8 196 Visites
It's a read-only property called NI_ChannelLength (data type is I64). You can see it in the TDMS File Viewer. Make sure to check the "found" output on "TDMS Get Properties", because groups and empty channels don't have that property.
Herbert
Message 5 sur 11
8 193 Visites
Works great.  Thanks!
 
--Robert
0 Compliments
Message 6 sur 11
8 190 Visites

Hello!

 

I dont't get the property value NI_ChannelLength and NI_DataType from a tdms file using the 'TDMS Get  Properties' vi.

All other properties are returned.

Inputs to  TDMS Get Properties: GroupName: RFbeam; ChannelName: Dev1/ai6.

Output: Variant on output 'property value' (wiring I64 to datatype input does not solve the problem. 

 

These properties are displayed in the TDMS File Viewer however. I marked the missing props with NOK:

 

 TDMSscreen.jpg

 

What am I missing? Thanks for tips!

Klaus

Message Edited by Klaus M on 02-09-2010 10:56 AM
0 Compliments
Message 7 sur 11
7 764 Visites

This is weird in that the TDMS File Viewer does exactly that ("TDMS Get Properties" wired with group and channel name, but no property name or type). You might want to look at the "File Contents: Value Change" event in "TDMS - File Viewer.vi" and double-check that your code does the same thing.

 

Herbert

Message 8 sur 11
7 759 Visites

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

 

 

 

 

 

 

 

 

Tout télécharger
0 Compliments
Message 9 sur 11
7 724 Visites

You can wire any data type that LabVIEW can automatically coerce the value to. In this case, that would be any numeric data type (obviously, the range of potential values for I8 or U8 might be too small). Coercion between numerics and strings cannot be done.

 

Herbert

0 Compliments
Message 10 sur 11
7 714 Visites