LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Editing String in.TDM file

With Set Properties it is possible to add one or more strings to a .TDM file (or is it to another file that is linked to the .TDM file?). Similarly it is possible to read that string with Get Properties.

My current impossibilities are:
- If each measurement is appended to the preceding measurement how do I read a record that is not the last one saved?
- If one or more strings has to be edited how can the modification replace only the affected strings? This implies a Read VI that is also capable to Write (replace).

I am not finding much information on this file format and would appreciate knowledgeable insight.

Regards,
0 Kudos
Message 1 of 3
(2,869 Views)
TDM = 2 Files
The Storage VIs create a .TDM file (XML-based, for descriptive properties) and a .TDX file (binary, contains waveform / array data).

One or many channel groups
Each measurement can be appended to a file as a new channel group, or the values can be appended to channels that were stored earlier (resulting in one channel group per file). Use the "Always create new channel group/channel" switch to decide which way of appending data you want to use. You might want to use the "Data viewer" example shipping with LabVIEW to have a look at the hierarchy of channel groups and channels.
Note that when appending values to a channel, "Write Data" uses the channel name to find the right channel to append data to.

Get and set properties on particular channel groups
To modify data on a particular channel group, you need to obtain a "storage refnum (channel group)" to this channel group. There are two ways of doing that:
- Use "Read Data", configured to object type "channel group". The "channel groups" output will give you the array of refnums you need (the attached VI shows how to obtain and use these refnums).
- Wire the "storage refnum (file)" that comes out of "Open Storage" to "Get Properties". The "channel groups" property will be an array of all channel group refnums in your file (the "Write channel groups" and "Read channel groups" examples shipping with LabVIEW show how to do that).
"Read Data" should be used if you want to apply a query condition or if you are e.g. looking up channels across channel groups. "Get Properties" can give you all channel groups in the order they were stored in, or e.g. all channels of a particular group.

"Read Data" and "Set Properties"
"Set Properties" will replace all properties that you have selected and that show up on the block diagram as terminals. All other properties remain unchanged. The properties will be written only to the one file, channel group or channel that the incoming refnum refers to. "Read Data" doesn't write anything by itself, but you can use the output refnums of "Read data" to apply "Set Properties" to whatever you have read.
Message 2 of 3
(2,869 Views)
Thank you Mr. Engels.

I am working through your information. I think NI could have done a much better job of introducing this format. As attractive as this method of saving data is to me it appears that most people are giving .TDM a "pass" and consequently there is virtually nothing about it on the forums. The HELP files are more appropriate to programmers than to the "Cut & Paste people". What is needed, from NI, are some .TDM tutorials that allow people to study parameter variations.

Regards,
0 Kudos
Message 3 of 3
(2,869 Views)