tdmsreadprop
Description
Examples
Read Properties from TDMS File
Read the file level properties of a TDMS file.
props = tdmsreadprop("Turbine_003.tdms")
props = 1×7 table name title author description datetime datestring timestring _____________ _______________ ______ ____________________________________________________ _____________________________ ____________ __________ "Turbine_003" "Turbine Tests" "xyz" "Test the Acceleration, Force and Torque of Turbine" 2021-10-18 01:57:17.000000000 "10/18/2021" "11:27:17"
Read the properties of one channel group.
props = tdmsreadprop("Turbine_003.tdms",ChannelGroupName="Torque")
props = 1×2 table name description ________ ___________ "Torque" "CGTorque"
Narrow the scope to view properties specific to a channel. Note that in this case, a channel has more properties than its channel group does.
props = tdmsreadprop("Turbine_003.tdms",ChannelGroupName="Torque",ChannelName="Torque2")
props = 1×19 table name datatype description unit_string displaytype monotony novaluekey ResultStatArithMean ResultStatMax ResultStatMin ResultStatSqrMean ResultStatSum wf_increment wf_samples wf_start_offset wf_start_time wf_time_pref wf_xname wf_xunit_string _________ ___________ ________________ ___________ ___________ ________________ ________________ ___________________ _____________ _____________ _________________ _____________ ____________ __________ _______________ _____________________________ ____________ ________ _______________ "Torque2" "DT_DOUBLE" "from Clipboard" "Nm" "Numeric" "not calculated" "not calculated" -6.7843e-06 1.4651 -1.6662 0.12794 -2.2049 0.0001 3312 0 2012-07-31 18:00:00.000000000 "relative" "Time" "s"
Filter on specific properties of the file.
props = tdmsreadprop("Turbine_003.tdms",PropertyNames=["name" "title" "author" "description"])
props = 1×4 table name title author description _____________ _______________ ______ ____________________________________________________ "Turbine_003" "Turbine Tests" "xyz" "Test the Acceleration, Force and Torque of Turbine"
Retrieve the start time and step period for a channel.
props = tdmsreadprop("Turbine_003.tdms",ChannelGroupName="Torque",ChannelName="Torque2",... PropertyNames=["wf_start_time" "wf_increment"])
props = 1×2 table wf_increment wf_start_time ____________ _____________________________ 0.0001 2012-07-31 18:00:00.000000000
You can derive the sample rate by taking in the inverse of the
wf_increment
value.
rate = 1/props{1,"wf_increment"}
rate = 10000
Input Arguments
tdmsfile
— TDMS file name
string
TDMS file name, specified as a string.
For local files, use a full or relative path that contains a file name and extension. You also can specify a file on the MATLAB® path.
For Internet files, specify the URL. For example, to read a remote file from the Amazon S3™ cloud:
data = tdmsread("s3://bucketname/path_to_file/data.tdms");
Example: "airlinesmall.tdms"
Data Types: char
| string
Name-Value Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Example: ChannelGroupName="Torque",ChannelName="Torque2"
Supported name-value pairs are:
ChannelGroupName
— Channel group containing the channels to read from
string | char
Channel group containing the channels to read from, specified as a string or character vector.
Example: ChannelGroupName="Torque"
Data Types: string
| char
ChannelName
— Name of channel to read
char | string
Name of channel to read, specified as a string or character vector. The channel
must be in the channel group specified by ChannelGroupName
.
Example: ChannelName="Torque2"
Data Types: char
| string
PropertyNames
— Property names to read
string | char | cell
Property names to read, specified as a string, string array, character vector, or cell array of character vectors. Supported properties depend upon file content and the specified channel group and channels.
Example: PropertyNames=["name" "description"
"wf_start_time"]
Data Types: char
| string
| cell
Output Arguments
props
— Table of properties from TDMS file
table
Properties in the TDMS file, returned as a table.
Limitations
TDMS functions are supported on Windows® platforms only.
Version History
Introduced in R2022a
Comando MATLAB
Hai fatto clic su un collegamento che corrisponde a questo comando MATLAB:
Esegui il comando inserendolo nella finestra di comando MATLAB. I browser web non supportano i comandi MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)