Execution of code in a frame background

2023-02-28
2023-02-28
  • automatisme - 2023-02-28

    Is it possible to run the program in a frame, in a continuous way?

    For example, to animate an element with something else than a boolean (update the result of an equation in a boolean that will be used to animate an element)

    Or to return the value of a constant defined in the frame to the automaton program in a permanent way (in order to have a "CURRENTFRAME" variable, as we have a "CURRENTVISU", to inform the main program which frame is displayed)

    Any idea?

     
  • tvm - 2023-02-28

    I've done this by creating a function with return type BOOL, then calling the function from an element in its State variables/Invisible property.

     
    • automatisme - 2023-02-28

      Great!

      However, the created program does not have access to the internal variables of the visualization. Is there a way to access them?

      Thanks in any case, this should help me out.

       
  • tvm - 2023-02-28

    You can access external variables by using VAR_IN_OUT in the function. Depending on how fancy you need to get, you could even declare a function block in the visu itself and call methods of it in the same way.

     

    Last edit: tvm 2023-02-28
    • automatisme - 2023-02-28

      Yep. Normaly with this I should be able to do wathever I need!

       

Log in to post a comment.