|
Re: OPCUA address [message #1854230 is a reply to message #1854214] |
Mon, 08 August 2022 15:29 |
|
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 |
jack li 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 97 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 |
|
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 #1854417 is a reply to message #1854304] |
Thu, 18 August 2022 05:44 |
jack li 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.02964 seconds