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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
how to switch on a light on webvisu, when user is login ?
Thanks for your help.
Bets regards
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
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:
Thank you very much . But I haven't go VisuElems.currentusergroup is variable....Library VisuElems is install.