LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert TDMS channel to waveform

I have a TDMS channel (an array of data) and want to convert this to a waveform.

In old versions of LabVIEW (8.2.0?) I could do this with the following code:


Now (LV 8.2.1+8.5 and DIADem 10.2) I see that the channel is not a waveform but a numeric and see a protected property (Grey) 'Waveform'.
Somehow I cannot write this property, does anyone know about this.

Ton

Message Edited by TonP on 08-15-2007 02:03 PM

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 1 of 6
(3,979 Views)
Does it work if you skip all the code in your screenshot and just wire a waveform to TDMS Write? We will set all these properties automatically if you do. You can also do that in a loop, LabVIEW will know to not write the same properties again and again.

Herbert
0 Kudos
Message 2 of 6
(3,969 Views)
Yes a direct waveform works (Thumbs-up)

But I have data that I get at approx. 1 Hz (plm 10 ms.)
Would this be an issue?
Could I do a dummy write for the first value and then continue with the array version?

The actual problem is it used to work (this hack I have to admit)

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 6
(3,967 Views)
Doing a dummy write first should do the job just fine.

The weird thing about this working is that the T0 timestamp is supposed to go into wf_start_time. If you write it to wf_start_offset, I don't know what DIAdem does with it. wf_start_offset is used e.g. for frequency-domain data, where "T0" is a floating point number. You could modify the existing code to try wf_start_time, but if you stay with a waveform dummy write, you're on the safe side if we add new stuff in the future.

If you are acquiring at 1Hz, I think you might be doing single-point acquisition. In that case, make sure to use the NI_MinimumBufferSize feature to keep your files lean and mean. If for some reason you don't want to go with that, I recommend defragmenting the file before post-processing.

Herbert


0 Kudos
Message 4 of 6
(3,962 Views)
Hi Herbert,

thanks for the answers!
I'll do a dummy write. I write to the file in several places (and have it open in several places). Upon finishing my measurement I defragment the file. Allthough I have seen that closing can take some time.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 6
(3,959 Views)
Closing takes some time - that is very unusual. It can potentially happen if you use NI_MinimumBufferSize and you still have a significant amount of data in memory that needs to be flushed to disc when you close. Still doesn't sound like that should take a noticable amount of time. Other than flushing contents from memory to disc, the only thing we do in TDMS Close is deallocating our in-memory data structures. Unless you pile these up so much that the machine starts paging, that should be done in a split second, too. Not sure if you can create some borderline case by opening the file multiple times.

Herbert
0 Kudos
Message 6 of 6
(3,954 Views)