Jump to content

OpenG suggestion : write & read "anything" as property in a TDMS file


Recommended Posts

Hello,

I recently used TDMS files in a customer application and for that purpose I made VIs to write/read clusters containing parameters to/from TDMS file.

These VIs are basically *copies* of the Read Variant Key.vi and Write Variant Key.vi from the OpenG Variant Configuration File palette so I thought it would be a good idea to add it to OpenG.

Hopefully it could help someone.

PS: haven't tested these VIs extensively (with all possible data types in LabVIEW) but they do work fine with big clusters containing 1D and 2D arrays.

Read Property Key from TDMS File.vi

Write Property Key to TDMS File.vi

  • Like 1
Link to comment

Nice idea (I had written a similar tool just a few months ago).

I remember two bugs/issues.

  • DIAdem is quite strict about the allowed characters for property names, '.' (period) is not allowed. Upon resaving the TDMS file the period will be replaced by an underscore '_'. (the list is quite long).
  • A boolean is stored as an U8 after a resave with DIAdem, the TDMS routine of LabVIEW can read the boolean, if they receive an explicit boolen. However if they receive a variant with a boolean as data-type, the returned variant is an U8. And a variant to data function will fail. (your code has a specific case for each data-type so it will not break).

One thing about your code, why don't you use the VI reentrantly? By allowing 'Share clones', you can drop the VI strait into itself, without the need of explicit VI-server calls.

Another addition would be to have basically the same code for waveform attributes (I have that around as well).

Ton

Link to comment

One thing about your code, why don't you use the VI reentrantly? By allowing 'Share clones', you can drop the VI strait into itself, without the need of explicit VI-server calls.

I have no good answer to that... Was it possible in LV8.6? I think the first time I made those VIs it was in LV8.6 and then I just upgraded the LV version without modifying the code.

Another addition would be to have basically the same code for waveform attributes (I have that around as well).

Sounds like a good idea to me.

Any other idea anyone?

Link to comment
  • 5 months later...

DIAdem is quite strict about the allowed characters for property names, '.' (period) is not allowed. Upon resaving the TDMS file the period will be replaced by an underscore '_'. (the list is quite long).

Ton

Here's a post on the NI forums detailing which characters aren't allowed in property names: http://forums.ni.com/t5/DIAdem/Properties-in-TDMS-file-not-visible-in-Diadem/m-p/1747404/highlight/true#M14082

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.