Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Connect to OPC Server using OPC-UA
April 7, 2020
4:56, EEST
Avatar
anhy123
New Member
Members
Forum Posts: 2
Member Since:
April 7, 2020
sp_UserOfflineSmall Offline

Good morning.

First of all, sorry but I am a novice in all that relates to OPC servers and connections.
I’m trying to connect to Matrikon OPC Server that I have installed and running in a virtual machine, and the same try to connect from the Java SDK against Matrikon server, but i can not.

The next example code (seemingly simple), returns next error on line “client.connect()”: “Failed to retrieve endpoints The server is not available. Opc.tcp: // localhost: 4841 ServiceResult = Bad_ConnectionRejected (0x80AC0000)” Could not Establish a network connection to remote server. “

Could you help to establish the connection via OPC-UA? On the other hand, is it possible other type of connection to a server using OPC UA, like HTTP SOAP requests, insted “opc.tcp”?

Thank you.

April 7, 2020
14:29, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

That statuscode Bad_ConnectionRejected (0x80AC0000) means nothing did answer at the other end, i.e. no-one is listening the socket address that would be what opc.tcp://localhost:4841 would resolve into. The server is not running or you have wrong address or something blocks the connection.

If you have the server within a VM, unless you were connecting to the server from within the VM itself, ‘localhost’ obiviously wont work, since it should point to the host and not the guest OS of the VM. Thus use an IP address or hostname that points to the VM.

Since this forum category is for the https://www.prosysopc.com/products/opc-ua-historian/ I would assume your question to have something to do with it, but based on the text it is for our OPC UA SDK for Java instead, so the answer is assuming that was the case (for the SDK https://forum.prosysopc.com/forum/opc-ua-java-sdk/ would be better place for questions).

Generally speaking you must have (or learn) basic understanding of things in order to use the SDK.

Some early versions of the OPC UA Specification had a SOAP/HTTP option, but that has been long deprecated and removed (basically in practice no-one supported that).

In theory there is opc.https, but that is just the same data as with opc.tcp but using the https for encryption (i.e. it is not “web-https”) instead of the securechannel mechanism (of opc.tcp). Generally speaking pretty much no servers support that either (or do not do that properly). Also in practice there is zero benefit to using it anyway. There are few close-to-absurdness-edge-cases where it might be needed, but unless you know you need it better to ignore it.

Generally use https://www.prosysopc.com/products/opc-ua-simulation-server/, https://www.prosysopc.com/products/opc-ua-browser/, https://www.unified-automation.com/products/development-tools/uaexpert.html to learn and test.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1