From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Indexing out a signal from a TDM file by attribute

Solved!
Go to solution

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,

0 Kudos
Message 1 of 5
(2,740 Views)

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

 

query.png

Message 2 of 5
(2,719 Views)

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,

Download All
0 Kudos
Message 3 of 5
(2,703 Views)
Solution
Accepted by topic author golubovski

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

Message 4 of 5
(2,694 Views)

Mavis,

 

You are wright! It works now, attached is your solution :)))

 

Thank you,

0 Kudos
Message 5 of 5
(2,683 Views)