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 » OPCUA address (OPCUA address is incorrect)
OPCUA address [message #1854214] Mon, 08 August 2022 07:12 Go to next message
jack li is currently offline jack liFriend
Messages: 15
Registered: August 2022
Junior Member
dear author
I have a problem. When I make a compound function block with an OPCUA address in it, such as "opc_ua[WRITE;/myarea/DI0]", when I call the block twice in my main program, the first variable address is overwritten.so.do you have any good suggestions to solve this problem
Re: OPCUA address [message #1854230 is a reply to message #1854214] Mon, 08 August 2022 15:29 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

with calling it twice I guess you mean you have two instances of the block in your application? If so then I would recommend to move some configuration parameter to the interface of the FB which, for example, provides some the last part of the configu string to be set by the user of your block and use inside of your composite FB then string manipulation blocks to generate the final config string for the OPC UA FB.

Cheers,
Alois
Re: OPCUA address [message #1854243 is a reply to message #1854230] Tue, 09 August 2022 00:54 Go to previous messageGo to next message
jack li is currently offline jack liFriend
Messages: 15
Registered: August 2022
Junior Member
dear Alois
yeah,move some configuration parameter to the interface of the FB is one way ,sometimes when we have a lot of variables, we want to be able to automatically generate the OPCUA address,
as shown in the picture
in the FB ithis_hmi ,the OPC_UA address is "opc_ua[WRITE;/myarea/DI0]"
in the FB cat_add,ithis_hmi will be called once
in the FB test,cat_add will be called three times
the FB test will be called once by main FB
if so,We will see that there is only one OPCUA address, and the other two will be overwritten,so,I want to find a solution
best regards
  • Attachment: 1.docx
    (Size: 576.26KB, Downloaded 80 times)

[Updated on: Tue, 09 August 2022 00:58]

Report message to a moderator

Re: OPCUA address [message #1854268 is a reply to message #1854243] Tue, 09 August 2022 17:57 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

in that case it would be great to have some FB that gets some information of where it is used (e.g., the instance name of the CFB outside or so. Unfortunately we currently don't have that information available in 4diac FORTE.
Re: OPCUA address [message #1854304 is a reply to message #1854268] Fri, 12 August 2022 00:19 Go to previous messageGo to next message
jack li is currently offline jack liFriend
Messages: 15
Registered: August 2022
Junior Member
Dear Alois
I think of a solution, when creating CFB(The constructor of CCompositeFB class), create a internal variable(such as m_cfbDirectory) to store the level directory of the composite function block, and then when setting parameters(the CCompositeFB::setParams() is called),check if the write address of OPCUA, then replace the original OPCUA address with the stored level directory(the variable m_cfbDirectory), do you think this solution is feasible.
best regards
Re: OPCUA address [message #1854417 is a reply to message #1854304] Thu, 18 August 2022 05:44 Go to previous messageGo to next message
jack li is currently offline jack liFriend
Messages: 15
Registered: August 2022
Junior Member
Dear Alois
I may have solved the problem,
first,create a static variable in the funcbloc.h(such as static std::string mFb_path = "/";)
second,when creating CFB(The constructor of CCompositeFB class),the var(mFb_path )to store the level directory of the composite function block,
third,when setting parameters(the CCompositeFB::setParams() is called),check if the write address of OPCUA, then replace the original OPCUA address with the stored level directory(the variable mFb_path),
I only tested the OPCUA address directory problem and it was OK,I don't know if this will lead to other unknown problems in forte
best regards
Re: OPCUA address [message #1854499 is a reply to message #1854417] Mon, 22 August 2022 19:50 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1560
Registered: January 2014
Senior Member

Hi,

I think it is a nice first step. But I fear it will lead to quite some memory usage. But if for now you can work I'm happy with it.

Alois
Previous Topic:IO configuration/mapping for custom board
Next Topic:Share data
Goto Forum:
  


Current Time: Thu Mar 28 22:54:36 GMT 2024

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

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

Back to the top