05-13-2012 06:06 AM
Hello,
I need to search for a waveform inside a TDM file by its name attribute and then pull (if possible just) that single waveform for further processing. I have attched a diagram where I am by now:
Open Data Storage - by filepath and pass its refnum
Read Data [Channel] - by passed refnum and provide channel refnums
Create Query Expression - creates correct query
Execute Query Expression - executes but returns an array instead of a single channel refnum ???
Read Data [Channel] - outputs ALL: channels from the TDM although I have indexed just the 1st one ???
Can anybody help me solve this?
Following is the file situation - I have saved more than 100 shaking table testst. Each of them produced 4x TDMS files I had converted to 4x TDM files. For eacht test I need to locate and pull out 3 waveforms that are contained randomly inside those 3 corresponding TDMs, and perform some processing on them and save a new TDM of 7 waveforms derived from the processing. My only problem so far is to pull out those individual waveforms from the TDMs. Is it possible to pull them out alone - not the complete channels sets from the 3 TDMs? - This to avoid memory issues.
Thanks in advance,
Solved! Go to Solution.
05-13-2012 10:00 PM
Hi golubovski,
The Read Data itself has querying capability. You can pass file refnum to it and query directly.
It will return an array, for example, waveforms, because TDM allows multiple groups/channels to have same name, etc.
Hope this helps,
Mavis
05-14-2012 05:05 PM
Hello Mavis,
Thank you and sorry for a late response! I have solved the indexing issue as attached in the "indexing.PNG". I have another problem that looks like a bug to me. In the "working.PNG" there is a "Get Properties [Channel].VI" that successfully pulls out Name and Unit attributes from indexed channels within a TDM. Same works in the "indexing.PNG". However, same does not work in the "NOT working.VI"...?!? - Both Name and Unit are empty un-initialized strings!
Even the signal waveform cannot be pulled out from the "Get Properties [Channel].VI" and needs to be taken out off the "Read Data [Channel].VI".
I tried to first loop-out all names and units in a FOR LOOP and pass the two string arrays inside the writing FOR LOOP but LabVIEW quits with an unexpected error...!?!
Maybe I am missing something here, any thoughts?
Thanks in advance,
05-14-2012 08:26 PM
Hi golubovski,
I suspect the problem is in the For Loop executing after the first Close Data. The channel refnum array passed to the For Loop should be invalid because they will be released by the first Close Data.
Can you please try moving the first Close Data somewhere after the For Loop?
Hope this helps,
Mavis
05-15-2012 02:21 AM
Mavis,
You are wright! It works now, attached is your solution :)))
Thank you,