CSLUG - Central South LabVIEW User Group (UK)

cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-Files Options for TDMS Writing

Evening all,

Hope the meeting went well the other day: gutted I missed it by one day as was in Newbury the day after.

I have a quick question as I’m getting quite heavily in to DIAdem, but as usual it’s all in the way the data is captured so need to sort my TDMS out.  Probably an easy labview core one or two question but must admit to only just moving from express vi’s !

The 'write to measurement' Vi has a write multiple files option that I would like to include:  the custom properties I want to add stop me using the write to measurement vi (I think).  Basically I want the file name to be the sample number and multiple tests on the same sample to add a suffix each time……..hopefully easy

I’ve attached a sample vi as a trial to add the multiple file option to, if anybody has any ideas.

Thanks for help in advance

  Martin 

0 Kudos
Message 1 of 8
(9,054 Views)

Sorry mate, not got LV 2015 on any machines.

I've certainly done something similar to what you need using the standard TDMS VIs and it's not too tricky.

If you downscale the VI to 2014 or sooner I'll have a nose.

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 2 of 8
(8,171 Views)

Can you fake an example directory list so I can see what you mean by suffix?

If you can do the string concatenation of the sample number (couldn't see that in your example) then see if that file already exists and then modify the name if it does.

Steve et al.- here's the file as a snippet so you can see what's there - can't attach a 2014 version but I'll email it to you.

vi snippet for LV 2015.png

S.

0 Kudos
Message 3 of 8
(8,171 Views)

Cheers Sach,

Will check out tonight

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 4 of 8
(8,171 Views)

Hi Martin,

Can we explore the requirement a bit more in words and not VIs.

Do you want to generate a single file for each sample?, with each file having a different name but with common custom properties against sample?.

If you can put the issue in those terms it will save me a lot of time.

Love

Steve

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 5 of 8
(8,172 Views)

Afternoon everybody,

Thanks for the responses, here is a little more detail and version 14 vi attached.

There are many parameters / settings I want to record with the actual channel data in the Tdms, hence all the properties I want to add to the Tdms file.  I can then sort and select by these properties in DIAdem.  I think I’ve cracked this in the attached vi but it getting a suffix like in labviews ‘write measurement file’ I’m struggling with

The file name is also the sample number and is created in the main vi.  There may be multiple tests on the same sample and would like to add a suffix each time and not overwrite or append the file.  The labview ‘write measurement file’ explains how the suffix looks quite well so attached a couple of screenshots. 

Example of sample number 005 with 4 tests would look like:

005_001.tdms
005_002.tdms
005_003.tdms
005_004.tdms

Thanks for the idea of doing the checking if file exists and the concatenating, but wondered if there was a ‘built way’ like the labviews ‘write measurement file’

Kind regards

Martin

0 Kudos
Message 6 of 8
(8,172 Views)

I certainly wouldn't expect there to be a built way of doing it as it is a quite specific requirement.

I've used the method Sacha suggested many times, essentially just count the similar items and increment the result for a new number (a less risky strategy is to run through looking for the same file name and increment the suffix every time it matches until it doesn't)

Steve


Opportunity to learn from experienced developers / entrepeneurs (Fab,Joerg and Brian amongst them):
DSH Pragmatic Software Development Workshop


Random Ramblings Index
My Profile

0 Kudos
Message 7 of 8
(8,172 Views)

Thanks for all the help; seems I wasnt missing something too obvious.  May have a re-think on what I'm trying to achieve: is the extra work of adding the suffix automatically worth the luxury of the easy identification of the sample from the file name.

Kind regards

Martin

0 Kudos
Message 8 of 8
(8,172 Views)