LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tdms - reading a single channel

Solved!
Go to solution

Read tdms file snippet.png

I sample ten AI channels using DAQmx and write these to a tdms file using 'DAQmx Configure Logging (TDMS).vi' with 'logging mode' set to 'Log'.

Each channel has 1.8 seconds of data that has been sampled at 1MHz.

I later analysis each channel data (one at a time) but would like to optimize my code for memory efficiency since I sometimes come against the dreaded "Out of memory" error.

Ideally I would like to be able to specify only the channel that I want to read, however using the 'DAQmx Configure Logging (TDMS).vi' does not allow me specify channel names.

I can use the express vi to read but all the data comes out and I need to select which channel to extract from the dynamic data. What I don't know if is the dynamic data already memory efficient or is there another method I can use?

If I use the 'tdms open file' followed by 'tdms read' ans use 'index array' I can also get a single channel but reading all the channels out puts all the data into memory at once when i only want to read one channel.

CLD, CTD
0 Kudos
Message 1 of 4
(3,640 Views)
Solution
Accepted by topic author HelenC

When you do the TDMS Read, you can specify which group(s) and channel(s) to read from.  You might want to first use a TDMS Read Properties to get a list of the available channels and groups and then iterate through the list of channels for processing one at a time.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 4
(3,626 Views)

Hi crossrulz,

 

The 'Configure for tdms logging' does not allow you to name the channels there is only a group name option.

If the use 'open tdms' then 'get list' it shows empty group and channels names therefore I can't use 'read tdms' with channel names blanks - just read all of them and then select the one i want.

What would be nice would be if I can name the channels when configuring for logging, but I don't know how to! 

 

I wonder if you can set up configure for tdms logging ten times, once per channel and associated AI but give a group name instead? I shall try and report back.

CLD, CTD
0 Kudos
Message 3 of 4
(3,622 Views)

Tried again following your suggestion and indeed I can now see the channel names which I can now use to specify the channel to read.

Read single tdms channel.png

It gets the channel names automatically from the Task input to the 'configure tdms for logging' vi, which in turn comes for how you specify the AI physical channels to acquire.

Easy when you know how!

Thank you crossrulz.

CLD, CTD
0 Kudos
Message 4 of 4
(3,611 Views)