I'm assuming you are trying to assign your text variable a value?
If you are, you need to set-up your text variable as a global variable and then put '%s' for strings or '%5.2f' for numbers in the Text property. The properties section is found in the visualization.
Then in the Execute ST Code put something like 'Text_Variable:="STRING";' If you are trying to call a method whenever the text box is clicked, you need to write something like 'ClassObject.Method();' in order to call methods from function blocks inside the Execute ST Code command.
Quick note about the Execute ST Code for input configuration, you can't press enter for a new line without exiting the input configuration. I recommend copying and pasting the code you want to put in there as a way to compensate for this bug.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
rmoudy hat geschrieben:
Quick note about the Execute ST Code for input configuration, you can't press enter for a new line without exiting the input configuration. I recommend copying and pasting the code you want to put in there as a way to compensate for this bug.
Have you tried pressing CTRL + ENTER for a new line? This has always worked for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
Is it possible to call a method from a visualisation?
Hello?
Hi,
have you tried the execute ST-Code option?
BR
Edwin
Yes I tried and could not make it work.
Maybe I did it wrong. Is it supposed to work?
When I tried this I got the following error:
"The input action Execute ST-Code has statements which are no assignments. This feature is only supported for the target visualization."
I'm assuming you are trying to assign your text variable a value?
If you are, you need to set-up your text variable as a global variable and then put '%s' for strings or '%5.2f' for numbers in the Text property. The properties section is found in the visualization.
Then in the Execute ST Code put something like 'Text_Variable:="STRING";' If you are trying to call a method whenever the text box is clicked, you need to write something like 'ClassObject.Method();' in order to call methods from function blocks inside the Execute ST Code command.
Quick note about the Execute ST Code for input configuration, you can't press enter for a new line without exiting the input configuration. I recommend copying and pasting the code you want to put in there as a way to compensate for this bug.
Have you tried pressing CTRL + ENTER for a new line? This has always worked for me.
No, I wasn't aware that CTRL + ENTER is for entering new lines for the 'Execute ST Code'. Thanks for the tip!