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

Calling methods from visualisation

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

    Hi all,

    Is it possible to call a method from a visualisation?

     
  • 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 - 2016-06-13

    Yes I tried and could not make it work.

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

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

     
  • Lo5tNet - 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 - 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.