Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving PSD to TDMS

Hi,

 

Does anybody know how to save a Power Spectral Density to a TDMS file or should I be saving it to a different file type? I'm getting the 'Polymorphic terminal cannot accept this data type' when I try to wire the output to a TDMS Write.

 

Thank you,

 

Dan

Donners
0 Kudos
Message 1 of 14
(7,034 Views)

typedef enum {
    tdsTypeVoid,
    tdsTypeI8,    
    tdsTypeI16,    
    tdsTypeI32,    
    tdsTypeI64,
    tdsTypeU8,    
    tdsTypeU16,    
    tdsTypeU32,    
    tdsTypeU64,
    tdsTypeSingleFloat,    
    tdsTypeDoubleFloat,    
    tdsTypeExtendedFloat,    
    tdsTypeSingleFloatWithUnit=0x19,    
    tdsTypeDoubleFloatWithUnit,    
    tdsTypeExtendedFloatWithUnit,
    tdsTypeString=0x20,   
    tdsTypeBoolean=0x21,   
    tdsTypeTimeStamp=0x44,   
    tdsTypeDAQmxRawData=0xFFFFFFFF
} tdsDataType;

Above are the data types supported by TDMS.

Message 2 of 14
(7,030 Views)

Hi Donners,

 

I believe the power spectral density is a cluster of doubles. You could probably use an unbundle by name function and write the double values to a TDMS file.

 

I hope that helps.

 

Kind Regards,


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

0 Kudos
Message 3 of 14
(7,025 Views)

Hi Laurence,

 

It's an array of clusters, so I'm gonna have to look for another way of saving it.

 

Cheers

Donners
0 Kudos
Message 4 of 14
(7,020 Views)

Hi Donners,

 

Would it not be possible to use an auto-indexing FOR loop to unbundle the individual elements before placing them back in an array for writing to a TDMS file? I have attached a VI which will do this.

 

tmds write of PSD array.png


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

Message 5 of 14
(7,017 Views)

Cheers Laurance,

 

That's something I'd never have thought of. Is there any reason you choose TDMS format version 1?

 

 

Donners
0 Kudos
Message 6 of 14
(7,005 Views)

Hi Donner,

 

There was no particular reason format 1.0 was chosen. To save time creating the example I reused one of LabVIEW's example code for writing TDMS files which had that file format chosen. If you want to find out more about the file formats the following page is very good:

 

http://www.ni.com/white-paper/5696/en

 

Kind Regards,


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

0 Kudos
Message 7 of 14
(6,988 Views)

Hi Laurence,

 

How did you get it to auto-index at the input tunnel to the for loop? The option is greyed out for me.

 

 

 

Thanks

 

 

Donners
0 Kudos
Message 8 of 14
(6,980 Views)

This is what I'm talking about.....

Donners
Download All
Message 9 of 14
(6,979 Views)

Hi Donners,

 

Are you sure it is actually an array of clusters that you get from your express VI? You can check this by hovering over the wire with context help up. The reason I ask is that you would not be able to unbundle the wire if it were an array and it seems from your picture that the wire connects without indexing.

 

Kind Regards,


Larry Colvin
Associate Principal Engineer
Dyson Technology Ltd.

Message 10 of 14
(6,972 Views)