Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Groups

More
08 Oct 2018 15:09 - 08 Oct 2018 15:10 #6732 by corzilius
Replied by corzilius on topic Groups
Hello,

thank you for fixing it. With the new library the read-times are 3 to 10 times faster and only one group gets created. :cheer:

Best regards
Last edit: 08 Oct 2018 15:10 by corzilius.

Please Log in or Create an account to join the conversation.

More
05 Oct 2018 15:54 #6731 by support
Replied by support on topic Groups
Hello,

I was able to reproduce the problem. It depended on the server, that's why I could not reproduce it earlier. Thank you for reporting it.

We have fixed the issue. Please download and install the current version available, and rebuild your project with it. The version/build number should be 5.53.405.1 or higher.

Best regards
The following user(s) said Thank You: corzilius

Please Log in or Create an account to join the conversation.

More
05 Oct 2018 08:26 #6730 by corzilius
Replied by corzilius on topic Groups
Hello,

these settings did have no effect on the number of created groups.
The OPC Factory Server still shows 77 Groups for 77 Active Items, both on ReadMultipleItems (second example) and on subscribing and waiting for changes (SubscribeMultipleItems, first example).
The only difference between read and subscribe and wait for changes was the number of active groups. On reads it was 0 - but it still created 77 groups - and on subscribe and wait for changes it was 77 active groups.

Best regards

Please Log in or Create an account to join the conversation.

More
02 Oct 2018 17:31 #6729 by support
Replied by support on topic Groups
Please first do the settings described here: www.opclabs.com/forum/reading-writing-subscriptions-property...scriptions-made-with-opc-reads .

If you do Reads, QuickOPC creates groups for them as well, and then dynamically changes their parameters (or deleted/creates new ones) based on the frequency of the reads - or the anticipation thereof. This may be the cause.

Best regards

Please Log in or Create an account to join the conversation.

More
02 Oct 2018 13:16 #6728 by corzilius
Replied by corzilius on topic Groups
Hello,

I can reproduce this every time. The Code for subscribed reads is:
namespace OpcAbonniertesLesen
{
    using JetBrains.Annotations;
    using OpcLabs.EasyOpc.DataAccess;
    using OpcLabs.EasyOpc.DataAccess.OperationModel;
    using System;
    using System.Threading;
 
    internal class Program
    {
        private Program()
        {
            this.ItemNames = new[] {
                "a",
                "couple",
                "of",
                "items",
                "which",
                "exist",
                "on",
                "the",
                "production",
                "server"
            };
        }
 
        private static readonly Program instance = new Program();
 
        private static void Main(string[] args)
        {
            instance.DoWork();
        }
 
        private void DoWork()
        {
            this.easyDAClient.ItemChanged += this.EasyDAClient_ItemChanged;
 
            Console.WriteLine("Preparing arguments...");
 
            var argumentArray = new DAItemGroupArguments[this.TotalItems];
            for (var i = 0; i < this.TotalItems; i++)
            {
                argumentArray[i] = new DAItemGroupArguments("localhost", "Schneider-Aut.OFS.2", this.ItemNames[i], 50, null);
            }
 
            Console.WriteLine("Subscribing to {0} items...", this.TotalItems);
            this.easyDAClient.SubscribeMultipleItems(argumentArray);
 
            Console.WriteLine("Processing item changed events for 1 minute...");
            Thread.Sleep(60 * 1000);
 
            Console.WriteLine("Done...");
        }
 
        private void EasyDAClient_ItemChanged([NotNull] object sender, [NotNull] EasyDAItemChangedEventArgs e)
        {
            Console.WriteLine("{0}: {1}", e.Arguments.ItemDescriptor.ItemId, e.Vtq);
        }
 
        private int TotalItems { get => this.ItemNames == null ? 0 : this.ItemNames.Length; }
 
        private readonly string[] ItemNames;
 
        private readonly EasyDAClient easyDAClient = new EasyDAClient();
    }
}



The code for "grouped" reads is:
namespace OpcGruppenlesen
{
	using System;
	using System.Diagnostics;
	using System.Threading;
	using OpcLabs.EasyOpc.DataAccess;
	using OpcLabs.EasyOpc.DataAccess.OperationModel;
 
	internal class Program
	{
		private Program()
		{
			this.ItemNames = new[] {
				"a",
				"couple",
				"of",
				"items",
				"which",
				"exist",
				"on",
				"the",
				"production",
				"server"
			};
		}
 
		private static readonly Program instance = new Program();
 
		private static void Main( string[] args )
		{
			instance.TimeMeasurements();
			Console.ReadKey();
		}
 
		private const int NumberOfGroups = 7;
		private int ItemsInGroup { get => this.TotalItems / NumberOfGroups; }
		private int TotalItems { get => this.ItemNames == null ? 0 : this.ItemNames.Length; }
		private readonly string[] ItemNames;
 
		private void TimeMeasurements()
		{
			// Make the measurements 10 times; note that first time the times might be longer.
			for( var i = 1; i <= 10; i++ )
			{
				// Pause - we do not want the component to use the values it has in memory
				Thread.Sleep( 2 * 1000 );
 
				// Read all items at once, and measure the time
				var stopwatch1 = new Stopwatch();
				stopwatch1.Start();
				this.ReadAllAtOnce();
				stopwatch1.Stop();
				Console.WriteLine( "ReadAllAtOnce has taken (milliseconds): {0}", stopwatch1.ElapsedMilliseconds );
 
				// Pause - we do not want the component to use the values it has in memory
				Thread.Sleep( 2 * 1000 );
 
				// Read items in groups, and measure the time
				var stopwatch2 = new Stopwatch();
				stopwatch2.Start();
				this.ReadInGroups();
				stopwatch2.Stop();
				Console.WriteLine( "ReadInGroups has taken (milliseconds): {0}", stopwatch2.ElapsedMilliseconds );
			}
		}
		// Read all items at once
		private void ReadAllAtOnce()
		{
			var easyDAClient = new EasyDAClient();
 
			// Create an array of item descriptors for all items
			var itemDescriptors = new DAItemDescriptor[this.TotalItems];
			var index = 0;
			for( var iLoop = 0; iLoop < NumberOfGroups; iLoop++ )
				for( var iItem = 0; iItem < this.ItemsInGroup; iItem++ )
					itemDescriptors[index++] = new DAItemDescriptor( this.ItemNames[iLoop * this.ItemsInGroup + iItem] );
 
			// Perform the OPC read
			var vtqResults = easyDAClient.ReadMultipleItems("Schneider-Aut.OFS.2", itemDescriptors);
 
			// Count successful results
			var successCount = 0;
			for( var iItem = 0; iItem < this.TotalItems; iItem++ )
			{
				Debug.Assert( vtqResults[iItem] != null );
				if( vtqResults[iItem].Succeeded )
					successCount++;
			}
 
			if( successCount != this.TotalItems )
				Console.WriteLine( "Warning: There were some failures, success count is {0}", successCount );
		}
 
		// Read items in groups
		private void ReadInGroups()
		{
			var easyDAClient = new EasyDAClient();
 
			var successCount = 0;
			for( var iLoop = 0; iLoop < NumberOfGroups; iLoop++ )
			{
				// Create an array of item descriptors for items in one group
				var itemDescriptors = new DAItemDescriptor[this.ItemsInGroup];
				for( var iItem = 0; iItem < this.ItemsInGroup; iItem++ )
					itemDescriptors[iItem] = new DAItemDescriptor( this.ItemNames[iLoop * this.ItemsInGroup + iItem] );
 
				// Perform the OPC read
				var vtqResults = easyDAClient.ReadMultipleItems("Schneider-Aut.OFS.2", itemDescriptors);
 
				// Count successful results (totalling to previous value)
				for( var iItem = 0; iItem < this.ItemsInGroup; iItem++ )
				{
					Debug.Assert( vtqResults[iItem] != null );
					if( vtqResults[iItem].Succeeded ) successCount++;
				}
			}
 
			if( successCount != this.TotalItems )
				Console.WriteLine( "Warning: There were some failures, success count is {0}", successCount );
		}
	}
}

Attachments:

Please Log in or Create an account to join the conversation.

More
23 Sep 2018 13:54 #6706 by support
Replied by support on topic Groups
I tried to reproduce the problem, but in my tests, I get just one OPC group, if I subscribe with the same subscription parameters (mainly, the update rate and percent deadband).

Please post here the source code you are using (in its minimal form needed to reproduce the issue).

Also post here the relevant screenshot showing form your test run, showing the number of groups. I want to be sure that you are not misinterpreting it.

Best regards

Please Log in or Create an account to join the conversation.

More
21 Sep 2018 12:32 #6702 by support
Replied by support on topic Groups
Hello,

We will try to reproduce this. For subscriptions with the same parameters, only one group should be created, I agree. If it is not happening, it would be a bug and we will fix it.

Best regards

Please Log in or Create an account to join the conversation.

More
21 Sep 2018 09:45 #6701 by corzilius
Groups was created by corzilius
Hello,

we tried to reduce the number of created groups for tag subscription by following the example in the Forum entry 'Group name, deadband' by using SubscribeMultipleItems, but the EasyDAClient still creates one group per tag, so if I subscribe 170 tags at once I get 170 groups (visible in the status-window of the OPC-Server).

I made a quick test by modifying the example _EasyDAClient.ReadMultipleItems.TimeMeasurements from the QuickOpcCSharpExamples to read 170 tags with ReadMultipleItems from our OPC-Server to exclude, that our component does some settings which may influence this, but even with this I get one group per tag.

In the documentation of the OPC Factory Server (OFS) is written, that one should limit the number of groups for performance-reasons.

We are experiencing serious performance problems in another OPC-Server (the one integrated in Schneider Electric’s Vijeo Citect System), which is the reason, why we are now in the process of setting up a dedicated OPC-Server. The Citect-OPC-Server does not show the number of used groups, the OFS does this.

The Library used is QuickOpc-2016.2-Full, the version of the tested OPC Factory Servers are 3.60.3108.0 and 3.60.3112.0.

Is there another option which can be set in the EasyDAClient to tell it, that it should only use one group with all items when using ReadMultipleItems or SubscribeMultipleItems?

Thanks

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.066 seconds