OPCUA address [message #1854214] |
Mon, 08 August 2022 03:12  |
Eclipse User |
|
|
|
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 #1854243 is a reply to message #1854230] |
Mon, 08 August 2022 20:54   |
Eclipse User |
|
|
|
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 119 times)
[Updated on: Mon, 08 August 2022 20:58] by Moderator
|
|
|
|
|
Re: OPCUA address [message #1854417 is a reply to message #1854304] |
Thu, 18 August 2022 01:44   |
Eclipse User |
|
|
|
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 15:50  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.31676 seconds