tdms_parser v0.2.0 TDMS.Parser View Source

This module is the main parser for TDMS files.

TDMS files organize data in a three-level hierarchy of objects. The top level is comprised of a single object that holds file-specific information like author or title. Each file can contain an unlimited number of groups, and each group can contain an unlimited number of channels.

In the following illustration, the file example_events.tdms contains two groups, each of which contains two channels:

  • example_events.tdms

    • Measured Data

      • Amplitude Sweep
      • Phase Sweep
    • Events

      • Time
      • Description

For more details about the internal structure of TDMS files, see https://www.ni.com/product-documentation/5696/en/

Link to this section Summary

Functions

Parses the given TDMS file binary data and returns a hierarchical TDMS.File structure which contains a list of TDMS.Group and TDMS.Channel.

Link to this section Functions

Parses the given TDMS file binary data and returns a hierarchical TDMS.File structure which contains a list of TDMS.Group and TDMS.Channel.

Examples

iex> TDMS.Parser.parse(File.read!("test/data/basic.tdms"))

%TDMS.File{
  path: "/",
  properties: [
    %TDMS.Property{
      data_type: :string,
      name: "name",
      value: "ni-crio-9068-190fdf5_20190609_235850.tdms"
    }
  ],
  groups: [
    %TDMS.Group{
      name: "Temperature",
      path: "/'Temperature'",
      properties: [
        %TDMS.Property{data_type: :string, name: "name", value: "Temperature"}
      ]
      channels: [
        %TDMS.Channel{
          data: [24.172693869632123, 24.238202284912816, 24.22418907461031, ...],
          data_count: 201,
          data_type: :double,
          name: "ai.0",
          path: "/'Temperature'/'ai.0'",
          properties: [
            %TDMS.Property{data_type: :string, name: "name", value: "ai.0"},
            %TDMS.Property{
              data_type: :string,
              name: "datatype",
              value: "DT_DOUBLE"
            },
            ...
          ]
        },
        %TDMS.Channel{
          data: [24.07053512461277, 24.136787008557807, 24.128304594848682, ...],
          data_count: 201,
          data_type: :double,
          name: "ai.1",
          path: "/'Temperature'/'ai.1'",
          properties: [
            %TDMS.Property{data_type: :string, name: "name", value: "ai.1"},
            %TDMS.Property{
              data_type: :string,
              name: "datatype",
              value: "DT_DOUBLE"
            },
            ...
          ]
        },
        ...
      ]
    }
  ]
}