With much guidance from
http://www.rjksolutionsltd.co.uk/forum/yaf_postst137_Rapid-PI--PIModuleDatabase-to-PIAF-Conversion-Code.aspx I have manged to retrieve values from the Module Database. And with more stumbling around, I am able to add new modules. My question has to do with how to add properties (haven't tried aliases yet) AND set the appropriate data type.
For example, to get a value:
Code:PISDK.Server("ServerName").PIModuleDB.PIModules("ModuleA").PIProperties("Property1").Value
And to add a module:
Code:PISDK.Server("ServerName").PIModuleDB.PIModules("ModuleA").Add ("New Module Name")
And to add a property:
Code:PISDK.Server("ServerName").PIModuleDB.PIModules("ModuleA").PIProperties.Add ("Property1","_____") = "Value for property"
Where I am confused is:
1) What goes in the blank? It doesn't seem to affect the outcome of the function if it's random or nonsensical.
2) How can the "Value for property" be a date? Below are examples of what an input gives and what the "data type" result is.
5 -> short
5.432 -> double
01-Jun-10 00:00:00 AM -> string
01-Jun-10 00:00:00 -> string
01-Jun-10 -> string
5/13/2010 12:00:00 AM -> string
Disclaimer: Any code presented by myself might be unconventional because of the lack of formal training. Any corrections are welcome. =)