CloseTargetVisu

mascara
20 hours ago
2 hours ago
  • mascara - 20 hours ago

    I need to add a button to the Visualization to close it. And create a shortcut on the Windows desktop to reopen the Visualization.

    This is necessary to configure, for example, a local IP address.

    Is this possible?
    What command closes the Visualization?
    Which program opens Visualization?

    System: Win10
    Codesys: Control RTE V3 x64
    Program: Codesys V3.5 SP20
    Using only a touchscreen monitor, without keyboard and mouse.

     
  • yannickasselin - 7 hours ago

    To shutdown the TargetVisu:

    Add the VisuElemBase library to your project then call VisuElemBase.Visu_PRG.RemoveAllTargetVisuClients();

    Exemple:

    PROGRAM PLC_PRG
    VAR
        xShutdownTargetVisu:    BOOL;
    END_VAR
    ----------------------------------
    IF xShutdownTargetVisu THEN
        xShutdownTargetVisu := FALSE;
        VisuElemBase.Visu_PRG.RemoveAllTargetVisuClients();
    END_IF
    

    I tried calling RemoveAllTargetVisuClients() directly from a button mouse click event but it makes the Visu crash. So better using the code above and just set xShutdownTargetVisu to TRUE from the button. Works fine for me.

    To start the TargetVisu:

    From a cmd prompt. This will start the TargetVisu
    C:\Program Files\CODESYS\CODESYS Control RTE3>VisualClientController.exe --application=Application --flags=1

    You can then place a .bat file on the desktop and put this inside:

    CD "C:\Program Files\CODESYS\CODESYS Control RTE3"
    VisualClientController.exe --application=Application --flags=1
    exit
    

    Double clicking the .bat file will start the TargetVisu.

    You may need to replace the Application name by your own application name.

    Good to know:
    In the cmd above, if you replace --flags=1 by --flags=2, it will shutdown the TargetVisu.

     
  • mascara - 2 hours ago

    Thank you, it worked perfectly.

     

Log in to post a comment.