Calling methods from visualisation

2016-06-08
2017-03-13
  • yannickasselin1

    yannickasselin1 - 2016-06-08

    Hi all,

    Is it possible to call a method from a visualisation?

     
  • yannickasselin1

    yannickasselin1 - 2016-06-10

    Hello?

     
  • eschwellinger

    eschwellinger - 2016-06-13

    Hi,

    have you tried the execute ST-Code option?

    BR
    Edwin

    IMG: ExecuteStCode.jpg

     
  • yannickasselin1

    yannickasselin1 - 2016-06-13

    Yes I tried and could not make it work.

    Maybe I did it wrong. Is it supposed to work?

     
  • rickj

    rickj - 2016-06-13

    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."

     
  • rmoudy

    rmoudy - 2017-03-10

    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.

     
  • Comingback4u

    Comingback4u - 2017-03-10

    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.

     
  • rmoudy

    rmoudy - 2017-03-13

    Comingback4u hat geschrieben:
    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!

     

Log in to post a comment.