From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Can we import a timestamp column in DIAdem

I have a 2 channels with time information - one in string format and the other in timestamp format.  It seems that when I try to open my TDM file, DIAdem gets stuck.  I'm sure that its because I can't have string or timestamp information in a TDM file.  If that is the case then how do I import my time?  Thanks.
 
--cj
0 Kudos
Message 1 of 6
(4,592 Views)
Hi cmiranda,
 
Actually, you can have both string and date/time channels in a TDM file and in DIAdem.  So, I'm guessing the way you're writing your TDM file is suspect if DIAdem is hanging trying to import it.  What happens when you try to load that TDM file back into LabVIEW?
 
The one goofy thing about this with LabVIEW 7.x and DIAdem 9.x is that LabVIEW saves the date/time values as the time in Greenwich, England (GMT), whereas DIAdem expects time to be saved as the local time.  So you either have to add on the number of seconds of time shift you have with GMT in LabVIEW prior to saving, or you have to add on those seconds after you've loaded the date/time channels into DIAdem.
 
I'm including below an example of how to do the former-- save date/time channels in LabVIEW which can be read back perfectly in DIAdem.  Note, though, that this means these same value read back into LabVIEW will be interpreted incorrectly, so you have to make a fundamental choice to make DIAdem or LabVIEW happy and run a quick addition/subtraction in the other application.  We are indeed working to make this less irksome.
 
Feel free to send in your VI that is creating the TDM file,
Brad Turpin
DIAdem Product Support Engineer,
National Instruments
Message 2 of 6
(4,569 Views)
CJ,
 
I'm not sure that the reason why you are having trouble when opening your TDM file is due to the timestamp channel.  TDM files do support timestamp channels, but they have to be specified as such.
 
How did you create your TDM file?  When the file was created, did you specify your timestamp channel to be of Date/Time type?  If not, try to reload your data into DIAdem and make sure that it is imported with the correct format and data type.
 
Santiago D
 
0 Kudos
Message 3 of 6
(4,565 Views)

Brad,

I've been playing with DIAdem 9 a bit more this month along with your attached files.  I'm wondering, how do we convert time that is already formated as a numeric in seconds since 1904, i.e. secs GMT from your attached files, to a timestamp formated as Time rather than numeric.  For example I want to be able to view Secs GMT in mm/dd/yyyy hh:mm:ss.sssss.  I'm currently messing with some solutions but your input would be helpful.

--cj

0 Kudos
Message 4 of 6
(4,454 Views)

I think I might have finally figured it out.  I entered the following formula into DIAdem's calculator


To calculate time given sec since 1.1.0000
ch(#):='Secs GMT'+60052924800+(363*86400)+(37256*86400)


To calculate time given sec since 1.1.1904
ch(#):='Secs GMT'+60052924800+(363*86400)

secs from year 0001 to 1904 60052924800

I don't know however, why I had to substract 2 days from a year. 

0 Kudos
Message 5 of 6
(4,446 Views)

Hi cmiranda,

Here's a VBScript library I use to convert values back and forth between date/time strings, DIAdem date/time numbers (since 0 AD) and VBScript date/time numbers (since 100 AD).

Hope that helps,
Brad Turpin
DIAdem Product Support Engineer
National Instuments

 

0 Kudos
Message 6 of 6
(4,432 Views)