AFAttribute.SetConfigStrings Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Set the ConfigString values for the specified list of attributes.
Namespace: OSIsoft.AF.Asset
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static void SetConfigStrings( IList<AFAttribute> attributes, IList<string> configStrings )
Public Shared Sub SetConfigStrings ( attributes As IList(Of AFAttribute), configStrings As IList(Of String) ) Dim attributes As IList(Of AFAttribute) Dim configStrings As IList(Of String) AFAttribute.SetConfigStrings(attributes, configStrings)
public: static void SetConfigStrings( IList<AFAttribute^>^ attributes, IList<String^>^ configStrings )
static member SetConfigStrings : attributes : IList<AFAttribute> * configStrings : IList<string> -> unit
Parameters
- attributes
- Type: System.Collections.GenericIListAFAttribute
The list of attributes that will be updated with the corresponding ConfigString in the configStrings list. - configStrings
- Type: System.Collections.GenericIListString
The list of new ConfigString values for the corresponding AFAttribute in the attributes list.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException | This exception is thrown if either of the parameters is . |
| ArgumentOutOfRangeException | This exception is thrown if the number of items in the attributes and configStrings lists do not match. |
| NotSupportedException | This exception is thrown when connected to a PI AF Server 2.5 or earlier. |
| SecurityException | This exception is thrown when the user does not have Write permission on one of the attributes in the specified list. |
Remarks
This method will set the ConfigString values for each of the attributes without requiring the AFElement to be checked out. Setting a ConfigString in the configStrings list to or an empty string will reset the attribute to the template's default configuration. This would be more efficient than calling ResetToTemplate on each attribute.