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

Opening or managing Visualisations from the code

2019-04-11
2019-04-24
  • AndrewwFesto - 2019-04-11

    Hi Guys I am trying to write some code and it involves many Visualisations.

    Currently I use frames and then use the invisible state to hide the ones I don't need at the time. Part of the reason for this is I want the visualisations to change with the step no.

    I have seen there is code on here to put a dialog box on the screen but what I really would like to do is change the shown visualisation. Doing it the other way with making the frames invisible results in a really laggy interface where the boxes don't always open and shut properly. Any ideas ?

    Kind regards

    Andrew

     
  • Dave-76 - 2019-04-11

    If you want to show the same Visu at all VisuClients, in the visualization manager you can set the checkbox "Use Currentvisu variables".
    Then you can set the actual visu very simple like this:
    if .... then
    VisuElems.CURRENTVISU:='Visu1'; //type the name of the visu to be shown between the ' '
    end_if
    if .... then
    VisuElems.CURRENTVISU:='Visu2';
    end_if

     
  • m.prestel - 2019-04-24

    Hello Andrew,
    you could also use the switch frame variable to switch between frames instead of hiding each frame.

    The best way to switch a visu is the provided answer by Dave_76.

    Best regards,
    Marcel

     
  • m.prestel - 2019-04-24

    Hello Andrew,
    sorry for the double post.

    For changing the visu you can also use the "new" Visu Utils library. Check out https://help.codesys.com/webapp/t6Wggu4 ... n=3.5.12.0 for more.

    Best regards,
    Marcel

     

Log in to post a comment.