LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS overwrite specific fields with new string data

Solved!
Go to solution

Hi 

Wonder if anyone could advise an easier, cleaner solution or I may end up making big mess on my block diagram!

I use DaqmxConfigureLogging.vi to write data into .tdms file and this is all working. Unfortunately, this vi sets the channel names to physical names such as Dev1/ai0 in both root and group sheet of tdms file.

I would like to read individual fields where these are being written and replace them with channel names. The location of these channel names is fixed on the tdms file.  However i noticed using file i/o functions such as open/close/set file position could not work as those files do not seem to recognize .tdms file. And there aren't any tdms functions to set positions to desired fields on root/channel sheets of tdms file and read the desired fields as string data!

Any suggestions? I may be missing something fairly simple!

ATE and Labview Consultant
https://www.easybodge.com
0 Kudos
Message 1 of 8
(3,755 Views)

Are these properties?  Just use the TDMS Set Properties setting the name to the same one you want to replace.

0 Kudos
Message 2 of 8
(3,739 Views)

k-waris wrote:  Unfortunately, this vi sets the channel names to physical names such as Dev1/ai0 in both root and group sheet of tdms file.

Actually, it uses whatever names you give the channels and groups.  If you do not set the names, then the defaults are used.  So just name your channels and groups.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 8
(3,731 Views)

'Actually, it uses whatever names you give the channels and groups'

I am using Dev1/ai0:15 to log all 16 channels. So unfortunately using 'name to assign' input will not do the job in my case!

ATE and Labview Consultant
https://www.easybodge.com
0 Kudos
Message 4 of 8
(3,709 Views)

@k-waris wrote:

'Actually, it uses whatever names you give the channels and groups'

I am using Dev1/ai0:15 to log all 16 channels. So unfortunately using 'name to assign' input will not do the job in my case!


Sure it will.  Use a FOR loop with the Create DAQmx Channel to create each channel and give them a name.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 8
(3,697 Views)

If you want to update the channel name in the TDMS file, maybe you can try to use "TDMS Set Properties" to set the "name" property. Just wire the correct names for the group and channel, and wire a string "name" to the property name, and wire a string with the new name to the "property value".

0 Kudos
Message 6 of 8
(3,576 Views)
Solution
Accepted by topic author k-waris

@crossrulz wrote:

@k-waris wrote:

'Actually, it uses whatever names you give the channels and groups'

I am using Dev1/ai0:15 to log all 16 channels. So unfortunately using 'name to assign' input will not do the job in my case!


Sure it will.  Use a FOR loop with the Create DAQmx Channel to create each channel and give them a name.


Just to clarify what I meant here...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,549 Views)

Thank you. That's worked Smiley Happy

I did everything but not used 'Daqmx Create Task' vi and was going in very wrong direction by adding more properties using Set Properties vi!!! You have shown me a very elegant and clean solution. Thank you.

 

ATE and Labview Consultant
https://www.easybodge.com
0 Kudos
Message 8 of 8
(3,530 Views)