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.

× If you are developing in .NET, but are using the OPC-UA (OPC Unified Architecture), please post in the QuickOPC-UA category instead.

Read items from OPC DA server takes extremly long

More
05 Dec 2023 10:36 #12446 by mut9bu
Hello

I have done the 1)browsing servers, 2)browsing nodes, and 3)reading items for testing with OPC (DA) Expert Client on the same machine and same server (PC)
1) Browsing servers takes 1-2 seconds (same like our case)
2) Browsing nodes takes 30 seconds (same like our case)
3) But when I choose one or several of the browsed items and drag and drop them to the item field in the middle, the item values are read immediatly.(There is no waiting)

It seams like there is done again a node browsing when reading item values. Of course this is just my feeling, because the time that elapses when reading items, is nearly just the same when browsing nodes.

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

More
04 Dec 2023 19:05 #12444 by support
Hello.

Normally this should work much faster. "Initial" delays are sometimes caused by the fact the QuickOPC handles connections/reconnection automatically, so it may disconnect, and then re-connection adds some time. But in your case the Read follows the browsing, so it should not be the case either.

I tend to think that is purely a server issue. If needed, we may try to put OPC Analyzer in the middle and collect he traces together with associated timing (although there are setup/security issues which can make it painful over the network). So I would rather start with a different angle to it: Have you tried something similar with a different OPC client (from the same client machine to the same server machine), and if so, what were the results?

Note: BrowseServers is handled quite differently from the other calls (and does not go to the actual server). And in your case it works much faster.

Best regards

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

More
04 Dec 2023 15:36 - 04 Dec 2023 18:55 #12442 by mut9bu
Hello

In my net framework 4.7.2 project with OPCLabs V5.71 I can browse servers, browse nodes and also read items of remote OPC DA servers. Browsing servers is done relative quickly (1-2 seconds). But the problem is, that browsing nodes and reading items takes extremly long. With the code below, browsing nodes takes more then 30 seconds, reading items takes more then 40 seconds. For testing I have tried directly reading items without browsing servers and nodes (because I know server name and node name I have written these directly in the item definition). But the result was the same: I got the item values after more then 40 seconds.

I can definitly say that there is no network speed problem, and it should be also not machine specific problem because I have tried on many different machines.
But when OPC items are read cyclic, there is no problem in reading for example 1 second cycle. What takes so long during the first connection or initialising?
Its like, all the tags are browsed, even if I read directly items (without browsing servers and nodes

Is there a way to shorten this time? Or is this waiting while first connection unavoidable?
internal class Program
    {
 
        static void Main(string[] args)
        {
 
            Program program = new Program();
 
            ComManagement.Instance.Configuration.InstantiationParameters.OverrideDefaultSecurity = false;
            ComManagement.Instance.Configuration.SecurityParameters.UseCustomSecurity = true;
            ComManagement.Instance.Configuration.SecurityParameters.TurnOffCallSecurity = true;
            program.Browse_Servers(); // takes 1-2 seconds
            program.Browse_nodes(); // takes more then 30 seconds
            program.Read_single_item(); // takes more then 40 seconds
        }
 
        public void Browse_Servers()
        {
            var client = new EasyDAClient();
            ServerElementCollection serverElements;
            try
            {
                Console.WriteLine("Browsing servers");
                serverElements = client.BrowseServers("10.92.120.174");
            }
            catch (OpcException opcException)
            {
                //fault handling
            }
 
            foreach (ServerElement serverElement in serverElements)
            {
                Console.WriteLine($"ServerElements(\"{serverElement.ClsidString}\").ProgId: {serverElement.ProgId}");
            }            
        }
 
        void Browse_nodes()
        {    
            Console.WriteLine("Browsing nodes");
            var client = new EasyDAClient();
            DANodeElementCollection branchElements;
            try
            {
                branchElements = client.BrowseBranches("10.92.120.174", "OPC.IwSCP.1", "");
                Console.WriteLine(branchElements);
            }
            catch (OpcException opcException)
            {
                //fault handling
                return;
            }
 
            foreach (DANodeElement branchElement in branchElements)
            {
                Console.WriteLine($"BranchElements(\"{branchElement.Name}\").HasChildren: {branchElement.HasChildren}");              
            }          
 
        }
 
        void Read_single_item()
        {
            Console.WriteLine("Read items");       
            var client = new EasyDAClient();          
            DAVtqResult[] vtqResults = client.ReadMultipleItems("opcda://" + "10.92.120.174" + "/OPC.IwSCP.1", new DAItemDescriptor[]
               {                
                //System Info
                "!BSTR,"+OPC_device_name+",System.HardwareDescription",
                "!BSTR,"+OPC_device_name+",Plc.FirmwareVersion",
                "!BSTR,"+OPC_device_name+",Firmware.DeviceFirmware{0,0}",                 
 
               });
 
            for (int i = 0; i < vtqResults.Length; i++)
            {
                Debug.Assert(vtqResults[i] != null);
 
                if (vtqResults[i].Succeeded)
                {
                    Console.WriteLine("vtqResults[{0}].Vtq: {1}", i, vtqResults[i].Vtq);
                }
 
                else
                {
                    //fault handling
                }
            }
            Console.ReadLine();
        }
    }
Last edit: 04 Dec 2023 18:55 by support.

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

Moderators: support
Time to create page: 0.048 seconds