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 » OPC UA connection issue
OPC UA connection issue [message #1810329] Thu, 08 August 2019 06:38 Go to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
Hello,
We have been trying to use an external OPC-UA server to subscribe and publish to and from. I have therefore tried to example (OPC UA Client Subscriptions) https://www.eclipse.org/4diac/documentation/html/communication/opc_ua.html

There server is configured as per attached 1.png:
index.php/fa/36065/0/
It is configured on a docker host and exposes the OPC-UA server as expected
as per attached 2.png
index.php/fa/36066/0/


The client is configured as per attached 3.png
index.php/fa/36067/0/

Both the Forte RTE are running on the same docker host therefore allowing connection using the container name opc.tcp://forte:4840, which is the name of the server.

When deployed the client we get the following error message in the client logs:
Adding monitoring variable
failed: BadSubscriptionIdInvalid
we see that the connection is establish, but the client fails to subscribe to the OPC-UA server point.

Do you have any suggestion as to why this is happening?
  • Attachment: 1.png
    (Size: 424.27KB, Downloaded 107 times)
  • Attachment: 2.png
    (Size: 47.31KB, Downloaded 108 times)
  • Attachment: 3.png
    (Size: 126.21KB, Downloaded 107 times)

[Updated on: Thu, 08 August 2019 06:40]

Report message to a moderator

Re: OPC UA connection issue [message #1810332 is a reply to message #1810329] Thu, 08 August 2019 09:50 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 868
Registered: January 2014
Senior Member
When you want to run to 4diac FORTEs on the same docker container or same machine with OPC UA you need to ensure that both 4diac FORTE have configured two different TCP ports for their OPC UA servers. If you are using the 1.10.x versions then there is a CMake option. In the development branch you can enable a commandline parameter and use the command line paramter for setting it.
Re: OPC UA connection issue [message #1810450 is a reply to message #1810332] Mon, 12 August 2019 11:00 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
We are using two separate instances of forte each container their own containers. The Forte (server) is named forte as a container name, which therefore makes it resolvable in Docker as forte:4840 as a separate host.
The forte client is called forteclient. Both of these containers are on the same docker network, and can communicate which each other.

We therefore don't don't understand how the change of port would resolve this. Could you elaborate further and give and example of how to change the port using Cmake from the command line?
Re: OPC UA connection issue [message #1810474 is a reply to message #1810450] Mon, 12 August 2019 14:24 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 868
Registered: January 2014
Senior Member
I'm not a big docker expert but if understood you correctly then both docker containers with the two 4diac FORTEs would be independent. Therefore my suggestion would not solve your issue. It would only help if they are on the same machine. However if you need it there is the CMake option FORTE_COM_OPCUA_PORT which you can use to set the port that your 4diac FORTE instance should use for the OPC UA server. With 1.11.0 this will be also setable via a command line option.
Re: OPC UA connection issue [message #1810478 is a reply to message #1810474] Mon, 12 August 2019 15:02 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 46
Registered: February 2016
Member
I am not completely sure, but I remember there was a weird behavior in subscriptions as they were not working properly when a client had ONLY a single opc ua subscription without any other opc ua operation. So as a quick hack, I'd propose you to add some dummy read in your client application that, say, reads one of your variables from the server. If this read works, then subscription might also automagically start working.
However, a clean solution would be using our brand new feature/MO44GA branch from forte repository, where we fixed lots of opc ua issues, including this one.
Re: OPC UA connection issue [message #1810574 is a reply to message #1810478] Tue, 13 August 2019 15:41 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
Which tag / branch for https://github.com/open62541/open62541.git is recommended to build the Forte feature/MO44GA branch against to make sure the open62541 library match the changes made in forte?
Re: OPC UA connection issue [message #1810577 is a reply to message #1810574] Tue, 13 August 2019 16:03 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 46
Registered: February 2016
Member
by default, it is tag v0.3.0. feature/MO44GA branch has a separate flag to build forte with the master branch of open62541.
Re: OPC UA connection issue [message #1810578 is a reply to message #1810574] Tue, 13 August 2019 16:04 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
Another Question.

We've managed to compile the feature branch, but It looks like the OPC_UA format has changed in the way they are specified in the 4DIAC function blocks., now getting:

ERROR: T#2444009991828: [OPC UA ACTION]: Parameters /Objects/1:AnyName should have at least 2 parts, separated by a semicolon
ERROR: T#2444010586993: [OPC UA ACTION]: Parameters /Objects/DI should have at least 2 parts, separated by a semicolon

What is the correct format to specify in the publish and subscribe function blocks?
Re: OPC UA connection issue [message #1810582 is a reply to message #1810578] Tue, 13 August 2019 16:36 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 46
Registered: February 2016
Member
oh yeah, it changed.. you can find a small readme under org.eclipse.4diac.forte\src\modules\opc_ua\readme.md
Re: OPC UA connection issue [message #1810663 is a reply to message #1810582] Thu, 15 August 2019 13:06 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
Many thanks for your help so far.

We have managed to compile and get the feature branch working.

However, the remote WRITE is giving us some issues. From reading the README file in the OPC_UA source folder it looks like the below connection should work.

The server has created the below data object as shown, which when changed from the Prosys ops ua client does change in 4DIAC when monitoring the function blocks
index.php/fa/36113/0/

When deploying from the forte client to try and read and write from in Remote mode as per the Logic below, we get 3 errors, which doesn't appear to match the instruction in the README file:

INFO: T#38516097655094: FORTE is up and running
INFO: T#38516097700594: Using provided bootfile location set in CMake: forte.fboot
INFO: T#38516097733894: Boot file forte.fboot could not be opened. Skipping...
INFO: T#38516097746694: CBSDSocketInterface: Opening TCP-Server connection at: localhost:61499
INFO: T#38541697911994: Connection established by client

ERROR: T#38541728933294: [OPC UA LAYER]: Connection RD_1 of FB CLIENT_1 is not connected to anything.
ERROR: T#38541729030994: [OPC UA ACTION]: Remote SUBSCRIBE_1 action is only allowed using a Client FB, the amount of BrowseName,NodeId pairs should match the number of RDs, and must have no SDs
ERROR: T#38541729287794: [OPC UA LAYER]: Got invalid port connection on FB CLIENT_1_1 at port SD_1. It must be connected to another FB.

INFO: T#38541729759494: Connection closed by peer
INFO: T#38541781822994: Connection established by client
index.php/fa/36115/0/
Do you have any suggestion as to how to get the Remote READ / WRITE working based on the above?
Re: OPC UA connection issue [message #1810666 is a reply to message #1810663] Thu, 15 August 2019 14:45 Go to previous messageGo to next message
Kirill Dorofeev is currently offline Kirill DorofeevFriend
Messages: 46
Registered: February 2016
Member

Hi Mariusz ,

ERROR: T#38541728933294: [OPC UA LAYER]: Connection RD_1 of FB CLIENT_1 is not connected to anything.


It says, in your CLIENT_1 FB the RD_1 port should be connected to a suitable convert FB, so that forte knows the data type of the output data. However, as you just using it for writing a data value, you need CLIENT1_0 FB instead (with no SD_x ports)

ERROR: T#38541729030994: [OPC UA ACTION]: Remote SUBSCRIBE_1 action is only allowed using a Client FB, the amount of BrowseName,NodeId pairs should match the number of RDs, and must have no SDs


All remote operations use the Client FB for now. If you read a value, you need the CLIENT0_1 FB (no RDs, one SD port)

ERROR: T#38541729287794: [OPC UA LAYER]: Got invalid port connection on FB CLIENT_1_1 at port SD_1. It must be connected to another FB.


same. use CLIENT0_1 FB instead

Hope this helps.
Re: OPC UA connection issue [message #1810668 is a reply to message #1810666] Thu, 15 August 2019 16:12 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
We are using 4DIAC 1.10 and i cannot see the function block you are mentioning, how do we include that to the library or what version should we be using?
Re: OPC UA connection issue [message #1810674 is a reply to message #1810668] Thu, 15 August 2019 18:24 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 868
Registered: January 2014
Senior Member
These FBs are generic in 4diac FORTE. Therefore you can simple take one of the suiting FBs e.g., CLIENT_2_1, copy it, give it the right name (i.e., CLINET_1_0, and adjust the interface to your needs. You don't need to generate any Cpp code or do anything else. 4diac FORTE will based on the type name create the correct FB during FB instantiation.
Re: OPC UA connection issue [message #1810687 is a reply to message #1810674] Fri, 16 August 2019 07:05 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 10
Registered: July 2019
Junior Member
Many thanks.

Here is the working setup with both READ, WRITE and SUBSCRIBE from the remote client.

index.php/fa/36118/0/

Re: OPC UA connection issue [message #1810692 is a reply to message #1810687] Fri, 16 August 2019 10:53 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 868
Registered: January 2014
Senior Member
Cool!
Previous Topic:Terminated for publisher and subscriber
Next Topic:build a forte in PLC not in list of already supported PLCS
Goto Forum:
  


Current Time: Sat Aug 24 17:57:07 GMT 2019

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

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

Back to the top