简体   繁体   English

无法读取 TDMS 文件('TdmsFile' object 没有属性 'xxx')

[英]Cannot read TDMS file ('TdmsFile' object has no attribute 'xxx')

I have trouble reading my tdms file from LabVIEW.我无法从 LabVIEW 中读取我的 tdms 文件。

1, Read my file from my path. 1,从我的路径读取我的文件。 It is ok to load it at this point.此时加载它是可以的。

tdms_file = TdmsFile('/path/to/Env16-05-30-2021.tdms')

2, Successfully see the group property: 2、成功看到组属性:

tdms_file.groups()

It returned:它返回:

[<TdmsGroup with path /'Measured Env Time'>,
 <TdmsGroup with path /'Measured Env Data'>]

3, I can not access to group channels in one of my group: 3,我无法访问我的群组中的群组频道:

tdms_file.group_channels('Measured Env Time')

It returned:它返回:

'TdmsFile' object has no attribute 'group_channels'

4, I already know my group_channels name and try to access it 4、我已经知道我的 group_channels 名称并尝试访问它

time = tdms_file.object('Measured Env Time', 'Time').data

It returned:它返回:

'TdmsFile' object has no attribute 'object'

Does anyone have any idea?有人有什么主意吗? Thanks!谢谢!

Since you did not post what python package you are using to read the TDMS file I will assume you are using the latest version of npTDMS .由于您没有发布 python package 您用于阅读 TDMS 文件的内容,因此我假设您使用的是最新版本的npTDMS

Looking at its documentation it seems you should access the channels of a group via查看其文档,您似乎应该通过以下方式访问组的频道

group_channels = tdms_file[group_name].channels()

Or if you already know the group and the channel you can just或者,如果您已经知道群组和频道,您可以

channel = tdms_file[group_name][channel_name]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM