Can piconfig change the default settings in point class base? If so I would like to change the compression and exception values and time? If so, can you provide the scripting?
Thanks for posting on PI Square!
Yes, it is possible to change the default attribute settings for a given ptclass using PI Config. However, keep in mind that editing default values in a ptclass can oftentimes cascade changes to other tags/configuration which may be unintended and editing the "base" ptclass is not recommended. Oftentimes, we recommend using tools such as PI Builder to set the tag attribute settings in mass after creation. However, as I said before, this can be done, and if you decide to make changes to the default attribute values for a ptclass - backup your PI Data Archive first.
The methodology for editing a ptclass is described in the "Modification of PI Point Classes" section of the PI Data Archive System Management Guide, which can be found here:
Overall, you would need to create a new attribute set with the default values desired, then apply the new attribute set to the base point class. Again, this is not recommended, but is possible. If you decide to proceed, please take a backup first before attempting any edits, and if you have a test environment you can try in first, I would strongly recommend starting there. In general, it is much safer to apply the attribute settings desired in mass with PI Builder after creating the tags desired.
Thanks, and hope this helps!
- Adam Fink
Thank you Adam.
I agree, its not the best idea to change the base defaults. With that being said, can we make a new point class with the same characteristics (exception and compression criteria) found in base but with the default values I desire?
How will you be writing values to these tags? If you will be using a custom application with AFSDK, PIWebAPI, etc, then yes you could create the custom point class with same characteristics as Base. If you intend to write to these points with PI Interfaces, I would recommend building them with characteristics found in the "Classic" point class. This point class was specifically built for use with PI Interfaces and includes all necessary tag attributes for configuring tags with PI Interfaces.
Sorry Adam. My second question was not well developed. Can I make a new point class, inheriting the characteristics of both base and classic but overriding the specific characteristics of excdev, excdevpercent, excmax, excmin, compdev, compdevpercent, compmax, compmin, (found in base) with the default values I would like to use for new tags?
I just attempted to create a custom point class, which inherits from base and classic point classes, and edit the default value of attributes in the base attribute set. Unfortunately, this approach does not work. Since the new point class inherits from base, editing an attribute in the base attribute set will attempt an implicit edit on base point class, which is not allowed and an error will be thrown: "attribute name being used by base attribute set"
So, I tested making the default value change to the "base" point class, and was successful. From the screenshot below, you can see I was able to change the default values for span to 101 and typicalvalue to 27.
However, even after restarting SMT, if I try to create a "classic" PI Point using Point Builder with these default values, it will not work because the default values of 100 and 50 are hard coded into the default fields in Point Builder. However, when creating a new point from PowerShell with the PowerShell Tools for the PI System, my custom default values are applied properly. It also important to note, that changing only the default value of attributes in the Base attribute set does not induce implicit changes on all tags, and this change will only be applied for new tags created from now on, which are not created from PI SMT. Creating tags from PI Builder or other custom apps like AF SDK, PI Web API should honor these new default values.
Overall, from my testing it looks like you should be able to change just the default values (no other changes) to the base attribute set without severe or unknown consequences. However, please backup your PI Data Archive prior to making these changes. I will post the method to make these changes in another reply.
Method to change default values of attributes from Base attribute set. NOTE - as long as you are only editing default values, you do not need to put the server in standalone mode.
NOTE: For anybody in the future looking at this thread - please either contact OSIsoft Tech Support or post a new thread on PI Square to discuss use case and other considerations prior to using this method.
NOTE: Again, please backup your PI Data Archive prior to running this procedure
Copy the base.dif file and rename the copy to baseModify.dif. Open baseModify.dif using a text editor.Rename ..PI\adm\base - copy.dif to ..PI\adm\baseModify.dif. If that line is missing you can leave it this way.
In Windows Server 2008, you may have to use "Run As..." to run your text editor with Administrator privileges.
Open baseModify.dif in notepad and replace @mode create with @mode edit.Replace default compmax value with new value.Save the file when finished.
In this example, replace int32 with int16.Do not otherwise alter the baseModify.dif file.
Place the PI server in 'standalone' mode...PI\adm> piartool -standalone 1
WARNING: This closes all SDK and API connections, including interfaces!
Run the baseModify.dif file in piconfig.piconfig < baseModify.dif
You may want to output the results to a text file.piconfig < baseModify.dif > output.txt
Confirm the new default value using piconfig.@table piatrset@mode list@ostr set@ostr attrib,type,default@ostr ...@select set=base@ends
Return the PI server to 'normal' mode...PI\adm> piartool -standalone 0
Retrieving data ...