tdm_loader

Contents:

class tdm_loader.tdm_loader.OpenFile(tdm_path, tdx_path='', encoding='utf-8')[source]

Class for opening a National Instruments TDM/TDX file.

Parameters:
  • tdm_path (str) – The full path to the .TDM file.

  • tdx_path (str, Optional) – The full path to the .TDX file. If not present, it will be assumed the TDX file is located in the same directory as the .TDM file, and the filename specified in the .TDM file will be used.

channel(channel_group, channel, occurrence=0, ch_occurrence=0)[source]

Returns a data channel by its channel group and channel index.

Parameters:
  • channel_group (int or str) – The index or name of the channel group.

  • channel (int or str) – The index or name of the channel inside the group.

  • occurrence (int, Optional) – Gives the nth occurrence of the channel group name. By default the first occurrence is returned. This parameter is only used when channel_group is given as a string.

  • ch_occurrence (int, Optional) – Gives the nth occurrence of the channel name. By default the first occurrence is returned. This parameter is only used when channel_group is given as a string.

channel_description(channel_group, channel, occurrence=0, ch_occurrence=0)[source]

Returns the description of the channel at given channel group and channel indices.

Parameters:
  • channel_group (int or str) – The index of the channel group.

  • channel (int or str) – The index or name of the channel inside the group.

  • occurrence (int) – The nth occurrence of the channel group name

  • ch_occurrence (int) – The nth occurrence of the channel name

channel_dict(channel_group, occurrence=0)[source]

Returns a dict representation of a channel group.

Parameters:
  • channel_group (int or str) – The index or name of the channel group.

  • occurrence (int) – Gives the nth occurrence of the channel group name. By default the first occurrence is returned. This parameter is only used when channel_group is given as a string.

channel_group_index(channel_group_name, occurrence=0)[source]

Returns the index of a channel group with the given name.

Parameters:
  • channel_group_name (str) – The name of the channel group.

  • occurrence (int, Optional) – Gives the nth occurrence of the channel group name. By default the first occurrence is returned.

channel_group_name(channel_group)[source]

Returns the name of the channel group at the channel group index.

Parameters:

channel_group (int) – The index of the channel group.

Returns a list of channel group names that contain search term. Results are independent of case and spaces in the channel name.

Parameters:

search_term (str) – The term to search for in the channel group names

Returns:

found_terms – Returns the found channel group names as tuple of full name and channel group index.

Return type:

list of (str, int)

channel_name(channel_group, channel, occurrence=0)[source]

Returns the name of the channel at given channel group and channel indices.

Parameters:
  • channel_group (int or str) – The index of the channel group.

  • channel (int) – The index or name of the channel inside the group.

  • occurrence (int) – The nth occurrence of the channel_group name

Returns a list of channel names that contain search term. Results are independent of case and spaces in the channel name.

Parameters:
  • search_term (str) – The term to search for in the channel names

  • return_column (bool) – If True the function returns the column index instead of channel group and channel indices

Returns:

list of (str, int, int) or list of (str, int) (latter case for return_column = True) Returns the found channel names as tuple of full name and column index or channel group and channel indices depending on the value of return_column.

Return type:

found_terms

channel_unit(channel_group, channel, occurrence=0, ch_occurrence=0)[source]

Returns the unit of the channel at given channel group and channel indices.

Parameters:
  • channel_group (int) – The index of the channel group.

  • channel (int or str) – The index or name of the channel inside the group.

  • occurrence (int) – The nth occurrence of the channel group name

  • ch_occurrence (int) – The nth occurrence of the channel name

no_channel_groups()[source]

Returns the total number of channel groups.

no_channels(channel_group)[source]

Returns the total number of channels inside the given channel group.

Parameters:

channel_group (int) – The index of the channel group.

Indices and tables