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
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.
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
Please Log in or Create an account to join the conversation.
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
Please Log in or Create an account to join the conversation.
- info@software2000.it
- Topic Author
- Offline
- Platinum Member
- Posts: 33
- Thank you received: 2
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.
Please Log in or Create an account to join the conversation.
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;
}
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.
- info@software2000.it
- Topic Author
- Offline
- Platinum Member
- Posts: 33
- Thank you received: 2
See attachment
Please Log in or Create an account to join the conversation.
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.
- info@software2000.it
- Topic Author
- Offline
- Platinum Member
- Posts: 33
- Thank you received: 2
See the attachments
How to solve this issue?
Thanks
Please Log in or Create an account to join the conversation.