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

Webvisu : know ip of current user

galexis
2021-05-20
2021-08-07
  • galexis

    galexis - 2021-05-20

    Hi,
    Is it possible pour know address iP of current user of webvisu ? Or name of computer ?
    Thanks for your answer.

     
  • galexis

    galexis - 2021-05-23

    Hi,
    ok it work for the highter CurrentClientId, but I want store IP for heach client ID in array.
    How can I do this ?

     
  • dkugler

    dkugler - 2021-05-23

    extend the s1 variable to an array of strings.
    Then increase the index after the ip is ccopied to s1[i] in the while loop.
    The while loop iterates trough all filtered web visu clients.
    Important hint: Don't miss to reset the index before starting the iteration loop ;-)

     
  • galexis

    galexis - 2021-05-27

    I put in array of string value of iP from variable S1 :

    MyArray[pClient^.GlobalData.GlobalClientID].my_iP := s1;
    

    Thank you very much.

     
  • dkugler

    dkugler - 2021-05-27

    πŸ‘ŒπŸ‘

     
  • galexis

    galexis - 2021-06-19

    Is it possible to know name of computer?

     
  • galexis

    galexis - 2021-07-04
    VisuElems.g_ClientManager.BeginIteration();
    //DΓ©tection les adresses iP des clients connectΓ©s 
    WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
        IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
            helper(pClientData := pClient);
            IP_temp[PRG_IP_CLIENT.pClient^.GlobalData.GlobalClientID]:=helper.stIPv4;
        END_IF
    END_WHILE
    

    The solution use GetNextClient, but SP17 produce a warning. This method is obsolete. How replace this by VisuUtils ?
    I don't find in library VisuUtils....What is the real name ?

    This solution don't detect if codesys softwar is connected to webvisu: is it possible to detect it ?

     
  • m.prestel

    m.prestel - 2021-07-05

    Hello @galexis,
    attached you can find an example applicaiton using visu utils (note this example is not made by me but it works fine)

    Best regards,
    Marcel

     
  • galexis

    galexis - 2021-07-05

    Very good code ! It work fine !
    Is it possible to know resolution of client's screen to adjust display ?

     
  • galexis

    galexis - 2021-08-07

    Some boby can help me to add resolution detection with project example "Visu Util Iterate" ?
    I don't understand how work method and pointer THIS ou SUPER ?
    I this resolution are in "pClient.pClient^.rClientRect.ptBottomRight.iX or iY, but how catch them ?

     

Log in to post a comment.