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

login and webvisu

galexis
2019-11-14
2020-01-17
  • galexis - 2019-11-14

    Hi,
    how to switch on a light on webvisu, when user is login ?
    Thanks for your help.
    Bets regards

     
  • marks - 2019-12-10

    I'm doing this one on one project, and it works well:

    // provide a readable user name, if there isn't one
    HMI.currentUser := WSTRING_TO_STRING( VisuElems.CurrentUserName );
    IF ( LEN( HMI.currentUser ) <= 0 ) THEN
    HMI.currentUser := 'None';
    END_IF
    _loggedIn := ( HMI.currentUser <> 'None' );

    Use _loggedIn as a Boolean variable driving a lamp/indicator state.

    Good luck,

    Mark

     
  • dkugler - 2019-12-10

    Originally created by: D. Kugler

    You can set the property "Variable" of the lamp directly to the following: VisuElems.CurrentUserGroupId<>0
    UserGroupID 0 belongs to User "None" and appears if nobody is logged in.
    Don't forget to set the checkbox "Use CurrentVisu variable" in the General Settings of the Visualization Manager!
    The UserGroupID's are shown in the Visualization Manager:

    IMG: UserGroupID1.JPG

    IMG: UserGroupID2.JPG

    IMG: UserGroupID.JPG

     
  • galexis - 2020-01-17

    Thank you very much . But I haven't go VisuElems.currentusergroup is variable....Library VisuElems is install.

     

Log in to post a comment.