Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • Create a "Standard project" and select CODESYS Control Win V3 as the device.
  • Define the target system by means of the Netzwork scan.
    Image Removed
    Image Added

  • Insert a visualization in the device tree.
    Then the Visualization Manager is inserted with the visu types TargetVisuand WebVisu.

    In addition, a Visu_Task is also created automatically.

    Image AddedImage Removed

  • Create a new POU named ClientInfo and call it from Visu_Task.

    Info

    The call of the ClientInfo POU must originate from the Visu_Task because only then is the required client handle passed.


    Image AddedImage Removed

  • Adapt the ClientInfo POU as follows:



    Section
    Column
    width7

    Declaration

    Column
    width93
    Code Block
    themeConfluence
    VAR
        pClient       :    POINTER TO VisuElems.VisuElemBase.VisuStructClientData;
        helper        :    VisuElems.VisuFbClientTagDataHelper;
        s1            :    STRING;
    END_VAR




    Section
    Column
    width7

    Implementierung

    Column
    width93
    Code Block
    themeConfluence
    VisuElems.g_ClientManager.BeginIteration();
    
    WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
        IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
            helper(pClientData := pClient);
            s1 := helper.stIPv4;
        END_IF
    END_WHILE




...

  • Start the project and set a breakpoint in line 6 of the ClientInfo POU.

    Image Added

  • Open a browser and type in the following address: http://localhost:8080/webvisu.htm
  • After the client has connected, execution is halted at the breakpoint and the IP address can be read.
    Image Removed
    Image Added

    Note

    The information is available only for web clients. A TargetVisu connected to the controller does not contain this information.