DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I access the value of the "createTime",or any other, root property?

Solved!
Go to solution

I want to carry over the value of the Root property "createTime" in a custom property so that when I load and modify the file, I can still see when the original file was created. I'm sure there is a simple solution, but I can not get it to work.

 

My code in the dataplugin so far is along the lines of:

 

Dim Test_Date : Test_Date = ????  (In other posts I've seen code ith 'RootElements("createTime")' and some mention of 'Value.VariantDate', but I'm not sure how to get it to work.)

Call Root.Properties.Add("Test_Date",Test_Date)

 

Thanks for any help.

 

Kevin

 

0 Kudos
Message 1 of 11
(5,361 Views)

I'm sorry, I meant File properties, not root.

0 Kudos
Message 2 of 11
(5,354 Views)

Hello Kevin,

 

There is a setting in the "DIAdem Settings" menu that may do what you are asking for, it's quick to try, so if this doesn't work it's not a huge waste of time on your end.

 

  1. Go to the menu "Settings > DIAdem Settings"
  2. Click on the "Load behaviour" tab on the left side of the settings dialog
  3. Chose a "Property inheritance level" setting other than "None"

DIAdem settings.png

 

And just as a note, the "File" level and the "Root" level are the same thing.

 

Let us know if that helps,

 

     Otmar

Otmar D. Foehner
0 Kudos
Message 3 of 11
(5,347 Views)

Hi Otmar,

 

That brings over all of the custom properties that I've added to the Root through the dataplugin, plus Description, Title, and Storage Date/time. The Creation date is not being brought over.

 

Is there no other way to get the date stored to that property?

0 Kudos
Message 4 of 11
(5,344 Views)

Hi Kevin,

 

a date property can be created in different ways, either assign a variant of type vt_date or create a date/time object (usiTimeDisp):

 

'Use VBS function to get current date and time
Dim Test_Date : Test_Date = now
Call Root.Properties.Add("Test_Date", Test_Date)
 
'Create usiTimeDisp object, must be assigned using the set statement
Dim Create_Date : Set Create_Date = CreateTime(2016,2,25,8,0,0)
Call Root.Properties.Add("Create_Date", Create_Date)

Hope this helps

0 Kudos
Message 5 of 11
(5,333 Views)

Hi Kevin,

 

The "Creation Date" property is just the property that displays in Windows Explorer and is maintained by the operating system.  It is not part of the data file and does not load into DIAdem.  It is also not a very reliable property.  Is there any way you can determine the measurement start date from the data file itself?  Perhaps the file name or some header information inside the file?

 

Your only option to import the Windows "Creation Date" property is to execute VBScript code to read out that file's settings and paste the "Creation Date" value to a new custom property in the Data Portal.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 6 of 11
(5,320 Views)

I can add a column that will save the date and time of the test in the raw file, I just haven't since I thought this method could help me for old and new files.

 

If I were to add those columns they would be seperate, and the date would be the format 02/25/16, and the time would be 11:46:30.21.

 

So, I'd make my format:

oFile.Formatter.TimeFormat = "MM/DD/YY hh:mm:ss.ff"

 

Wouldn't that give me a result like "02/25/2016 00:00:00.00" for the date, and "00/00/0000 11:46:30.21" for the time?

 

 

 

 

0 Kudos
Message 7 of 11
(5,317 Views)

Hi Kevin,

 

If you're using a DataPlugin to read the data file in question, then there is a construct in the VBScript DataPlugin API that puts the Date and Time columns together to make one complete DateTime channel in the Data Portal.  Did you create the DataPlugin you're using, did it install with DIAdem, or did you download it from the www.ni.com/dataplugins web site?

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 8 of 11
(5,309 Views)

I wrote it myself. There are a few custom things that I need done that can't be done in the wizard.

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

I see that my problem is now somewhat similar to a previous post:

 

http://forums.ni.com/t5/DIAdem/script-or-operation-to-split-a-date-and-time-channel-into-two/m-p/289...

 

I'm looking through the Thermotron dataplugin you created for a solution or new ideas.

 

0 Kudos
Message 10 of 11
(5,274 Views)