From 8804211cbcca01ae9cbd2fc128422ed0cbd54bb9 Mon Sep 17 00:00:00 2001 From: Archie Date: Wed, 30 Jul 2025 12:04:03 -0600 Subject: [PATCH] Add MinimimumSamplingInterval when applicable. --- NodeSetToAML.cs | 5 +++++ SystemTest/NodeSetFiles/TestAml.xml | 35 ++++++++++++++++++++++++++++- SystemTest/TestAttributes.cs | 5 +++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/NodeSetToAML.cs b/NodeSetToAML.cs index a41a839..1410b78 100644 --- a/NodeSetToAML.cs +++ b/NodeSetToAML.cs @@ -3373,6 +3373,11 @@ InternalElementType RecursiveAddModifyInstance(ref T parent, UANode toAdd, bo AddModifyAttribute( ie.Attribute, "ValueRank", "Int32", varnode.ValueRank ); SetArrayDimensions( ie, varnode.ArrayDimensions ); + + if (varnode.MinimumSamplingInterval > 0) + { + AddModifyAttribute(ie.Attribute, "MinimumSamplingInterval", "Double", varnode.MinimumSamplingInterval); + } } if( toAdd.DecodedNodeId.Equals( Opc.Ua.ObjectIds.Server_ServerDiagnostics ) ) diff --git a/SystemTest/NodeSetFiles/TestAml.xml b/SystemTest/NodeSetFiles/TestAml.xml index 6495e39..ab77d5f 100644 --- a/SystemTest/NodeSetFiles/TestAml.xml +++ b/SystemTest/NodeSetFiles/TestAml.xml @@ -3250,11 +3250,44 @@ + + NegativeMinimumSamplingInterval + + i=63 + ns=1;i=5013 + + + -1 + + + + + ZeroMinimumSamplingInterval + + i=63 + ns=1;i=5013 + + + 0 + + + + + PositiveMinimumSamplingInterval + + i=63 + ns=1;i=5013 + + + 1 + + + diff --git a/SystemTest/TestAttributes.cs b/SystemTest/TestAttributes.cs index f28be0a..2cf4ecd 100644 --- a/SystemTest/TestAttributes.cs +++ b/SystemTest/TestAttributes.cs @@ -43,6 +43,11 @@ public class TestAttributes [DataRow("IsAbstract", "2881", "false", true, true, DisplayName = "AcknowledgeableConditionType should not be Abstract")] + [DataRow("MinimumSamplingInterval", "2253", "", + false, true, DisplayName = "Server should not have MinimumSamplingInterval")] + [DataRow("MinimumSamplingInterval", "2994", "1000", + true, true, DisplayName = "Auditing should have MinimumSamplingInterval")] + public void TestAttribute(string attribute, string nodeId, string expected, bool expectedToBeFound, bool foundationRoot = false) {