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.

OPC UA DEMO

More
27 Jun 2023 16:17 #11851 by support
Replied by support on topic OPC UA DEMO
Also,
if you do not necessarily need to get the node IDs programmatically, and you just had a problem with the Demo app and the user authentication:

Use the Connectivity Explorer application instead. There, if you set the User Identity, it will work.

Best regards

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

More
27 Jun 2023 16:09 - 27 Jun 2023 16:10 #11850 by support
Replied by support on topic OPC UA DEMO
Here is a VBScript code to browse nodes:
Rem This example shows how to obtain nodes under a given node of the OPC-UA address space. 
Rem For each node, it displays its browse name and node ID.
 
Option Explicit
 
Dim EndpointDescriptor: Set EndpointDescriptor = CreateObject("OpcLabs.EasyOpc.UA.UAEndpointDescriptor")
EndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
 
Dim NodeDescriptor: Set NodeDescriptor = CreateObject("OpcLabs.EasyOpc.UA.UANodeDescriptor")
Dim BrowsePathParser: Set BrowsePathParser = CreateObject("OpcLabs.EasyOpc.UA.Navigation.Parsing.UABrowsePathParser")
BrowsePathParser.DefaultNamespaceUriString = "http://test.org/UA/Data/"
NodeDescriptor.BrowsePath = BrowsePathParser.Parse("[ObjectsFolder]/Data/Static/UserScalar")
 
Dim BrowseParameters: Set BrowseParameters = CreateObject("OpcLabs.EasyOpc.UA.UABrowseParameters")
BrowseParameters.StandardName = "AllForwardReferences"
 
' Instantiate the client object
Dim Client: Set Client = CreateObject("OpcLabs.EasyOpc.UA.EasyUAClient")
 
' Perform the operation
On Error Resume Next
Dim NodeElements: Set NodeElements = Client.Browse(EndpointDescriptor, NodeDescriptor, BrowseParameters)
If Err.Number <> 0 Then
    WScript.Echo "*** Failure: " & Err.Source & ": " & Err.Description
    WScript.Quit
End If
On Error Goto 0
 
' Display results
Dim NodeElement: For Each NodeElement In NodeElements
    WScript.Echo NodeElement.BrowseName & ": " & NodeElement.NodeId
Next

You do not need the stuff around UABrowsePath, since you appear to already have the starting node ID.

Best regards
Last edit: 27 Jun 2023 16:10 by support.

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

More
27 Jun 2023 16:04 #11849 by support
Replied by support on topic OPC UA DEMO
Hello,
here is a VBScript code snippet that does what you need; converting to Visual FoxPro should be straightforward:
Dim GdsEndpointDescriptor: Set GdsEndpointDescriptor = CreateObject("OpcLabs.EasyOpc.UA.UAEndpointDescriptor")
GdsEndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:58810/GlobalDiscoveryServer"
GdsEndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName = "appadmin"
GdsEndpointDescriptor.UserIdentity.UserNameTokenInfo.Password = "demo"

So, you just need to add two lines, where you would set
  • ReadArgumentsCK.EndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName
  • ReadArgumentsCK.EndpointDescriptor.UserIdentity.UserNameTokenInfo.Password
Best regards

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

More
27 Jun 2023 15:48 #11848 by info@software2000.it
Replied by info@software2000.it on topic OPC UA DEMO
I would need two simple lines in visualfoxpro to connect to an opcua server with username and password and get the list of NODEIDs to use with these subsequent commands of my app to read the values, as no mki documentation was provided by the customer.
Usually, to see the node ids, I used the opcua demo schedule, but since there is an authentication this time, I can't do it.
In the attachment you can see a code snippet that I usually use to assign "NodeDescriptor.NodeId.ExpandedText" but in this case I don't have this data and I would like to get it
You would be very kind, thank you.
Attachments:

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

More
27 Jun 2023 13:33 #11847 by support
Replied by support on topic OPC UA DEMO
Hello.

The demo application (source code is in the product) only takes the UrlString from the first dialog, not the full endpoint descriptor:

        private void discoverServersButton_Click(object sender, EventArgs e)
        {
            uaHostAndEndpointDialog1.EndpointDescriptor = serverUriTextBox.Text;
            if (uaHostAndEndpointDialog1.ShowDialog() == DialogResult.OK)
                serverUriTextBox.Text = uaHostAndEndpointDialog1.EndpointDescriptor.UrlString;
        }
It was not the intent to support the "full" thing in the demo.

If you were to use the same dialog in your application, and took uaHostAndEndpointDialog1.EndpointDescriptor and not just uaHostAndEndpointDialog1.EndpointDescriptor.UrlString and passed it to further calls, it should work well. You can also try to modify the demo app to support it.

Best regards

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

More
27 Jun 2023 12:32 #11844 by info@software2000.it
Replied by info@software2000.it on topic OPC UA DEMO
I am using the Demo application provided in the installation not my code.
See attachment
Attachments:

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

More
27 Jun 2023 09:54 #11842 by support
Replied by support on topic OPC UA DEMO
Hello,

can I see the pieces of code that take the result from the endpoint selection dialog, and pass it to the second dialog?
What I am looking for is whether you are passing just the endpoint URL, or the whole endpoint descriptor object.

Best regards

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

More
27 Jun 2023 09:45 #11841 by info@software2000.it
In the OPC UA DEMo application, if the server I want to connect to not support anonymous access, even if I set a User and Password in the discovery windows , manual adding the server URI, when I come back to the main window the user and password are not stored and the program tel me badaccess.
See the attachments
How to solve this issue?
Thanks
Attachments:

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

Moderators: support
Time to create page: 0.056 seconds