02-24-2016 12:52 PM
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
Solved! Go to Solution.
02-24-2016 02:32 PM
I'm sorry, I meant File properties, not root.
02-24-2016 04:37 PM
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.
And just as a note, the "File" level and the "Root" level are the same thing.
Let us know if that helps,
Otmar
02-24-2016 04:53 PM
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?
02-25-2016 01:18 AM
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
02-25-2016 10:10 AM
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
02-25-2016 11:02 AM
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?
02-25-2016 05:07 PM
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
02-26-2016 07:59 AM
I wrote it myself. There are a few custom things that I need done that can't be done in the wizard.
02-26-2016 08:17 AM
I see that my problem is now somewhat similar to a previous post:
I'm looking through the Thermotron dataplugin you created for a solution or new ideas.