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.
- Forum
- Discussions
- QuickOPC-UA in COM
- Discovery, Browsing, Browse Dialogs and Controls
- Node is not selectable
Node is not selectable
This works well for me with QuickOPC 2021.3, and the VBScript example that you will find in the installed product under:
ExamplesCOM\VBScript\WSH\UADocExamples\UserInterface\_UABrowseDialog\ShowDialog.SelectionDescriptors.vbs
Can you please test this VBScript example on your computer and let me know the results?
Thank you
Please Log in or Create an account to join the conversation.
Is it working on your side with two hosts?
I run your exemple (the c# translated in Delphi)
When browser is displayed first time:
I select a node on ""opc.tcp://opcua.demo-this.com:51210/UA/SampleServer""
and its okay. on next loop i see the host again.
But if I select a node on ""opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"" and add a new host 'opc.tcp://localhost:49320' and select a node on it when i go out of browser i got two entries in selectionDescriptors and it's okay. So the next loop i should see the two hosts but only one is displayed.
Can you try and let me know if you face same issue?
May I have missed my upgrade?
Regards
Please Log in or Create an account to join the conversation.
Sorry, I should have informed you right away.
Best regards
Please Log in or Create an account to join the conversation.
Is it in Internal version number: 5.62 just created?
Please Log in or Create an account to join the conversation.
Thank for your suggestions.
Will wait new release a check.
Regards
Please Log in or Create an account to join the conversation.
As it turns out, the issues I have encountered while preparing the example were probably the same that lead to your original post. And, we determined that there is a problem in all QuickOPC versions up to 2021.2 that, making long story short, prevents the SelectionDescriptors from being usable for inputs to the dialog.
We will fix it in the upcoming version 2021.3 - it is expected to be released this month (November 2021).
With the fix, the basic example close to what you are trying to achieve looks like this (in VBScript and in C#):
Rem This example shows how the current node and selected nodes can be persisted between dialog invocations.
Option Explicit
Const DialogResult_OK = 1
' The variables that persist the current and selected nodes.
Dim CurrentNodeDescriptor: Set CurrentNodeDescriptor = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptor")
Dim SelectionDescriptors: Set SelectionDescriptors = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptorCollection")
' The initial current node (optional).
CurrentNodeDescriptor.EndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
' Repeatedly show the dialog until the user cancels it.
Do
Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog")
BrowseDialog.Mode.MultiSelect = True
' Set the dialog inputs from the persistence variables.
Set BrowseDialog.InputsOutputs.CurrentNodeDescriptor = CurrentNodeDescriptor
BrowseDialog.InputsOutputs.SelectionDescriptors.Clear
Dim BrowseNodeDescriptor: For Each BrowseNodeDescriptor In SelectionDescriptors
BrowseDialog.InputsOutputs.SelectionDescriptors.Add BrowseNodeDescriptor
Next
Dim dialogResult1: dialogResult1 = BrowseDialog.ShowDialog
If dialogResult1 <> DialogResult_OK Then
Exit Do
End If
' Update the persistence variables with the dialog output.
Set CurrentNodeDescriptor = BrowseDialog.InputsOutputs.CurrentNodeDescriptor
selectionDescriptors.Clear
For Each BrowseNodeDescriptor In BrowseDialog.InputsOutputs.SelectionDescriptors
SelectionDescriptors.Add BrowseNodeDescriptor
Next
Loop While True
// This example shows how the current node and selected nodes can be persisted between dialog invocations.
using System.Windows.Forms;
using OpcLabs.EasyOpc.UA.Forms.Browsing;
namespace UAFormsDocExamples._UABrowseDialog
{
static partial class ShowDialog
{
public static void SelectionDescriptors(IWin32Window owner)
{
// The variables that persist the current and selected nodes.
var currentNodeDescriptor = new UABrowseNodeDescriptor();
var selectionDescriptors = new UABrowseNodeDescriptorCollection();
// The initial current node (optional).
currentNodeDescriptor.EndpointDescriptor = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer";
// Repeatedly show the dialog until the user cancels it.
do
{
var browseDialog = new UABrowseDialog();
browseDialog.Mode.MultiSelect = true;
// Set the dialog inputs from the persistence variables.
browseDialog.InputsOutputs.CurrentNodeDescriptor = currentNodeDescriptor;
browseDialog.InputsOutputs.SelectionDescriptors.Clear();
foreach (UABrowseNodeDescriptor browseNodeDescriptor in selectionDescriptors)
browseDialog.InputsOutputs.SelectionDescriptors.Add(browseNodeDescriptor);
DialogResult dialogResult = browseDialog.ShowDialog(owner);
if (dialogResult != DialogResult.OK)
break;
// Update the persistence variables with the dialog output.
currentNodeDescriptor = browseDialog.InputsOutputs.CurrentNodeDescriptor;
selectionDescriptors.Clear();
foreach (UABrowseNodeDescriptor browseNodeDescriptor in browseDialog.InputsOutputs.SelectionDescriptors)
selectionDescriptors.Add(browseNodeDescriptor);
} while (true);
}
}
}
Best regards
Please Log in or Create an account to join the conversation.
status update:
I was preparing an example for you, but encountered some problems. I am now working with the programmer who developed the browse dialog to figure out where it comes from.
Best regards
Please Log in or Create an account to join the conversation.
I will review your code and possibly provide another example for that. But, please bear with me, I am on OPC Interoperability workshop this week, and that keeps me busy. It may take some days before I have it ready for you.
Regards
Please Log in or Create an account to join the conversation.
Thank for your suggestions:
Actually our goal is to use multi-selected. We would like that, when the UA brother is displayed, all the nodes are displayed in order the user is not obliged to add it every time .
Also the next step will be to retrieve the node added by the user when he closes the browser. But let focus first on display all node . I create a simple example with two nodes, Its Delphi but you should recognize the objects I use .
If I add an initial node descriptor as suggested only this one is displayed.
Here after the code associated to the click on a button that start UABrowser node.
procedure TForm1.StartUaBrowserClick(Sender: TObject);
var
MyUABrowseNodeDescriptor: UABrowseNodeDescriptor;
BrowseDialog: TUABrowseDialog;
begin
BrowseDialog := TUABrowseDialog.Create(nil);
BrowseDialog.Mode.MultiSelect := true;
try
// add two nodes descriptor.
// Node 1
MyUABrowseNodeDescriptor := CoUABrowseNodeDescriptor.Create;
MyUABrowseNodeDescriptor.EndpointDescriptor.UrlString := 'opc.tcp://localhost:49320';
MyUABrowseNodeDescriptor.EndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName := 'sss';
MyUABrowseNodeDescriptor.EndpointDescriptor.UserIdentity.UserNameTokenInfo.Password := 'ssss';
BrowseDialog.InputsOutputs.SelectionDescriptors.Add(MyUABrowseNodeDescriptor);
// Node 2
MyUABrowseNodeDescriptor := CoUABrowseNodeDescriptor.Create;
MyUABrowseNodeDescriptor.EndpointDescriptor.UrlString := 'opc.tcp://opcua.demo-this.com:51210/UA/SampleServer';
MyUABrowseNodeDescriptor.EndpointDescriptor.UserIdentity.UserNameTokenInfo.UserName := 'Hello';
MyUABrowseNodeDescriptor.EndpointDescriptor.UserIdentity.UserNameTokenInfo.Password := 'psw';
BrowseDialog.InputsOutputs.SelectionDescriptors.Add(MyUABrowseNodeDescriptor);
Codesite.send(BrowseDialog.InputsOutputs.SelectionDescriptors.Count.ToString);
// selcet on initial node descriptor
BrowseDialog.InputsOutputs.CurrentNodeDescriptor := BrowseDialog.InputsOutputs.SelectionDescriptors[0];
BrowseDialog.ShowDialog(nil);
Codesite.send(BrowseDialog.InputsOutputs.SelectionDescriptors.Count.ToString);
finally
BrowseDialog.Free;
end;
end;
Please Log in or Create an account to join the conversation.
Unless you use multi-select, the SelectionDescriptors are just a complication. And, your code does not set the initial node descriptor. Does the example below (sorry, in VBScript only) help?
Rem This example shows use the output data (node) from one dialog invocation as input data in a subsequent dialog
Rem invocation.
Option Explicit
Const DialogResult_OK = 1
' Define the starting node for the first dialog.
Dim BrowseNodeDescriptor0: Set BrowseNodeDescriptor0 = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseNodeDescriptor")
BrowseNodeDescriptor0.EndpointDescriptor.UrlString = "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
'BrowseNodeDescriptor0.NodeDescriptor.NodeId.StandardName = "Objects"
' Set the starting node of the first dialog, show the first dialog, and let the user select a first node.
Dim BrowseDialog1: Set BrowseDialog1 = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog")
Set BrowseDialog1.InputsOutputs.CurrentNodeDescriptor = BrowseNodeDescriptor0
Dim dialogResult1: dialogResult1 = BrowseDialog1.ShowDialog
If dialogResult1 <> DialogResult_OK Then
WScript.Quit
End If
Dim BrowseNodeDescriptor1: Set BrowseNodeDescriptor1 = BrowseDialog1.InputsOutputs.CurrentNodeDescriptor
' Display the first node chosen.
WScript.Echo
WScript.Echo BrowseNodeDescriptor1.NodeDescriptor.NodeId
WScript.Echo BrowseNodeDescriptor1.NodeDescriptor.BrowsePath
' Set the starting node of the second dialog to be the node chosen by the user before, show the second dialog, and let the
' use select a second node.
Dim BrowseDialog2: Set BrowseDialog2 = CreateObject("OpcLabs.EasyOpc.UA.Forms.Browsing.UABrowseDialog")
Set BrowseDialog2.InputsOutputs.CurrentNodeDescriptor = BrowseNodeDescriptor1
Dim dialogResult2: dialogResult2 = BrowseDialog2.ShowDialog
If dialogResult2 <> DialogResult_OK Then
WScript.Quit
End If
Dim BrowseNodeDescriptor2: Set BrowseNodeDescriptor2 = BrowseDialog2.InputsOutputs.CurrentNodeDescriptor
' Display the second node chosen.
WScript.Echo
WScript.Echo BrowseNodeDescriptor2.NodeDescriptor.NodeId
WScript.Echo BrowseNodeDescriptor2.NodeDescriptor.BrowsePath
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-UA in COM
- Discovery, Browsing, Browse Dialogs and Controls
- Node is not selectable