10-30-2013 05:45 AM - edited 10-30-2013 06:03 AM
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.
Solved! Go to Solution.
10-30-2013 07:38 AM
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.
10-30-2013 07:53 AM
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.
10-30-2013 09:13 AM
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.
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.