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

Execute on Visu open

  • sjdebdaly

    sjdebdaly - 2016-12-14


    I was wondering whether there is a way of executing code on when a specific visu has been opened.

    E.g., I want to pass a visu a DATE_AND_TIME, but I need to use DTSplit on it so I can populate various elements with the year, month, day, etc.

    Note - I'm using CODESYS, which has a bug where I cannot initialise visu variables properly, and I cannot upgrade to SP9 at this moment in time.

  • Comingback4u

    Comingback4u - 2016-12-15

    I use also but I'm not aware of the bug you are talking about so not sure if this will help.

    If you open up your Visualization Manager and check the box that says "Use CurrentVisu Variable" you can setup a trigger to run like:

    //sudo code not checked
       fb_PageCheckTrigger   :   R_TRIG;
       sPage            :   STRING   :=   'Home';
    fb_PageCheckTrigger(CLK:= VisuElemes.CURRENTVISU = sPage);
    IF fb_PageCheckTrigger.Q THEN
       //Code to execute when page is open

Log in to post a comment.