Connection refused by PLC when connecting with Milo OPC Client - opc

I tried to clean up the ReadExample mini project for client repository from Milo OPC, and for endpoint i put the PLC ip address.
But there was no port in the plc configuration that i could configure.
When i do not specify a port, it says i cannot open a port to it.
If i specify a port, it says connection refused by the machine.
Is it possible to connect the client to the plc? or was i just hoping?
Also, i did remove the server part from the example, as stated in some other questions here about this subject.

Does the PLC have an embedded OPC UA server? Have you tried the default port 4840 yet?

Related

can two different OPC server share same port?

I am trying to connect robot controler CODESYS program with OPC Expert through OPC UA server and that's listening 4840 port and on OPC Expert I'm getting like opc.tcp://hp-nb:4840/uadiscovery. I also installed freeopcua in my machine and that's listening 4840 port as well and on OPC Expert it's like opc.tcp//0.0.0.0:4840. On OPC Expert I need to connect with CODESYS application. I can connect with CODESYS OPC server but I'm not able to connect my application from CODESYS controler. Is it happening because of two servers are listening on same port? if not then how can I resolve my issue? Attached an image of my issue enter image description here
Two programs or processes running on the same computer cannot listen on the same port.
It would be possible only if that computer had two network interface cards with two different IPs and you could choose through which interface each process connect, a thing that is not usually possible to do
UPDATE
CODESYS Soft PLC emulator, which is usually installed with CODESYS, also includes an OPC Server listening on port 4840, if you stop the Soft PLC right clicking the icon on the windows notification area probably it will close the listening port
In theory, two OPC UA servers could share the same port (on the same network interface) if they coordinate together. For opc.tcp, there is no standard way for them to do it. Therefore, two servers from the same vendor that are written in such special way could theoretically share the port. In reality, however, OPC UA servers using "opc.tcp" cannot share the same port, because they do not know how to coordinate the access and route the data.
For other protocols the situation is different. E.g. for OPC UA over HTTPS it is easier to have servers listening on the same port - mainly because the operating system already contains a piece that can listen on the port "for them", and route the requests based on the URL.
In your situation, however, it is not just that two server cannot share the same port. There is also a problem with the fact that one of the servers returns "0.0.0.0" as its IP address in the connection point description, which is invalid anyhow.

OPC UA Connection to IP Address (when hostname couldn't be resolved)

I'm trying to connect to OPC UA Server which is located over local intranet, though the OPC Server is exposing the Computer Name as a hostname when trying to connect through the given IP address and eventually error out as hostname can't be resolved.
While on the other side, Prosys OPC UA Client can successfully connect to it. I'm currently using Eclipse Milo, but would like to understand how other clients connect to IP Address rather than the hostname while I couldn't?
Asked and answered here: Java OPC-UA Client Eclipse Milo endpoint URL changes to localhost
Instead of using the sample code in that post there is now a helper method in EndpointUtil.updateUrl that you can use.

unable to connect to openfire server with external ip

I'm trying to connect to openfire server using spark. I have dynamic dns, made port forwarding on port 5222 in d-link router. When i'm logging with host name as private ip for example "192.168.0.101" - connection is established, but when i'm setting my domain (pizokas.hopto.org) as host name i get the following error
Unknown connection error. Please review logs for the following information.
But there are no logs in openfire server, so i assume packets are dropped in router. I have firewall turned off. At this point i can't find information why the connection cannot be established. I'm using my own laptop as server and as a client, os win 10. Maybe somebody had similar issue?
The connection was established when i was trying to connect to server from outside of lan

OPC-UA server in a remote access computer

I am trying to connect an OPC-UA server with an OPC-UA client. I am using a remote desktop connection. Is it the reason that I am not getting any server discovered by Matlab OPC UA or Aspen CIMIO even though they are running?
"Discovered" or just "connected"? Connecting to the remote OPC UA server is normal process so if you cannot connect I would check if there is connection can be made in the first place (firewall) and if certificate is used and what is policy.
Can you put the server on your local computer and check the connection then?

Socket mirror from dynamic IP to a server

Scenario:
I need to have access to a socket server from internet. This server is on a machine that can have a dynamic IP and can be behind router NAT etc and I don't want to configure "port forwarding" dynamic DNS for going out.
My idea is to run socket in a server that client (app) and machine with dynamic IP can connect and the server create data channel from client and master.
Master ----- Socket Mirror with DNS ---- Client (can be more than one)
what is the best way to do this? Backend service like google cloud services? or other ?
The thing you are discussing is about to implement a TCP tunnel, since the question is more general I can't answer with code; I recommend services like ngrok, where it establishes a tunnel between remote server & dynamic IP server, the software is opensource.
NOTE: if you need answer specific to languages search with TCP tunnel.