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

Toggling Visualizations using HMI Physical Buttons

nmcc
2024-02-12
2024-02-13
  • nmcc - 2024-02-12

    Hello, I am extremely new to using codesys. I have an IFM CR1102 HMI with physical buttons on the right side. I need to have these buttons toggle which visualization is active. I currently have ladder logic for when the button is pressed just need the action side for setting the active visualization. Any help is appreciated.

     
  • dkugler - 2024-02-13

    the magic option is named "Use CurrentVisu variable"
    activate this option in the Visualization Manager an have a look:
    https://help.codesys.com/webapp/_visu_obj_manager;product=core_visualization;version=3.5.14.0

    if your button is pressed, "feed" the string varable VisuElems.CurrentVisu := 'visu1'; with the correct name of the depending visu.
    alternative: place a frame element at a empty main visu, konfigure all visus to be shown by this frame.
    With setting the switching variable of the frame to the index value of the depending visu, it will switch to it.
    Advantage: the visu names are not hardcoded as string in the ladder lodgic. Good luck!
    Hint: If you have multiple VisuClients(Target, WebVisu,...) all will show the same visu. Independent switching is much more difficult, but there is a example from codesys.

     
    • nmcc - 2024-02-13

      Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,

       
    • nmcc - 2024-02-13

      Hey thank you for the reply dkugler. I am sorry if this seems like a stupid question. I have the use current visuvariable checkbox enabled. I can see the string names of all my visualizations. I am trying to use ladder logic to be the anser to the button press using "VisuElems.CurrentVisu := 'MainScreen';. This returns an error. Any idea what I am doing wrong or could you point me in the right direction for fixing this. Thanks,

       
  • dkugler - 2024-02-13

    post a screenshot of the ladder and the error message. I'm not able to have a lock at your monitor actually :-)

     
    • nmcc - 2024-02-13

      Here is a screenshot. I really do not know how to format the variable exchange you are talking about.

       
    • nmcc - 2024-02-13

      Here is a screenshot. I really do not know how to format the variable exchange you are talking about.

       
  • dkugler - 2024-02-13

    learn to program in structured text or CFC and forget this antique ladder logic..
    I'm not firm to do that in ladder

     

Log in to post a comment.