REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Calling REXYGEN block from PYTHON

    General
    2
    4
    252
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      stepan.ozana
      last edited by

      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

      cechuratC 1 Reply Last reply Reply Quote 0
      • cechuratC
        cechurat @stepan.ozana
        last edited by

        @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

        S 1 Reply Last reply Reply Quote 0
        • S
          stepan.ozana @cechurat
          last edited by

          @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

          cechuratC 1 Reply Last reply Reply Quote 0
          • cechuratC
            cechurat @stepan.ozana
            last edited by

            @stepan-ozana Thanks for sharing your solution with the community!

            Good luck with your project.

            Tomas

            1 Reply Last reply Reply Quote 0
            • First post
              Last post

            This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

            There is also an outdated REXYGEN community forum.

            Powered by NodeBB.