Skip to main content

Reading and writing TDM and TDMS files

Project description


**cTDMS** is a Python package to read or write TDMS or TDM files.

TDMS or TDM are file formats developed by National Instruments and are the main file formats
for data storage in LabView from National Instruments.

**cTDMS** is using the NILIBDDC library from National Instruments, which is accessed by the help of the Python ``ctypes`` package.

Version 0.91 for 32bit and 64bit system

1. Reading TDMS or TDM files

To read a TDMS or TDM file you simply have to call: ::

from cTDMS.cTDMS import TDM_File


or: ::

from __future__ import with_statement
from cTDMS.cTDMS import TDM_File

with TDM_File("Data4.tdm") as tdm:
Accessing groups in a TDMS or TDM file

The tdm file object is organized like a dictionary. The groups contained in the TDM file can be acces by: ::

for groupname in tdm:
print "Group %s ------------"%( groupname)

Creating a new group

A new group in the TDM file can be created with following command: ::

if "newgroupname" is not in tdm:
new_group=tdm.add_Group("newgroupname", "Description of the group")

Before creating a new group, it has to be checked, that this group is not already existing.

Getting data from a group

Measuring data are store in channels of a group. the can be easily accessed by getting the channels from the group: ::

for groupname in tdm:
print "Group %s ------------"%( groupname)

for channelname in group:
print "Channel %s ------------"%(channelname)
print "Channel Properties -----"
for property in channel.attrs:
print property, channel.attrs[property]
# get some data

print "data type: %s, length: %d"%(str(type(d)), len(d))

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for cTDMS, version 0.91
Filename, size File type Python version Upload date Hashes
Filename, size cTDMS-0.91.win32.exe (303.8 kB) File type Windows Installer Python version any Upload date Hashes View
Filename, size (107.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page