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: 

TDMS Write Custom Properties

Solved!
Go to solution

I am writing an application acquires 4 analog channel on demand and write acquiring data along with WO# and Operator ID( Both comes from Front Panel). I am abele to stored all 4 channels data along with time stamp but kind of stuck to store WO# and Operator ID. It seems to me "TDMS Write Custom Properties". Please see the attached code and anyone can add on this feature ? I want to store WO# and Operator ID only one time. 

 

Thanks

 

~Repon

0 Kudos
Message 1 of 11
(4,232 Views)

Have you tried "TDMS Set Properties.vi", or that what you're referring to? It would help if you put the VI in the code showing us what you are trying to do. Under what section do you want these properties set? For every channel, or at the root section of the file? The VI to set properties is pretty straight forward to use, so what specifically is the problem you are having?

0 Kudos
Message 2 of 11
(4,227 Views)
Solution
Accepted by topic author Repon

I tried it outside of my while loop and it didn't work.

0 Kudos
Message 3 of 11
(4,225 Views)

Sorry, i hit submit before i was finished Smiley Sad Reread my edited post above.

0 Kudos
Message 4 of 11
(4,223 Views)

See example attached. This puts the properties at the top level, which is what I'm assuming you want.

0 Kudos
Message 5 of 11
(4,220 Views)

Hello guys!

I'm sorry for the reactivation of this old thread, but the title fits to my case too...

Working several years with Diadem, now I (should) start with LV. Made first courses, but have not a lot of training in the field. Btw, we use LV2019.

 

My first "job" is to create the VI which saves the test data in the TDMS file.

Where the data come from is not of interest (at least in the first step). So I could just generate some values.

 

So far it works, but I don't understand how to work with properties for data, group and channels.

I can set the group name and description. Here in this topic is shown, how to add more properties to the root.

But how to do this for channels, with 3-7 custom properties per channel?

 

Here is shown almost the same what I need, but there is no data writing in shown picture...

Guess, it's not necessary to reopen and reclose the TDMS file for props and data...

image.png

 

What I would need now is a (part of) VI which I can add at specified place 🤗

If possible, without long lectures...

 

Greetings,

Vassili

0 Kudos
Message 6 of 11
(2,084 Views)

Hi Dia791,

 

You're not far off with what you've already got.  To write channel properties, use the same TDMS Set Properties but wire the group name *and* channel name inputs.  After you've written the data with TDMS Write wire the group name and channel name(s) outputs to another TDMS Set Properties.  This will result in a broken wire because the channel name input requires a single string, so add a For Loop around TDMS Set Properties.  This will auto-index over the channel names, which means it will run once for each item in the channel names array.

 

You need to create arrays of properties with one entry for each channel which you can then send to TDMS Set Properties.  Hopefully the picture below gives you the general idea.  Sorry I couldn't upload a VI snippet - LabVIEW is on another machine.

 

How to use TDMS Set Properties for channelsHow to use TDMS Set Properties for channels

 

Andy

Message 7 of 11
(2,072 Views)

If you haven't realized it yet, properties in Diadem are index and can be searched for quickly.  Lets say you have some data you collect on a channel, like temperature.  You might have hundreds or thousands of samples of this reading.  If you wanted to create a filter in Diadem and say find all files, where the channel has at least one value greater than say 25, it would be a pain.  This is because each sample needs to be read, and then have the check on if the value is greater or not.  But if instead when you write the data, you set a property on the channel that is the Minimum, and Maximum, then things get easier.  Diadem can quickly look for that property on Maximum and if it is ever greater than 25 you have what you want.

 

Because anything can be written to a property, it can be a pretty open ended feature.  Maybe you want to log what user ran the test, or what the last calibration date of the equipment was, or what the DUT's date of manufacture was.  Should these be properties on the Channel, Group, or the whole File?  That will likely depend on the structure you data is in.

 

I made a presentation years ago on TDMS here.  It touches on what types of things you might want to store as properties.  For me I'll try to think of everything that should be properties and make my software write them when the test is taking place.  But then my users always come up with new stuff they might want to search for, and I need to decide if it is worth adding those properties, or if I want to write something custom, as a one off.

0 Kudos
Message 8 of 11
(2,057 Views)
Thank you for the proposal, will try it out! Guess, I could do it via sequencies, and so write first the props, and then the data... As mentioned, in LV I'm a very beginner :) BR, Vassili
0 Kudos
Message 9 of 11
(2,039 Views)
@ Hooovahh: That's exactly the point! In Diadem I use the own props to store the key information; so mostly the evaluation routine was started once, and the results are saved (in either root or channels). But there I do this since years; LV is very very new. Thank you! BR, Vassili
0 Kudos
Message 10 of 11
(2,035 Views)