From 323e49b60bfeda7e7ff8aa3c741abc47ccdc4a87 Mon Sep 17 00:00:00 2001 From: Archie Miller <62433534+Archie-Miller@users.noreply.github.com> Date: Fri, 24 Jan 2025 11:22:15 -0700 Subject: [PATCH] Remove DefaultValue --- NodeSetToAML.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/NodeSetToAML.cs b/NodeSetToAML.cs index 7a106b3..78146ad 100644 --- a/NodeSetToAML.cs +++ b/NodeSetToAML.cs @@ -841,7 +841,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str case BuiltInType.UInteger: case BuiltInType.Enumeration: { - a.DefaultAttributeValue = a.AttributeValue = val; + a.AttributeValue = val; break; } @@ -851,13 +851,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str if ( bytes != null ) { string encoded = Convert.ToBase64String( bytes, 0, bytes.Length ); - a.DefaultAttributeValue = a.AttributeValue = new Variant( encoded.ToString() ); - //StringBuilder stringBuilder = new StringBuilder(); - //for( int index = 0; index < bytes.Length; index++ ) - //{ - // stringBuilder.Append( (char)bytes[ index ] ); - //} - //a.DefaultAttributeValue = a.AttributeValue = new Variant( stringBuilder.ToString() ); + a.AttributeValue = new Variant( encoded.ToString() ); } break; @@ -880,7 +874,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str if ( nodeId != null ) { - a.DefaultAttributeValue = a.AttributeValue = nodeId; + a.AttributeValue = nodeId; AttributeType rootNodeId = a.Attribute[ "RootNodeId" ]; if ( rootNodeId != null ) { @@ -955,14 +949,14 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str case BuiltInType.StatusCode: { StatusCode statusCode = (StatusCode)val.Value; - a.DefaultAttributeValue = a.AttributeValue = statusCode.Code; + a.AttributeValue = statusCode.Code; break; } case BuiltInType.QualifiedName: { - a.DefaultAttributeValue = a.AttributeValue = val; + a.AttributeValue = val; QualifiedName qualifiedName = val.Value as QualifiedName; if( qualifiedName != null ) @@ -983,7 +977,7 @@ private AttributeType AddModifyAttribute(AttributeSequence seq, string name, str Opc.Ua.LocalizedText localizedText = (Opc.Ua.LocalizedText)val.Value; if( localizedText != null && localizedText.Text != null ) { - a.DefaultAttributeValue = a.AttributeValue = localizedText.Text; + a.AttributeValue = localizedText.Text; if ( !string.IsNullOrEmpty( localizedText.Locale ) ) { AddModifyAttribute(a.Attribute, localizedText.Locale,