04-26-2020 08:09 AM
Hello everyone, the thing I need to do is save data from querry to more (for example 3) TDMS files. Here in 1st for loop I just "unbox" data from variant data type. Because data can be a DBL constant or DBL 1D array depending if source is measuring one channel or multiple channels.
Now, the question is, how can I divide these data to 3 TDMS files depending on DAQmx task name, which is part of every cluster with measurement.
Thank you guys for any advices!
04-26-2020 11:33 AM
Why do you need 3 different files? Why not just use different groups in the same TDMS file? It would be a lot simpler if you just used that task name for the group name when you write the data to your TDMS file.
04-26-2020 11:52 AM
That is true and indeed good idea.
Then let's say there is possibility to save everything to one file. Still, the problem with sorting data (to arrays) by task name and preparing them for save persists. How would you sort all data to arrays of different lenght, when number of devices is variable and also number of channels for measurements is variable.
04-26-2020 01:31 PM
If things are coming from DAQmx tasks, then just read so you get an array of waveforms out and put that in your queue along with the task name. Then you just do a TDMS write with the array of waveforms as the data and the tasks name as the group.