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: 541
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: 267

Currently Online:
8 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 100

pramanj: 86

ibrahim: 70

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 38

Rainer Versteeg: 32

Thomas Reuther: 26

Member Stats:

Guest Posters: 0

Members: 1070

Moderators: 14

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 994

Posts: 4201

Newest Members:

carmellentz9, dreampangari, wdongjia, sheilalow452740, VivekRangi, mariannassaki, eugeniarobak, susannahmario, ahussnain, vla

Moderators: Jouni Aro: 846, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 541, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 20, Markus Johansson: 18, Matti Siponen: 36, Lusetti: 0

Administrators: admin: 0