|
Re: Forte as Static Library [message #1747446 is a reply to message #1747439] |
Mon, 14 November 2016 19:56 |
|
Unfortunately there is not much documentation on using 4diac as library. The cpp files you mention are already part of the generated static library and to my knowledge you only need to put the call forteInit::initForte() into your code. However I noticed that the main FORTE is using will be part of the static lib. So this is also something you may not want.
This depends a bit on your use case. Could you be so kind and take a bit more what you would like to do? Maybe there is a better option in FORTE or if not we can better understand to adjust FORTE to your needs.
Alois
|
|
|
|
Re: Forte as Static Library [message #1747528 is a reply to message #1747508] |
Tue, 15 November 2016 16:27 |
|
Hi thanks for the clarification. In this case I would strongly recomend to not build a library but build FORTE as normal executable. This will also allow you to add your own C++ code. However in order to make it usable in your applicaiotns you need to develop a FB first generate C++ code for it and change the C++ code to your needs. Please have a look on the FB develoment tutorials there you should find a descriptions how to do it. For simple FBs I can also recomend to look at Structured text. It may make your developments in the future much easier.
Regarding your options I would also turn on the Modules (FORTE_MOdULE_xxx): CONVERT, IEC6131-3, and UTILs. And when following the descriptions in the FB development tutorials your own modules. Modules are the FORTE means to extend FORTE with own code.
I hope this helps you to get 4diac working for you needs. If not I'm happy to support you.
BR,
Alois
|
|
|
|
Re: Forte as Static Library [message #1747551 is a reply to message #1747534] |
Tue, 15 November 2016 21:07 |
|
I think you can get the most out of it going with the FORTE as application option. This is also the main way we develop FORTE. Using it as library are AFAIK some very special cases where FORTE gets integrated in some other application framework. Currently I think this requires some manual tinkering with teh FORTE code. Especially how we are starting FORTE. For this it could be an interesting idea to offer a method startFORTE and not a int main() function as we are doing now.
For other use-cases like added external/existing C/C++ code or existing libraries the way to go is to wrap it in Function Blocks and add them to FORTE as module. We do this for example with MQTT, OPC UA or EthernetPowerlink support. Given your description I think this is also the way I would recommend for you.
|
|
|
Powered by
FUDForum. Page generated in 0.03645 seconds