Calling REXYGEN block from PYTHON
-
Hi, I wonder if it's possible to call some standard REXYGEN block from python code embedded inside PYTHON block.
Let's say I use PYTHON block and its main() function needs to solve some optimization task using python solver for predicitive control . To do so, I need to compute cost function, therefore I need to call parallel simulations to predict the states over some prediction horizon. Currently I can run such parallel simulation (time-scaled, faster) using REXLANG and its CallExt functions such as CallExt(".STATESAVE"), CallExt(".STATELOAD"); and CallExt(".SubModel") inside FOR loop inside main(void) of the REXLANG. Now I'd like to create similar solution using python code but I see no way how to call REXYGEN blocks from python. Any help appreciated. Thanks Stepan -
@stepan-ozana Hi Stepan,
thanks for your question. It is not possible to call REXYGEN function blocks within the PYTHON block. The implementation of this functionality is not scheduled yet.
Kind regards,
Tomas -
@cechurat Thanks for info. As my model of the plant is created in external program in the form of FMU, I found that I could run fast parallel simulations in order to compute my cost function over future prediction horizon using https://github.com/CATIA-Systems/FMPy which can be called from the PYTHON block within the REXYGEN project
-
@stepan-ozana Thanks for sharing your solution with the community!
Good luck with your project.
Tomas