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

frames with click elements

tvm
2022-12-02
2022-12-03
  • tvm - 2022-12-02

    I've create a visu with a single checkbox, associated with an interface variable

    TestClickFrame_VISU
    VAR_IN_OUT
        TestVar:    BOOL;   //referenced by the "Variable" property of the checkbox in the visu
    END_VAR
    

    I then create another visu, "TestClick_VISU", which contains a single frame, referenced to TestClickFrame_VISU
    On that frame, I assign the "OnMouseClick" Input, which is configured to execute the following code:

    Test_PRG.TestVar2:= Test_PRG.TestVar2 + 1;
    

    The OnMouseClick event of the frame works, I can see the variable counting up.
    However, the checkbox variable doesn't work

    I would expect to see a click event transfer through to underlying frames. Is it supposed to work that way? I can't find any information about this.

    The same happens with an invisible input object. The click event is only handled on the invisible input, but any elements below it are not.

     
  • Strucc.c

    Strucc.c - 2022-12-03

    The easiest thing you can do is to add a code to ""OnMouseClick"" input:

    TestVar:= NOT TestVar;
    

    Other option is to bind TestVar to ""Input configuration / Toggle / Variable""

     
  • tvm - 2022-12-03

    Yeah I understand that, but some visu elements don't have the OnMouseClick input. Checkboxes and Combo Boxes, for example. So in the example, I want to more than just check the box on a Checkbox element, I also want to set a variable.

     

Log in to post a comment.