Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » SUBSCRIBE FB connection problem with OPC UA Ignition server("error/client Opening the TCP socket failed")
SUBSCRIBE FB connection problem with OPC UA Ignition server [message #1854872] Thu, 15 September 2022 20:48 Go to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Hello,

I have a tag (V3R7) on a third party server which in theory should control a valve. It has three conditions (0-open, 1-closed, 2-failed To Open), data type int16. The problem: SUBSCRIPTION FB establish connection (QO :TRUE, STATUS:OK) but don't receive the data (RD_1 output is always 0).
index.php/fa/42501/0/
I have seen a similar topic on this forum and the problem was in a mistake in ID. I have double checked my and found nothing (or maybe missed smth).

Here is the forte log:
INFO: T#18446743412837267902: [OPC UA LOGGER] info/client       Connecting to endpoint opc.tcp://localhost:62541
INFO: T#18446743412837333902: [OPC UA LOGGER] info/client       SecurityPolicy not specified -> use default #None
WARNING: T#18446743412837371202: [OPC UA LOGGER] warning/(null) Security policy None is used to create SecureChannel. Accepting all certificates
INFO: T#18446743412885540902: Connection established by client
WARNING: T#18446743417839439402: [OPC UA LOGGER] warning/network        Trying to connect to opc.tcp://localhost:62541 timed out
ERROR: T#18446743417839621902: [OPC UA LOGGER] error/client     Opening the TCP socket failed
ERROR: T#18446743417840211902: [OPC UA LOGGER] error/client     Couldn't connect the client to a TCP secure channel
ERROR: T#18446743417840319702: [OPC UA CLIENT]: Couldn't connect to endpoint opc.tcp://localhost:62541. Forte will try to reconnect in 8000 milliseconds


here is my full ID in my FB:
"opc_ua[SUBSCRIBE;opc.tcp://localhost:62541#;/Objects/2:Tag Providers/2:default/V3R7,2:s=default/V3R7]"


All node info (BROWSENAME,NODE_ID ) for the ID I took in UaExpert.
index.php/fa/42502/0/
index.php/fa/42503/0/
An Example of the ID I took from 4diac manual:
https://www.eclipse.org/4diac/en_help.php?helppage=html/communication/opc_ua_version1.html

[Updated on: Tue, 11 October 2022 19:27]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1854901 is a reply to message #1854872] Fri, 16 September 2022 18:20 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

In the 4diac FORTE logs I see :
WARNING: T#18446743417839439402: [OPC UA LOGGER] warning/network        Trying to connect to opc.tcp://localhost:62541 timed out
. Therefore I would expect that your OPC UA server is not reachable under localhost:62541. What address and port does your OPC UA have?

Cheers,
Alois
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1854902 is a reply to message #1854901] Fri, 16 September 2022 18:56 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Hello Alois,

Here is my server settings:
index.php/fa/42512/0/

and here you can see, that i use the same settings in UaExpert to connect to the server and it works:
index.php/fa/42513/0/

Best,
Yegor
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855047 is a reply to message #1854902] Mon, 26 September 2022 07:37 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

I think FORTE per default also tries to create a server on that port. Maybe that is messing up your setup?
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855049 is a reply to message #1855047] Mon, 26 September 2022 12:08 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
Hi Yegor, I don't see anything wrong with your FB parameters and server settings. Besides changing the port of the server, as suggested by Alois, you could also try to disconnect UA Expert from the server, while you run forte. Some servers do limit the number of client connections that are allowed simultaneously. Haven't seen it that often, but maybe this is your case?

[Updated on: Tue, 27 September 2022 11:28]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855080 is a reply to message #1855049] Tue, 27 September 2022 21:42 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Alois,
FORTE creates a server by using port 4840. So I run two servers at :4840 and :62541 (I don't need two of them simultaneously, but I've checked in purpose if there is a port conflict)
INFO: T#528072969456: [OPC UA LOCAL]: Starting OPC UA Server: opc.tcp://localhost:4840

I don't know if this can cause a problem, but in theory both servers don't bother each other, or?


Kirill,
According Ignition documentation it has no client connection limitation. The only thing i found on Ignitions's forum is:
Quote:

You may be dealing with a broken client implementation that does a "two step" connection:
1)connect, get endpoints, find a matching one
2)connect to the matching endpoint, create/activate a session

Does it a case of Subscriber FB in 4DIAC?
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855267 is a reply to message #1855080] Wed, 05 October 2022 11:39 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
Yegor, as far as I remember, no, we connect directly to the given endpoint, without doing any endpoint discovery. I was playing around with an ignition server. It seems they have some complicated discovery/connection procedure. At least, in UA-Expert you first need to connect to the discovery endpoint opc.tcp://localhost:62541/discovery and only then the client is able to connect to opc.tcp://localhost:62541.. I found that weird and wanted to continue my experiments later, but then my laptop crashed completely :-D I promise I'll get back to this Ignition case if someone won't find out the problem before..
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855274 is a reply to message #1855267] Wed, 05 October 2022 19:25 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Kirill, thank you, it would be nice. So far i didn't find a solution for this problem.
Here is what i found on Ignition forum.
index.php/fa/42567/0/

However both of them (discovery and session) don't work with SUBSCRIBE fb.
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855304 is a reply to message #1854872] Thu, 06 October 2022 22:21 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
Hi Yegor,

I got it working after finding this thread in Ignition forum [1]:

Quote:
Changing the listen address from localhost to the IP of the machine makes it work.


Thus, my Ignition OPC UA Server Settings are:

Bind Addresses	
localhost,192.168.1.110
(default: localhost)

Endpoint Addresses	
<hostname>, <localhost>,192.168.1.110


where 192.168.1.110 is my ipaddress. Then in 4diac my CLIENT FB has the following ID:

opc_ua[READ;opc.tcp://192.168.1.110:62541#;,0:i=2265]


https://www.eclipse.org/forums/index.php?t=getfile&id=42574&

Hope, this works for you as well :-)

[1] https://forum.inductiveautomation.com/t/open62541-client-to-ignition/18252

[Updated on: Thu, 06 October 2022 22:22]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855346 is a reply to message #1855304] Sun, 09 October 2022 22:53 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Kirill,
it did help, thank you. It connects with IP instead "localhost" (I have only one PC for both Ignition and 4Diac), but i still cant receive any data. What did i miss?

Ignition OPC config (I did not forget to reload OPC UA module):
index.php/fa/42585/0/
Forte logs:
index.php/fa/42586/0/
4diac:
index.php/fa/42587/0/
I have tried to use ID in the format BROWSENAME (RandomInteger1 is a sample node of Ignition)
"opc_ua[READ;opc.tcp://127.0.0.1:62541#;/Objects/2:Tag Providers/Sample_Tags/Random/RandomInteger1]"

aaaaand BROWSENAME,NODE_ID
"opc_ua[READ;opc.tcp://127.0.0.1:62541#;/Objects/2:Tag Providers/Sample_Tags/Random/RandomInteger1,2:s=Sample_Tags/Random/RandomInteger1]"


but if I use only NODE_ID
"opc_ua[READ;opc.tcp://127.0.0.1:62541#;,2:s=Sample_Tags/Random/RandomInteger1]"

forte shows:
ERROR: T#18446743469341962754: [OPC UA CLIENT]: Reading for FB CLIENT_0_1 in client opc.tcp://127.0.0.1:62541 failed because the response for index 0 has status BadNodeIdUnknown

and 4diac looks like:
index.php/fa/42588/0/

I have only one guess, that it is probably because of square brackets. UaExpert shows "[Sample_Tags]" in the Identifier (and basically all subfolders of the folder Tag Providers have [...] in ID. Even the ones created by user/me), but 4diac does not allowed to add square brackets into square brackets (like opc_ua[ACTION;ENDPOINT;....[...]...]), so i used just "Sample_Tags" in ID.
index.php/fa/42589/0/
  • Attachment: OPCconfig.JPG
    (Size: 39.22KB, Downloaded 266 times)
  • Attachment: forte_log.JPG
    (Size: 206.09KB, Downloaded 290 times)
  • Attachment: 4diacIDE.JPG
    (Size: 33.87KB, Downloaded 264 times)
  • Attachment: 4diacIDE-2.JPG
    (Size: 32.18KB, Downloaded 272 times)
  • Attachment: UaExpert.JPG
    (Size: 18.21KB, Downloaded 266 times)
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855350 is a reply to message #1855346] Mon, 10 October 2022 07:57 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
I think you're right, you need the square brackets in nodeId. As far as I remember, you can use $ to escape them.. try smth like: ...$[...$]...

"opc_ua[READ;opc.tcp://127.0.0.1:62541#;,2:s=$[Sample_Tags$]/Random/RandomInteger1]"

[Updated on: Mon, 10 October 2022 08:41]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855365 is a reply to message #1855350] Mon, 10 October 2022 22:04 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
Kirill,
4Diac does not give a chance to use $[. For some reason it doesn't save changes in ID and at the same time 4diac shows a message that $ is used as escaped character. O_o. Maybe you know why?

I've also tried &[ according to the OPC UA documentation (https://reference.opcfoundation.org/Core/Part4/v104/A.2/) and some other variations I could find on OPC UA forums: \[, < instead of [, '['
No results so far.
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855373 is a reply to message #1855365] Tue, 11 October 2022 06:55 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1584
Registered: January 2014
Senior Member

Hi,

unfortunately we currently don't have a good escaping for communication IDs. Both $ and \ are problematic as escape characters. $ is not possible because it has a special meaning in IEC 61131-3 and \ as it has the same specialties in C/C++ or Java. We just had in an other occurrence a problem with it.

Therefore we need a dedicated escape character that is only analyzed in IDs. Maybe using the [ and ] are good escape characters. If you have a single [ or] it would be the delimiter of the id params, double would be inside.
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855375 is a reply to message #1855373] Tue, 11 October 2022 09:59 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
How about changing the behavior of the outer [ ] to greedy matching? Then inner [ ] would be kept inside the string
Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855387 is a reply to message #1855375] Tue, 11 October 2022 16:29 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
in the meantime... the speification over the browse path should actually work..

just be sure that you need to specify the namespace index for every node in the browse path. probably, instead of:

"opc_ua[READ;opc.tcp://127.0.0.1:62541#;/Objects/2:Tag Providers/Sample_Tags/Random/RandomInteger1]"


you need smth like

"opc_ua[READ;opc.tcp://127.0.0.1:62541#;/Objects/2:Tag Providers/2:Sample_Tags/2:Random/2:RandomInteger1]"


assuming all the nodes in the browse path starting from "Tag Providers" are in the 2nd namespace (better double-check every single node;s ns index in UAExpert)

[Updated on: Tue, 11 October 2022 16:30]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855390 is a reply to message #1855387] Tue, 11 October 2022 19:23 Go to previous messageGo to next message
Yegor Chebotarev is currently offline Yegor ChebotarevFriend
Messages: 10
Registered: August 2022
Junior Member
UPD:
BROWSENAME this form works. Thank you, Kirill!
"opc_ua[READ;opc.tcp://127.0.0.1:62541#;/Objects/2:Tag Providers/2:Sample_Tags/2:Random/2:RandomInteger1]"


with one small detail. Data type INT is INT16 in 4DIAC, but INT32 in Ignition, so you need to change type of all integer nodes(in Ignition) to Short which is INT16.

[Updated on: Tue, 11 October 2022 19:34]

Report message to a moderator

Re: SUBSCRIPTION FB connection problem (OPC UA) [message #1855393 is a reply to message #1855390] Tue, 11 October 2022 21:07 Go to previous message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 70
Registered: February 2016
Member
this is probably because your forte is 64-bit. anyway, I'm happy it works in the end :-)
Previous Topic:Installation FORTE on NXP (Debian)
Next Topic:MQTT connect to Amazon AWS
Goto Forum:
  


Current Time: Tue Apr 23 14:12:44 GMT 2024

Powered by FUDForum. Page generated in 0.04273 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top