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 » Compiled new type, but type not found(Forte for Win32)
Compiled new type, but type not found [message #1753529] Tue, 07 February 2017 14:09 Go to next message
Sandeep Patil is currently offline Sandeep PatilFriend
Messages: 7
Registered: February 2017
Junior Member
Hello,

I just setup forte for windows and generated files for a new basic FB type. I followed the instructions at export type help doc. After exporting (new folder called processingstation under src/modules), I did build, and the new source files were not in the target build folder. After some checking I realized I have to make a change to CMakeLists.txt. I added following lines

SET(SOURCE_GROUP "${SOURCE_GROUP_BACKUP}")
SET(SOURCE_GROUP_BACKUP "${SOURCE_GROUP}")
SET(SOURCE_GROUP "${SOURCE_GROUP}/processingstation")
ADD_SUBDIRECTORY("${FORTE_MODULE_DIR}processingstation")


I also added a new CMakeLists.txt in processingstation directory with just 1 line
forte_add_sourcefile_hcpp(AddandSub)


AddandSub is the name of the FB type. I generated forte.exe and I can now see the processingstation directory in the build dir and I also see that file being compiled in VisualStudio.

Now I tried to FBTest and I get UNSUPPORTED_TYPE error.

What am I missing?

[Note] I have used 4diac before and have successfully deployed complex applications, but right now cannot remember if I am missing something and why it would not work.

Thanks for the help
Re: Compiled new type, but type not found [message #1753586 is a reply to message #1753529] Tue, 07 February 2017 22:00 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Hi,

after a first look it seems that you are adding to much or the wrong parts to your module's CMakeList.txt.

FORTE's cmake infrastructure is automatically scanning all the module directories and sees whats in there to add them to your cmake configuration. While your code adds your directory it violates some rules for modules. The original intention from the guy (was not me) who added this approach was that modules is something you can activate and deactivate in your CMake configuration for your build target.

For that the only thing you need to add to your CMakeLists.txt should be:

forte_add_module(ProcessingStation  "FBs for the processing station")  # the first param is the name of your module will turn into the cmake option FORTE_MODULE_ProcessingStation the second name is some additional description
forte_add_sourcefile_hcpp(AddandSub)


With that when you rerun cmake gui you should have an additional option (i.e., FORTE_MODULE_ProcessingStation) which you can enable and disable. As with the initial setup you need to run configure until no further red options are present and the generate.

If you are compiling under windows with VS I noticed that when you later on add more FBs to your module VS not always correctly recognizes the change in the cmakelist.txt and you need to run cmake gui. Therefe have a look in the compile output if your FB's cpp file is listed there.

I hope this helps,
Alois

P.S.: I thought that there was a documentation page dedicated to describe the steps above. Somehow I can not find it anymore. But I always talk the utils or convert module as reference when I make my own module.
P.P.S.: With FORTE 1.8.4 you can also specifiy an external directory outside of the FORTE source tree where you can place module directories. this can be helpfull if you don't want to mix your code with original forte code. See this bug for details.


Re: Compiled new type, but type not found [message #1753616 is a reply to message #1753586] Wed, 08 February 2017 08:36 Go to previous messageGo to next message
Sandeep Patil is currently offline Sandeep PatilFriend
Messages: 7
Registered: February 2017
Junior Member
Thank you Alois, it works now.

The documentation existed. It was part of a Tutorial I believe, I last referred to it sometime in June/July last year. But missing now. Is the documentation source also part of Git? May be i can add a small tutorial and submit a PR?

I am using 1.8.4, I will try out external directory option next, this is very handy, I can create my own git repository for all my new fb types.
Re: Compiled new type, but type not found [message #1753618 is a reply to message #1753616] Wed, 08 February 2017 08:44 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

Great that it works. The documentation is part of the 4diac-ide code. Currently still in the mercurial repository at sourceforge (but we are heavily working on finally moving it to Eclipse's git). You can find it there in the plugins/org.fordiac.ide/html directory. We will also look on where we lost this part of the tutorial. But having more tutorials would be great. Thanks for the offer.

Having the possibility to put fbs and extension libraries (e.g. also communication protocols, new architectures, IO access) into different repositories was the main reason for having this external directory option. I think it is even possible to have several repositories in the external directory as, as far as I understood, the directories will be recursively searched. So your CMake List.txt could also be in sub directory further down the tree. But I haven't tested this yet.

Previous Topic:RFC/Poll: Remove Version Information from FBs in FB Network Editors
Next Topic:Adapter working with composite fb?
Goto Forum:
  


Current Time: Thu Apr 25 04:22:35 GMT 2024

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

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

Back to the top