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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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... :/
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
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
I think what you want is a declaration period function for the page, but unfortunately CODESYS does not have it.
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.
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... :/
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.