|
Re: declaration of subroutines/functions currently not possible in ST algorithms? [message #1761171 is a reply to message #1761169] |
Mon, 08 May 2017 14:18 |
|
there are some parts where the IEC 61499 Standard Points to the IEC 61131 Standard. this is especially valid for ST. Since the model of IEC 61499 is different than those of IEC 61131 it is not always possible to just take all references comming from IEC 61131 as they have been made. I think the links to IEC 61131 are not always well thought out. Therefore there are some Points where 4diac only Supports a subset of ST, as functions, this Array stuff you already figured out or structs.
|
|
|
|
|
Re: declaration of subroutines/functions currently not possible in ST algorithms? [message #1761203 is a reply to message #1761181] |
Mon, 08 May 2017 21:08 |
|
I wanted to add to Monika's comment that we know about this limitation and there is also some discusion going on in the standardization working group to add such featuers to future versions of IEC 61499. By asking such questions we get from you the feedback that this is a feature that not only we see but that it is really needed by our users.
Also there is a kind of workaround which you could consider if you want to have a library of IEC 61131-3 functions. We have this for example for all IEC 61131-3 standard functions (e.g., SIN, MAX, MIN). There we have a C++ header file with all the function signatures. This functions can then be used in your ST algorithms like ST functions. So what you could to is develop a C++ header file with your functions (in c++) and add this header file to your FBs. In the property sheet of your fb there is a field header. There you can insert "#inlcude <yourfile.h>" and this will be added to your exported FB.
Although it is a little bit clumsy I hope this helps. Do you think we should improve our support of IEC 61131-3 function libraries?
|
|
|
|
Re: declaration of subroutines/functions currently not possible in ST algorithms? [message #1761340 is a reply to message #1761245] |
Tue, 09 May 2017 20:04 |
|
You are right. When writing a function libraries in C++ you get the same portability problems. Therefore I think it makes mostly sense when you have a set of functions (in the IEC 61131-3 sense you would like to use in several FBs. This was also the direction I thought about for the tool support. Because we could then have a code generator for this functions so that you can write them platform and system independent in pure IEC 61131-3 ST.
In the mean time I found even a further workaround for your issue. I found a way how you can call other algorithms from your algorithms in ST. For this you unfortunately need to know that our code generator is prefixing the algorithm names in C++ with "alg_". So when you write in your ST algorithm where you like to call an other algorithm called myAlg alg_myAlg the correct code should be generated in your c++ file. This is also a little platform dependant as it would in the beginning only work for our code generator. What we could rather quickly add for you to test (maybe in the code for the upcoming 1.9 version) that we add the prefix during code generation if you are interested to work on a special version of 4daic for tests. Based you your experience we could then work on the new text for the standard. And you could do everything in portable structured text.
P.S.: From your description I would be rather curios on the final result of your application. We would be happy to feature a guest post in our news/blog on what you are doing.
|
|
|
|
Re: declaration of subroutines/functions currently not possible in ST algorithms? [message #1761434 is a reply to message #1761379] |
Thu, 11 May 2017 06:51 |
|
do not know if it is already clear ... we implemented all standard IEC 61131-3 functions and function blocks within 4diac. These function blocks are contained within 4diac's type library > IEC 61131-3 folder. They can be activated in cmake as own module. within a former research project we also integrated armadillo in 4diac, in case you are interested to use something similar within your master thesis.
to implement your own communication layer you should have a look on this
|
|
|
|
Powered by
FUDForum. Page generated in 0.25334 seconds