简体   繁体   English

在linux下的python中读/写LabView TDMS文件

[英]Read/Write LabView TDMS files in python under linux

Does anyone know of a way to read and write the National Instruments binary file type (TDMS) in python under linux? 有谁知道在linux下用python读取和编写National Instruments二进制文件类型(TDMS)的方法? I know that NI has a C DLL available, but I don't know how to access that through python, or if I even can do so under linux. 我知道NI有一个C DLL可用,但我不知道如何通过python访问它,或者我甚至可以在linux下这样做。

It looks like TDMS isn't directly supported under Linux (see here ). 看起来在Linux下不直接支持TDMS(见这里 )。

Your options currently are to use the G-based functions directly in LabVIEW (It's possible that you can wrap them in a .so file), calling LabVIEW from Python , or building your own file parser from the TDMS spec . 您当前的选择是直接在LabVIEW中使用基于G的函数 (可以将它们包装在.so文件中), 从Python调用LabVIEW ,或者从TDMS规范构建自己的文件解析器。

Sorry, no really easy options. 对不起,没有非常简单的选择。

Edit: It looks like there may be an open source project to try to do this at http://sourceforge.net/projects/pytdms/ . 编辑:看起来可能有一个开源项目尝试在http://sourceforge.net/projects/pytdms/上执行此操作。 Worth a try, at least. 值得一试,至少。

You have to install the python version 2.7 (thats the only one that is working with the tdms package for labview atleast) 你必须安装python版本2.7(这是唯一一个使用tdms包进行labview至少)

Sudo pip install npTDMS

Link to the tdms package page 链接到tdms包页面

and just follow the example on the page. 并按照页面上的示例进行操作。

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

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