View Issue Details

IDProjectCategoryView StatusLast Update
0008425CTT UA Scripts1 - Script Issuepublic2023-07-21 16:32
ReporterV. Monfort Assigned ToYannik Klaass  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.03.503 
Summary0008425: basicCreateMonitoredItemsTest.js does not manage subscriptionObjectReference correctly
Description

basicCreateMonitoredItemsTest.js does not manage subscriptionObjectReference correctly (version setup-opc-ua-1.03-compliance-test-tool-v1.03.09-01.00.500-20220807)
subscriptionObjectReference should be used when it is necessary to reuse the an already established session subscription which is necessary if only 1 subscription is available.

The following tests of "Monitor Value Change" conformance unit were supposed to use MonitorBasicSubscription reference but are not due to the issue (another subscription is created): 002, 004, 005, 006, 007, 008
And the following tests of "Monitor Items Deadband Filter" shall use MonitorBasicSubscription to avoid creation of several subscriptions: 001, 002, 003, 004 and 005

By applying the following patches, it is possible to obtain the expected behavior and to avoid use of several subscriptions while it is not necessary and not supported by all profiles.

{{{
--- a./library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
+++ b./library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
@@ -41,9 +41,14 @@ function basicCreateMonitoredItemsMultipleNodes( nodes, mode, filter, queueLengt
var PublishHelper; // this will become a Publish helper (further down)
// create the required number of subscriptions
for( s=0; s<subscriptionCount; s++ ) {

  • if( subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) subscriptions[s] = subscriptionObjectReference;
  • else subscriptions[s] = new Subscription( scanrates[s], true );
  • createSubscriptionsSuccess[s] = CreateSubscriptionHelper.Execute( { Subscription: subscriptions[s] } );
  • if( s == 0 && subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
  • subscriptions[s] = subscriptionObjectReference;
  • createSubscriptionsSuccess[s] = true;
  • }
  • else{
  • subscriptions[s] = new Subscription( scanrates[s], true );
  • createSubscriptionsSuccess[s] = CreateSubscriptionHelper.Execute( { Subscription: subscriptions[s] } );
  • }

     if( createSubscriptionsSuccess[s] ) {
         // define our Publish service call helper instance.

    @@ -139,7 +144,7 @@ function basicCreateMonitoredItemsMultipleNodes( nodes, mode, filter, queueLengt
    // CLEAN UP
    // delete the subscriptions
    for( s=0; s<subscriptionCount; s++ ) {

  • if( subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
  • if( s == 0 && subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
    DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: monitoredItems[s], SubscriptionId: subscriptionObjectReference } );
    }
    else {
    @@ -156,5 +161,5 @@ function basicCreateMonitoredItemsTest( mode, filter, queueLength, timestamps, s
    addWarning( "Unable to get or convert the NodeId from the NumbericSettings into a Monitored Item. Aborting test." );
    return( false );
    }
  • basicCreateMonitoredItemsMultipleNodes( items, mode, filter, queueLength, timestamps, 1, subscriptionObjectReference );
    -}
    \ No newline at end of file
  • basicCreateMonitoredItemsMultipleNodes( items, mode, filter, queueLength, timestamps, 1, null, subscriptionObjectReference );
    +}
    --- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js
    +++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js
    @@ -11,8 +11,8 @@ function createMonitoredItems591003() {
    const FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue ); // needs to reflect whatever "ON" means?????
    const QUEUE = 1;
    const TIMES = TimestampsToReturn.Server;
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
    return( true );
    }
    --- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/002.js
    +++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/002.js
    @@ -13,8 +13,8 @@ function createMonitoredItems591006() {
    const FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
    const QUEUE = 1;
    const TIMES = TimestampsToReturn.Server;
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
    return( true );
    }
    --- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/003.js
    +++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/003.js
    @@ -13,8 +13,8 @@ function createMonitoredItems591007() {
    const FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
    const QUEUE = 0;
    const TIMES = TimestampsToReturn.Server;
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES )
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription )
    return( true );
    }
    --- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/004.js
    +++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/004.js
    @@ -13,8 +13,8 @@ function createMonitoredItems591010() {
    const FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
    const QUEUE = 1;
    const TIMES = TimestampsToReturn.Server;
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
    return( true );
    }
    --- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/005.js
    +++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/005.js
    @@ -13,8 +13,8 @@ function createMonitoredItems591011() {
    const FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
    const QUEUE = 0;
    const TIMES = TimestampsToReturn.Server;
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
  • basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
    return( true );
    }
    }}}
TagsNo tags attached.
Files Affected

/library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/002.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/003.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/004.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/005.js

Activities

V. Monfort

2022-11-03 16:17

reporter   ~0018099

Last edited: 2022-11-18 16:49

Sorry about the previous note, this is not the expected patch. The expected one is this one.

editor: removed previous

patch (5,593 bytes)   
--- a./library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
+++ b./library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
@@ -41,9 +41,14 @@ function basicCreateMonitoredItemsMultipleNodes( nodes, mode, filter, queueLengt
     var PublishHelper; // this will become a Publish helper (further down)
     // create the required number of subscriptions
     for( s=0; s<subscriptionCount; s++ ) {
-        if( subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) subscriptions[s] = subscriptionObjectReference;
-        else subscriptions[s] = new Subscription( scanrates[s], true );
-        createSubscriptionsSuccess[s] = CreateSubscriptionHelper.Execute( { Subscription: subscriptions[s] } );
+        if( s == 0 && subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
+            subscriptions[s] = subscriptionObjectReference;
+            createSubscriptionsSuccess[s] = true;
+        }
+        else{
+            subscriptions[s] = new Subscription( scanrates[s], true );
+            createSubscriptionsSuccess[s] = CreateSubscriptionHelper.Execute( { Subscription: subscriptions[s] } );
+        }
 
         if( createSubscriptionsSuccess[s] ) {
             // define our Publish service call helper instance.
@@ -139,7 +144,7 @@ function basicCreateMonitoredItemsMultipleNodes( nodes, mode, filter, queueLengt
     // CLEAN UP
     // delete the subscriptions
     for( s=0; s<subscriptionCount; s++ ) {
-        if( subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
+        if( s == 0 && subscriptionObjectReference !== undefined && subscriptionObjectReference !== null ) {
             DeleteMonitoredItemsHelper.Execute( { ItemsToDelete: monitoredItems[s], SubscriptionId: subscriptionObjectReference } );
         }
         else {
@@ -156,5 +161,5 @@ function basicCreateMonitoredItemsTest( mode, filter, queueLength, timestamps, s
         addWarning( "Unable to get or convert the NodeId from the NumbericSettings into a Monitored Item. Aborting test." );
         return( false );
     }
-    basicCreateMonitoredItemsMultipleNodes( items, mode, filter, queueLength, timestamps, 1, subscriptionObjectReference );
-}
\ No newline at end of file
+    basicCreateMonitoredItemsMultipleNodes( items, mode, filter, queueLength, timestamps, 1, null, subscriptionObjectReference );
+}
--- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js	
+++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js	
@@ -11,8 +11,8 @@ function createMonitoredItems591003() {
     const       FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue ); // needs to reflect whatever "ON" means?????
     const       QUEUE  = 1;
     const       TIMES  = TimestampsToReturn.Server;
-    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
+    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
     return( true );
 }
--- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/002.js	
+++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/002.js	
@@ -13,8 +13,8 @@ function createMonitoredItems591006() {
     const       FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
     const       QUEUE  = 1;
     const       TIMES  = TimestampsToReturn.Server;
-    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
+    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
     return( true );
 }
--- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/003.js	
+++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/003.js	
@@ -13,8 +13,8 @@ function createMonitoredItems591007() {
     const       FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
     const       QUEUE  = 0;
     const       TIMES  = TimestampsToReturn.Server;
-    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES )
+    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription )
     return( true );
 }
--- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/004.js	
+++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/004.js	
@@ -13,8 +13,8 @@ function createMonitoredItems591010() {
     const       FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
     const       QUEUE  = 1;
     const       TIMES  = TimestampsToReturn.Server;
-    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
+    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
     return( true );
 }
--- a./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/005.js	
+++ b./maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/005.js	
@@ -13,8 +13,8 @@ function createMonitoredItems591011() {
     const       FILTER = Event.GetDataChangeFilter( DeadbandType.Absolute, 0, DataChangeTrigger.StatusValue );
     const       QUEUE  = 0;
     const       TIMES  = TimestampsToReturn.Server;
-    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES );
+    basicCreateMonitoredItemsTest( MODE, FILTER, QUEUE, TIMES, MonitorBasicSubscription );
     return( true );
 }
patch (5,593 bytes)   

Yannik Klaass

2023-07-03 09:36

developer   ~0019688

Fixed code to make basicCreateMonitoredItemsMultipleNodes() use the passed subscription as the first one.
Furthermore extended the test cases 001-005 in 'Monitored Items Deadband Filter' to make use of the subscription created in the initialize as well, to make sure only one subscription at a time is created in the server if only one is neccessary.

Yannik Klaass

2023-07-21 10:12

developer   ~0019696

Adding affected files

Paul Hunkar

2023-07-21 16:32

administrator   ~0019709

reviewed changes in call, agreed and closed issue

Issue History

Date Modified Username Field Change
2022-11-03 15:59 V. Monfort New Issue
2022-11-03 15:59 V. Monfort File Added: patchs
2022-11-03 16:17 V. Monfort Note Added: 0018099
2022-11-03 16:17 V. Monfort File Added: patch
2022-11-18 16:49 Paul Hunkar File Deleted: patchs
2022-11-18 16:49 Paul Hunkar Note Edited: 0018099
2022-11-18 16:51 Paul Hunkar Assigned To => Yannik Klaass
2022-11-18 16:51 Paul Hunkar Status new => assigned
2023-07-03 09:36 Yannik Klaass Status assigned => resolved
2023-07-03 09:36 Yannik Klaass Resolution open => fixed
2023-07-03 09:36 Yannik Klaass Note Added: 0019688
2023-07-21 10:09 Yannik Klaass Status resolved => feedback
2023-07-21 10:09 Yannik Klaass Resolution fixed => reopened
2023-07-21 10:12 Yannik Klaass Files Affected => /library/ServiceBased/MonitoredItemServiceSet/CreateMonitoredItems/basicCreateMonitoredItemsTest.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test Cases/001.js
/maintree/Monitored Item Services/Monitor Items Deadband Filter/Test...
2023-07-21 10:12 Yannik Klaass Note Added: 0019696
2023-07-21 10:13 Yannik Klaass Status feedback => resolved
2023-07-21 10:13 Yannik Klaass Resolution reopened => fixed
2023-07-21 16:31 Paul Hunkar Project Compliance Test Tool (CTT) Unified Architecture => CTT UA Scripts
2023-07-21 16:32 Paul Hunkar Status resolved => closed
2023-07-21 16:32 Paul Hunkar Fixed in Version => 1.03.503
2023-07-21 16:32 Paul Hunkar Note Added: 0019709