LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does one delete a waveform attribute?

I am looking for a way to delete waveform attributes. When getting a waveform from the UNV58 File Load VI it returns a waveform with an NI_SV_ChannelInfo attribute and if you try and write this to a TDMS file it chokes because this is not a stadard attribute type.
 
I have tried using the SetAttribute VI and passing in an Empty String, but this just replaces the value and does not delete it.
 
My other option is to use Get Wfrm Comps and pass the Y, T0 and dT to a Build Waveform, but I am affraid this copies the data. I am dealing with large data sets and cannot afford a copy being made.
0 Kudos
Message 1 of 9
(5,018 Views)
What is the "UNV58 File Load" VI? Is this something you wrote, or is it a driver VI? If it's a user-developed VI you should simply be able to edit the VI to not set the attribute at the source.
0 Kudos
Message 2 of 9
(5,005 Views)
The UNV58 Load VI is part of the NI Sound and Vibration tool kit. I have to admit I am using the ExpressVI version and could probably write my own version using their lower level UNV58 calls, but it would be so much easier if I could just delete the waveform attribute I do not want.
0 Kudos
Message 3 of 9
(4,999 Views)
What are you using to write the TDMS file? Using either the Express VI or the standard TDMS File I/O VIs I did not get an error with an arbitrary attribute:




Message Edited by smercurio_fc on 02-07-2008 03:12 PM
0 Kudos
Message 4 of 9
(4,989 Views)

My mistake. In my first post I missed mentioning that the NI_SV_ChannelInfo attribute has a cluster data type. I'm using the standard File I/O TDMS routines. They like the normal attribute types - string, integer, double, etc... but the UNV58 routines appened a cluster attribute which they do not like.

0 Kudos
Message 5 of 9
(4,973 Views)
Ah. In that case, use the Delete Variant Attribute by accessing the waveform's attribute property:



Message Edited by smercurio_fc on 02-08-2008 11:55 AM
Message 6 of 9
(4,949 Views)

Just an FYI for future reference.  Over on the LAVA forums, one of the active members posted some very useful code for writing and reading clusters to/from TDMS files.  Here's a link to the specific post, but you should scan through other parts of the thread if interested.  The code is a fairly small mod of some OpenG code for writing clusters to ini files.

One other tidbit I picked up somewhere, but don't know where.  It may have been version-specific and may no longer be necessary but shouldn't hurt in any case.  Here it is: be sure to send your clusters through a "To Variant" primitive before wiring to the top-level "Write Variant to TDMS" (or whatever the exact name) in the code I linked.  If you wire your clusters directly, there'll be an automatic coercion to variant which won't necessarily behave as intended.

I learned the tidbit after having wired the clusters directly for a while, and never personally observed any data corruption.  But I *did* go back and insert the "To Variant" before all my writes.  No corruption since making the switch either.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 7 of 9
(4,943 Views)
I have had my head in this project for quite some time and  forgot to follow up with this post. Thanks all for the help. The "Delete Variant Attribute" did the trick. If I remember correctly, TDMS was choking on an Enum/Ring in NI_SV_ChannelInfo. I was able modify the cluster to output the Enum's text to the TDMS file. Thanks again for the help
0 Kudos
Message 8 of 9
(4,810 Views)
Great to hear that it worked for you. Thanks for following up.
0 Kudos
Message 9 of 9
(4,808 Views)