DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS to MDF time stamp conversion error / Storage date time changes

Solved!
Go to solution

I've been fighting this for awhile, I figured I'd throw it out there...

 

Lets say I have a TDMS file that has a labview time stamp channel and 2 Thermocouple channels.

 

 Capture1.JPG

 

I load it into DIADEM, i get this:

 

Capture3.JPG

 

Perfect!  But, now lets say I want to save the TDMS as a MDF file so I can review it within Vector CANape.  I right click and save as MDF, perfect.  I fire up CANape and get this:

 

Capture5.JPG

 

 

The year 2121, yes i am taking data on a star ship!!!  It appears to be taking the TDMS storage date/time stamp as the start point and adding the TC_Timestamp channel.

 

 

If I edit the TC_Timestamp channel to 1, 2, 3, 4, 5, 6, 7 etc.... and save as MDF, i get this:

 

Capture6.JPG

 

Really close, 2012!   but what I really want is this to show from the time it was recorded which would be 10-09-2012.   

 

The problem is every time I do the save as, the storage date time is updated to current time, then the MDF plugin appears to use that as the start point.

 

 

is there any way of stopping this from updating in DIADEM?

 

Capture7.JPG

 

 

thanks,

 

Ben

0 Kudos
Message 1 of 11
(10,073 Views)
Solution
Accepted by topic author ben_jansky

Hi Ben,

 

You got it right that the MDF DataPlugin writes the Storage date/time to MDF start time that will get updated by DIAdem when writing. We are looking into this and will return to you if any progress.

 

As a workaround, you may want to try converting TDMS to MDF in LabVIEW with Storage VIs.

Something like the following, you can write your measurement start time to MDF file.

WriteMDF.png

 

Hope this helps,

Mavis

Message 2 of 11
(10,017 Views)

Thanks!  this worked!

 

I created some fake data in a TDMS, read it in and wrote to a MDF file.

 

Here's my CANape plot:

 

Capture22.JPG

 

Oct 9th, 2012, just as I needed.

 

thanks,


Ben

0 Kudos
Message 3 of 11
(9,977 Views)

Hi All,

 

On October 19, 2012 the MDF DataPlugin at www.ni.com/dataplugins was updated to read the property "File.hd_start_time" and use that as the global starting date/time value for the first (Time) channel in each group.  Here's a VBScript that converts the LV elapsed seconds time channel to a DIAdem time channel and writes the corresponding "File.hd_start_time" property prior to exporting the group as a new MDF file:

 

UTC_Offset = 5*(3600) ' secs from GMT to measurement location
LV_DD_Offset = 60084288000 ' secs from 0 AD to 1904 AD
Call DataDelAll
Call DataFileLoad(TdmsFilePath, "TDMS")
Set Group = Data.Root.ChannelGroups(1)
Set TimeChannel = Group.Channels(1)
Call ChnLinScale(TimeChannel, TimeChannel, 1, LV_DD_Offset-UTC_Offset)
TimeChannel.Properties.Add "DisplayType", "Time"
StartTimeDBL = TimeChannel.Values(1)
StartTimeVBS = StartTimeDBL/(3600*24) - 693958
StartTime = CDate(StartTimeVBS)
Data.Root.Properties.Add "hd_start_time", StartTime
Call DataFileSave(Mdf_FilePath, "MDF")

 

I'm also including a VI that does something similar,

Brad Turpin

 

 

Message 4 of 11
(9,943 Views)

Hi Brad,

 

When I run this vi, I get two consecutive errors in the Close Data Storage block, and it does not write the mdf file. I've attached a screenshot. Do you know what might be going wrong?

 

Thanks -

 

0 Kudos
Message 5 of 11
(9,520 Views)

Hi aoehlerking,

 

Where is this error actually occuring in your code? The trick will be finding the point of failure and checking to ensure the object reference given to that point is still valid.

 

Regards,

James W.
Applications Engineer
National Instruments
Message 6 of 11
(9,505 Views)

Hi aeo,

 

Your attached conversion error PNG file appears to be empty.  The VI ran correctly on my computer, so I'm quite curious what the error is on yours.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 11
(9,500 Views)

That's odd - when I click on the .PNG link, it shows the screenshot of the error that I'm getting...in any case, the error window reads as:

 

Error - 2553 occurred at Close Data Storage

Possible reasons: The object refnum is invalid. The node that returned this refnum might have encountered an error and did not return a valid refnum. The storage this refnum refers to might have closed before the call executed.

 

 

Could this point to a race condition in the .vi?  I did not make any modifications - just downloaded, ran in LV 2012, selected a .tdms file, then selected an .mdf file to save to.

 

0 Kudos
Message 8 of 11
(9,490 Views)

Hi aoe,

 

I get the same error you do if I leave the "Group to Export" control set to "3" and select a TDMS file with fewer than 3 Groups in it.  If I change the "Group to Export" control to "1" the VI performs perfectly in LV 2012.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

Message 9 of 11
(9,486 Views)

Ahh, yes that is clear now, thanks Brad. I should have tried fiddling with that before.

 

Perhaps diverging from the main point of this thread, but my new error is that LabView is unable to recognize my data-plugin for .mdf files. The error is:

 

Error -2564 occurred at Close Data Storage

Possible reason(s):

LabVIEW: The software installed on this computer does not support the file format you requested. The Storage/DataPlugin VIs access files through plug-in libraries LabVIEW and DIAdem install.

 

I have installed both mdf plugins (3.0 and 4.0) from this page and restarted the computer multiple times: http://zone.ni.com/devzone/cda/epd/p/id/452. However, after double clicking on the 'Open Data Storage' block, it still does not show MDF as a DataPlugin option.

 

Do I need to adjust some other Labview setting to get it to recognize the installed plugins?

 

Thanks -

Austin

0 Kudos
Message 10 of 11
(9,480 Views)