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.

UA simple connection error

More
22 Oct 2019 15:26 #7852 by support
Replied by support on topic UA simple connection error
Hello,
for separate issues, please use a new forum thread next time (you can always link to other threads if needed).

Ad 1: Both hostname or IP address are possible. It depends on the environment - obviously there must be a way to resolve the host names for them to work. Also, the OPC UA connection sequence goes in multiple steps, and the server returns its actual endpoints to the client after the first contact is made, so in fact there is also a relation to how the server is configured. The host name doe snot imply port, so the port usually needs to be specified in both cases.

Ad 2: If your application is designed to connect and work with any OPC server and not just a specific one, you need to make no assumption about NodeIDs. Their namespaces and identifiers can be just anything: the server decides about its Node IDs. I do not know what is the "channel ID" you are referring to.

Regards

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

More
22 Oct 2019 15:00 #7851 by janderscu
Beautiful, it worked! I am understanding the node ID characteristics better now... yes, entering the string as you have it above worked.

Couple of other questions ... so we are providing a config file with our software to set up host IP address, server name, channel names, etc... I want to provide as much flexibility in the config file as possible.
1. For endpoint descriptor, do you have to worry about specifying server name in any circumstances, or is it all about IP address and port?
2. For node descriptor, it seems like the variables that could change are name space, data type for channel ID, and the channel ID itself .. .anything else that should be provided as input?

In this particular test system I'm using now, that is the only information available, but I dont know what may be used down the road.

Thanks for the info.

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

More
22 Oct 2019 14:23 #7850 by support
Replied by support on topic UA simple connection error
The connection is OK. The error is not related to the connection, it is related to the Read-ing of the node.

The syntax you have used looks like what UAExpert uses.
This needs to be specified specified differently in QuickOPC (and many other tools). See
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...tml#OPC%20UA%20Node%20IDs.html
- opclabs.doc-that.com/files/onlinedocs/QuickOpc/Latest/User%2...indices%20in%20Node%20Ids.html

Most likely, "NS2|String|TEMS_OPC_Speed1" would be "ns=2;s=TEMS_OPC_Speed1".

Best regards

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

More
22 Oct 2019 13:57 - 22 Oct 2019 14:17 #7849 by janderscu
I'm having an issue with a simple connection to UA server and reading multiple items... I have verified the data is being pushed from the server using another third party client. With my setup, I know the specific IP = 10.10.29.215 and server name is MECHLAB1… and I know the specific channel names (don’t need to browse)… for instance, “NIS2|String|TEMS_OPC_Speed1”, “NIS2|String|TEMS_OPC_Speed2”, etc..

I took a basic example from the QuickOPC package and modified, but getting a connect error:

*** Failure: Status is not good: BadNodeIdUnknown.

Thanks for any help!

static void GetData_UA()
        {
 
                string hostname = "10.10.29.215";
                string servername = "MECHLAB1";
            UAEndpointDescriptor endpointDescriptor = "";
            endpointDescriptor.Host = hostname.Trim();
            endpointDescriptor.Port = 4840;
 
            // Instantiate the client object
            var client = new EasyUAClient();
 
                // Obtain values. By default, the Value attributes of the nodes will be read.
                ValueResult[] valueResultArray = client.ReadMultipleValues(new[]
                    {
                        new UAReadArguments(endpointDescriptor, "NS2|String|TEMS_OPC_Speed1"),
                        //new UAReadArguments(endpointDescriptor, "NS2|String|TEMS_OPC_Speed2"),
                        //new UAReadArguments(endpointDescriptor, "NS2|String|TEMS_OPC_Speed3")
                    });
 
            Console.WriteLine("here");
            // Display results
            foreach (ValueResult valueResult in valueResultArray)
                {
                    if (valueResult.Succeeded)
                        Console.WriteLine("Value: {0}", valueResult.Value);
                    else
                        Console.WriteLine("*** Failure: {0}", valueResult.ErrorMessageBrief);
                }
 
    }
Last edit: 22 Oct 2019 14:17 by support.

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

Moderators: support
Time to create page: 0.048 seconds