public void TDMSOpen(string filePath) { logFile = new TdmsFile(filePath, new TdmsFileOptions(TdmsFileFormat.Version20, TdmsFileAccess.Read)); logGroup = "EXAM_Data"; // Get the channel group this.channelGroupsFETCH = logFile.GetChannelGroups(); if (!this.channelGroupsFETCH.Contains(logGroup)) { throw new SystemException("Group not found in tdms file!"); } TdmsChannelGroup channelGroupFETCH = this.channelGroupsFETCH[logGroup]; // Get the channels channelsFETCH = channelGroupFETCH.GetChannels(); logChannelCount = channelsFETCH.Count; logLength = channelsFETCH[0].DataCount; loggingRate = logFile.GetProperty("EXAM_LoggingRate"); }
public void InitRecordingToolTdms(string sequenceName) { string channelGroupName = sequenceName; TdmsChannelGroup channelGroup = new TdmsChannelGroup(channelGroupName); tdmsGroupCollection = tdmsFile.GetChannelGroups(); if (tdmsGroupCollection.Contains(channelGroupName)) { channelGroup = tdmsGroupCollection[channelGroupName]; } else { tdmsGroupCollection.Add(channelGroup); } // Set up the channel. string dataChannelName = sequenceName + "-channel"; TdmsChannel dataChannel = new TdmsChannel(dataChannelName, TdmsDataType.Double); TdmsChannelCollection channels = channelGroup.GetChannels(); if (channels.Contains(dataChannelName)) { dataChannel = channels[dataChannelName]; } else { channels.Add(dataChannel); } }