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 » 4DIAC - Composite Function Block
4DIAC - Composite Function Block [message #1809554] Thu, 18 July 2019 07:21 Go to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 11
Registered: July 2019
Junior Member

Hello,

I got a question re creating a composite function block. Do you have to export the cpp and h files followed by a recompilation of Forte? Or can you merely build the composite in 4DIAC and use them without compilation into Forte? When we follow the example, and then try and added watches to the composite FB, they show N/A on input and outputs, but they do deploy, seemingly without errors.

Best Regards
Re: 4DIAC - Composite Function Block [message #1809587 is a reply to message #1809554] Thu, 18 July 2019 14:58 Go to previous messageGo to next message
Martin Melik Merkumians is currently offline Martin Melik MerkumiansFriend
Messages: 117
Registered: March 2016
Senior Member
Hi,

Composite FBs have to be compiled into FORTE.

Best,
Martin
Re: 4DIAC - Composite Function Block [message #1809591 is a reply to message #1809587] Thu, 18 July 2019 15:17 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

To add to Martins comment you could look at subapplicatuions. Subapplications (typed, or un-typed) are flattened during deployment and therefore do not need to be compiled.

Also I would recommend to look at the work our Google Summer of Code Student Jan is doing. He is improving our dynamic type loading feature. He posted some messages with further information in our news sections as well as in the developer mailing list.

Cheers,
Alois
Re: 4DIAC - Composite Function Block [message #1809921 is a reply to message #1809554] Thu, 25 July 2019 16:51 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 11
Registered: July 2019
Junior Member
Thanks for your answers.

We are following 4diac tutorial to include bespoke blocks in forte . I got a questing regarding generating attributes FORTE_EXTERNAL_MODULES_DIRECTORY
FORTE_MODULE_EXAMPLE_TEST in Cmake form command line as oppose of using GUI . i.e. tutorial says Generate first and then Configure, not sure how that can be executed form command line/docker.

We are using Dockerfile to build forte, here is the relevant part of the code

# FORTE BUILD
&& cd /root \
&& git clone -b 1.10.2 https://git.eclipse.org/r/4diac/org.eclipse.4diac.forte forte \
&& git clone https://github.com/mariuszbalon/ext_modules forte_ext \
&& cp -r /root/forte_ext /root/forte \
&& cd forte \
&& chmod +x setup_posix.sh \
&& bash ./setup_posix.sh \
&& cd bin/posix \
&& cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug \
-DFORTE_COM_LOCAL=ON -DFORTE_TESTS=OFF \
-DFORTE_MODULE_CONVERT=ON -DFORTE_MODULE_UTILS=ON \
-DFORTE_ARCHITECTURE=Posix \
-DFORTE_EXTERNAL_MODULES_DIRECTORY=/root/forte/ext_modules \
-DFORTE_MODULE_EXAMPLE_TEST=ON \
-DFORTE_COM_ETH=ON -DFORTE_MODULE_IEC61131=ON \

TIA
Regards
Re: 4DIAC - Composite Function Block [message #1809926 is a reply to message #1809921] Thu, 25 July 2019 18:31 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

I see that you are using already the setup_posix.sh. I think instead of doing the cmake setup twice I would move the stuff from the posix_setup.sh to your docker file. Then you only have one invokation of cmake and everything nicely in one place. Also as we recommend now I would put the build dir parellel to the 4diac FORTE code. so instead of cding into forte performing a 'mkdir build' in the root build dir then cd into that and invoke cmake from there. Another reason for not using our setup_posix.sh directly is that this file enables a lot what you ma not need or what you should not for a production build fo 4diac FORTE (e.g., tests). Having now the 4diac FORTE cmake config in your docker file makes you indpeendent from our build settings and gives you clearer defined builds.

But yes it should work that way. We use it similarly for our jenkins build. However we currently don't have an external module here.
Re: 4DIAC - Composite Function Block [message #1809961 is a reply to message #1809926] Fri, 26 July 2019 14:15 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
You don't need to copy the external module inside the forte folder, and your are missing the main directory of forte at the end

&& cd /root \
&& git clone -b 1.10.2 https://git.eclipse.org/r/4diac/org.eclipse.4diac.forte forte \
&& git clone https://github.com/mariuszbalon/ext_modules forte_ext \
&& mkdir binPosix
&& cd binPosix \
&& cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DFORTE_COM_LOCAL=ON \
-DFORTE_TESTS=OFF \
-DFORTE_MODULE_CONVERT=ON \
-DFORTE_MODULE_UTILS=ON \
-DFORTE_ARCHITECTURE=Posix \
-DFORTE_EXTERNAL_MODULES_DIRECTORY=/root/forte_ext/ \
-DFORTE_MODULE_EXAMPLE_TEST=ON \
-DFORTE_COM_ETH=ON \
-DFORTE_MODULE_IEC61131=ON \
/root/forte
&& make -j4
Re: 4DIAC - Composite Function Block [message #1810223 is a reply to message #1809961] Mon, 05 August 2019 10:08 Go to previous messageGo to next message
Mariusz  Balon is currently offline Mariusz BalonFriend
Messages: 11
Registered: July 2019
Junior Member
Alois/Jose , we followed your advices and it worked. Docker now builds fine with external FBs included.

Many thanks

Re: 4DIAC - Composite Function Block [message #1810244 is a reply to message #1810223] Mon, 05 August 2019 21:17 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Mariusz,
great to hear that. I initially feared that we have an issue with the external modules option. Good that this is not the case.

Cheers,
Alois
Previous Topic:Custom data type(Structured Datatypes)
Next Topic:boot file throw error
Goto Forum:
  


Current Time: Thu Apr 25 11:14:03 GMT 2024

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

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

Back to the top