neilg

PIProperty.Add specify propertytype in Module DB

Discussion created by neilg on Apr 13, 2014
Latest reply on Apr 16, 2014 by neilg

Hello fellow people of the world,

 

I am attempting to add a PIProperty under a root PIProperty using the .Add method. The parameters for the Add method only allow for the name and value. What I also need is the ability to specify the type.

 

Does anyone have any quick samples to show how to specify the Data Type for the PIProperty? I have looked on VCampus and techsupport but haven't found anything concrete yet.

 

 

 

Sample code:

 

Dim rootProperty as PISDK.PIProperty

 

' Get the root property from the module db - this is a long piece of code and I am excluding it from here

 

rootProperty.PIProperties.Add(name, value)

By default all adds end up as a String and I need to add properties with the following types as well:
DATE
LONG
SHORT

 

 

 

NOTE: I am aware that we should not be using ModuleDB much but this is a special case where the client does not have AF yet.

Outcomes