Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Visualization using methods and cyclic ST-calls

sturmghost
2023-10-02
2024-03-03
  • sturmghost - 2023-10-02

    Im looking for a way to implement ST-code into the visualization element without creating a helper POU or method in my device/application tree.

    Like visualization properties are evaluated at each VISU_TASK cycle I want to be able to create own ST code which interacts with the visualization interface variables.

    To be more specific I want to have a property which executes user defined ST-code at each VISU_TASK cycle exactly like its already possible for Input Configuration on various mouse and dialog events. Also a property for initialization (so only executed once) and a timed property would be nice.

    With the situation right now I'll have to create a POU function which handles the ST-code and misuse a property, like the text variable, to execute this POU function at each VISU_TASK cycle.

    Or does it exist and I don't know it?

     
  • TimvH

    TimvH - 2023-10-03

    I think you want to implement client side scripting?
    Maybe creating HTML5 objects is an option, because the JavaScript is executed on the client side.

    See html5

     
  • SiegeLion - 2023-10-17

    I think what you want is a declaration period function for the page, but unfortunately CODESYS does not have it.

     
  • sturmghost - 2024-01-22

    I found a way to do it:

    You can use, for example, the text variable property of any visualization element and call a function in it.

    Example: Write a test POU as a function (FUN), like MyTestFun which need a boolean Variable as an input value.

    Now write into the text variable property:

    MyTestFun(bBooleanValue)

    Thats it. The function is called at each visu_task cycle.

     
    • macros8 - 2024-03-01

      Have you found the way how to call any function in case the visu is opened? Like on event when the screen is opened to initialize some variables etc.? I canΒ΄t... :/

       
      • sturmghost - 2024-03-03

        Not sure what you mean but you can define a visu initialization program and call it once at the visu initialization step. Look in the Visualization Manager there is a possibility to define such a program.

         

Log in to post a comment.