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-Classic in .NET
- Connections, Reconnections, COM/DCOM
- OPC client not connecting the correct port, possible TCP port problem.
OPC client not connecting the correct port, possible TCP port problem.
It looks like that that H1002496-01 resolves to IPv6 localhost address [::1], but the server only uses an IPv4 socket on 127.0.0.1. It's not truly listening on [::1]:4880.
Netstat should show the listening ports accordingly. For example, for one of processes on my machine, I have both
TCP 127.0.0.1:8307 0.0.0.0:0 LISTENING 7368
TCP [::1]:8307 [::]:0 LISTENING 7368
Best regards
Please Log in or Create an account to join the conversation.
I'm using QuickOPC 2018.2
Please Log in or Create an account to join the conversation.
Going back to the original issue, are you connecting to local or remote computer? What's, during your text, in the PCNameTextBox.Text ?
And, you have not answered my question about which QuickOPC version you are using.
Thank you
Please Log in or Create an account to join the conversation.
I tried testing my client code a bit and found something interesting. When subscribing to a node we first test with an EasyUAClient.Read operation and then subscribe, which looks like this:
private int Subscribe(UANodeDescriptor NodeDescriptor, int samplingRate, EasyUADataChangeNotificationEventHandler callBack = null)
{
//NOTE: This is the OPC server address on the CM100
UAEndpointDescriptor endpointDescriptor = "opc.tcp://" + PCNameTextBox.Text + ":4880/CM100 OpcUa";
//Test if the endpoint and node are real and point to a value
// If it's not real the .Read() will throw a UAException
// This will be caught in subscribeAll()
//DEV NOTE: I don't like this test method but it works for now
CM100Client.Read(endpointDescriptor, NodeDescriptor);
//It's a real subscribtion so we can subscribe
return CM100Client.SubscribeDataChange(endpointDescriptor, NodeDescriptor, samplingRate, callBack);
}
If I comment out the read operation, I will get a different error at runtime:
System.NullReferenceException was unhandled by user code
HResult=-2147467261
Message=Object reference not set to an instance of an object.
Source=DataViewUI
StackTrace:
at DataViewUI.Views.DemoLiveDataUserControl.OnAPPNChanged(UAAttributeData attributedata) in D:\CombinedUI\DataViewUI\Views\Live Data\DemoLiveDataUserControl.xaml.cs:line 453
at DataViewUI.Views.DemoLiveDataUserControl.<SubscribeALL>b__57_0(Object sender, EasyUADataChangeNotificationEventArgs Eventargs) in D:\CombinedUI\DataViewUI\Views\Live Data\DemoLiveDataUserControl.xaml.cs:line 349
at OpcLabs.BaseLib.Widgets.NotifyingWidget.<>c__DisplayClass44_0`1.<Callback>b__0()
at OpcLabs.BaseLib.Widgets.NotifyingWidget.SafeCallback(String name, Action action)
InnerException:
Thank you for your continued help.
Please Log in or Create an account to join the conversation.
If the server is misconfigures, it may return an endpoint that does not work. It seems that in your case, the server returns an endpoint which contains port 4840 - but that port doesn't really work in the end.
The primary way of resolving this would be to look at the server and fix the misconfiguration.
We have a settings (EnforceSameSite, EnforceSamePort in the UAEndpointSelectionPolicy) that would cause QuickOPC to ignore parts of the endpoint URL returned from the server (which is probably what UAExpert does by default). Recent QuickOPC version also have these settings turned on by default. Which version of QuickOPC are you using?
Also note that if the server is not on the same computer as the client, the actual reason might be in the host name returned by the server, and not the port. In the error message, the host part is [::1] - but if the server is remote, it should return the IP address or name by which the clients can actually find it.
Regards
Please Log in or Create an account to join the conversation.
I am having some trouble with my OPC client code. This OPC client recursively finds all the data nodes on a server and outputs them to a .txt file, for some background.
Recently my client stopped connecting to the OPC server and I believe it may be a problem with the TCP port setup. The connection string is: "opc.tcp://[Computer Name]:4880/CM100 OpcUa" which usually works, and I have confirmed this same string works when using UA expert. When I try to connect I get the error shown in the attached image.
I believe that my client is trying to communicate on 4840, while the server is listening on 4880. Am I correct?
If so what can I use the configure the TCP port that the client communicates on?
If not, what would I be doing wrong?
I've also tested the rest of my code using the public OPC server: "opc.tcp://opcua.demo-this.com:51210/UA/SampleServer"
Please Log in or Create an account to join the conversation.
- Forum
- Discussions
- QuickOPC-Classic in .NET
- Connections, Reconnections, COM/DCOM
- OPC client not connecting the correct port, possible TCP port problem.