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.

UAClientEngineException

More
06 May 2014 11:55 - 06 May 2014 11:55 #1926 by support
Replied by support on topic UAClientEngineException
This may be a correct behavior, or a problem in the component - it depends on the circumstances. In general, your code should catch the UAException-s and handle them. They can occur for various reasons and can never be fully prevented - for example, when the server is down, or the network connection is broken, our methods will throw the UAException (or, return the exception in the results - depends on the particular method).

Has there been something that could cause it? (restarting the server etc.)? In such situations, getting (various kinds of) UAException is normal. In this particular case, the inner exception is somewhat unusual, so I would be interested in hearing what precisely you were doing.

Also, there have been changes and improvements in this area in Version 5.30. I strongly recommend to use this version unless for some reason you cannot use .NET Framework 4.5+.

One last comment (unrelated to this problem): We recommend to use namespace URIs ("nsu=...") instead of namespace indices ("ns=..."). The reason for it is that a generic OPC-UA server is allowed to change the namespace indices for its namespaces during the sessions, while the namespace URIs should stay constantly valid.

In order to make the information easily accessible, I am placing a copy of your picture and code to this post - below.



 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
 
using OpcLabs.EasyOpc.UA;
using OpcLabs.EasyOpc.UA.Reactive;
 
namespace Opc_Test3
{
    class Program
    {
        static void Main(string[] args)
        {
            TextWriter tw = new StreamWriter("data.txt");
 
            int i = 0;
            EasyUAClient euac1 = new EasyUAClient();
 
            OpcLabs.EasyOpc.UA.UAAttributeData tabela1;
            OpcLabs.EasyOpc.UA.UAAttributeData tabela2;
            OpcLabs.EasyOpc.UA.UAAttributeData tabela3;
            OpcLabs.EasyOpc.UA.UAAttributeData tabela4;
            OpcLabs.EasyOpc.UA.UAAttributeData tabela5;
 
            Console.WriteLine("Laczenie z serwerem OPC");
 
            tabela1 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB1");
            tabela2 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB2");
            tabela3 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB3");
            tabela4 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB4");
            tabela5 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB5");
 
            Console.WriteLine("Polaczenie: OK");
            Console.WriteLine("Nacisnij ENTER by pobraæ dane");
 
            if (Console.ReadKey(true).Key == ConsoleKey.Enter)
            {
                Console.WriteLine("POBIERA DANE...");
                Console.WriteLine("Nacisnij dowolny klawisz by zakoñczyæ pobieranie danych");
                //while (Console.ReadKey(true).Key != ConsoleKey.Spacebar)
                while(!Console.KeyAvailable)
                {
                    tabela1 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB1");
                    tabela2 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB2");
                    tabela3 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB3");
                    tabela4 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB4");
                    tabela5 = euac1.Read("opc.tcp://127.0.0.1:4840", "ns=4;s=MAIN.TAB5");
 
                    Int32[] tab1Vls = (Int32[])tabela1.Value;
                    Int32[] tab2Vls = (Int32[])tabela2.Value;
                    Int32[] tab3Vls = (Int32[])tabela3.Value;
                    Int32[] tab4Vls = (Int32[])tabela4.Value;
                    Int32[] tab5Vls = (Int32[])tabela5.Value;
 
 
                    for (i = 0; i < 1000; i++)
                    {
                        tw.WriteLine(string.Format("{0} {1} {2} {3} {4}", tab1Vls[i], tab2Vls[i], tab3Vls[i], tab4Vls[i], tab5Vls[i]));
                    }
                }
                tw.Close();
                Console.WriteLine("Zakonczono");
            }
        }
    }
}
Attachments:
Last edit: 06 May 2014 11:55 by support.

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

More
05 May 2014 14:55 #1919 by lconrad
I've been using your EasyOPC library (OPC Data.NET - QuickOPC 5.23 free version) to run a simple OPC UA application. Program saves data from 5 tables (1000 lines each) to a text file in 5 columns using 'for' loop. The tables are kind of buffers that contain values before saving and are changing each 1sec. Program ran smoothly until I've unexpectedly got a exception message (picture attached) that aborted the program flow. I dont really know what is going wrong. Its rather not related to data received from PLC program, because those are test data and only values in 1st column (index) change. Besides picture, I have attached a program code in a text file.

File Attachment:

File Name: Desktop.zip
File Size:53 KB
Attachments:

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

Moderators: support
Time to create page: 0.047 seconds