WinCC Flexible - Graying out buttons

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
I've currently got a project where I need to grey out buttons if the current user doesn't have a high enough priority to be allowed to operate them. In ProTool I could solve this quite easily by laying a greyed out copy of the switch over the symbol for the switch itself and using the visibility attribute to "remove" the field if the user had a sufficiently high priority.

I'm having trouble finding a way to do this in Flexible because I can't find a way to use the user's authorisation level as a variable to switch the visibility attribute. In fact I can't find any way to query the current user's authorisation level in order to then switch a separate variable for the visibility control.

Has anybody any thoughts on how I can solve this problem?
 
Have you checked out the UserGroup?

EDIT:
I'm in a generous mood. :D
Device Settings > Scheduler > Create new Job with Event "Change user" > Function: User Administration: Trace user change > Function: User Administration: GetGroupNumber.
This will be the same number you configure in the Runtime User Administration.
Link this with the visibility option and you're done.
 
Last edited:
Under Device Settings ... Scheduler add the system functions GetGroupnumber, GetUserName (maybe) and TraceUserChange to the event Change User. Specify a suitable internal tag to store the Group Number.
You can then query the userlevel by the GroupNumber anywhere in the HMI program.

If you have a lot of buttons or i/o fields you want to animate this way, or several userelevels, it will be somewhat of a chore to program.
 
If you have a lot of buttons or i/o fields you want to animate this way, or several userelevels, it will be somewhat of a chore to program.
There are about a dozen buttons in all, however, I can probably group them so that several share the same variable.

Thanks to both for the route - I hadn't discovered it and the help file was about as much use as it ever is for me!

Edit: The GetGroupNumber function looks like it should do exactly what I want - if I could only persuade it to work!

In the old ProTool Program I only had the ShowLogonDialog command attatched to the Login button so I reckoned I needed to add the Login Function as well which then stores the User Name and Password, however, for some reason it's still not storing the GroupNumber.

I guess I'll have to do a bit more reading.

At least I don't need to worry about any time constraints, final commissioning isn't due until late 2013! (y)
 
Last edited:
You can also just select many buttons at one time and do the animation edits on all the selected buttons. But it gets complicated if there are many userlevels, or maybe even groups with more or less overlapping authorisations (new feature in WinCC Flex over Protool).
 
Just read the help file for the "Logon" function and there it says that the User name and Password variables are the variables from which the User Name and Password are read! I don't really understand where you would want to use that, but it looks as though that's not the function I require to persuade Flex to store my User level when I log on.

Looks like I need to do some further investigation.
 
In the old ProTool Program I only had the ShowLogonDialog command attatched to the Login button so I reckoned I needed to add the Login Function as well which then stores the User Name and Password, however, for some reason it's still not storing the GroupNumber.
It is the event Change User that does everything. If it worked the way you describe, only the logon would be reported, the automatic logout due to timeout would not be reported.

For debugging and general awareness of the currently logged-in user, I have both username and user group number on the template so it shows on every screen. Right next to the logon and logoff buttons.

edit: Just follow the advice of addings the mentioned functions to the Scheduler event Change User. Then it will work.
 
Last edited:
Just read the help file for the "Logon" function and there it says that the User name and Password variables are the variables from which the User Name and Password are read! I don't really understand where you would want to use that, but it looks as though that's not the function I require to persuade Flex to store my User level when I log on.
This is for when you do NOT use the standard login dialog box. It is for when for example the PLC tells you the username and password. Ignore it.
 
This is our current configuration.
The tags are then used to display Username and Usergroup (with textlist) on each Screen.
Setup is almost identical to Jesper's.

Every time a user logs in or out, the tags will be updated.

User_logon.jpg
 
@Jeebs, with the exception of the GetUserName, that's exactly what I've done and in my case the Group Number is stored in my old "Password_Level" variable from the old ProTool program.

I'll have to have a closer look at where it's being accessed, maybe something got screwed up in the conversion to Flex or else I'm maybe overwriting "Password_Level" somewhere else in the program.
 
Make sure to put the Traceuserchange first in the list.
Use a new variable just to check if the function is working as intended.
Your user does need to be part of a group however.
If he is locked out, ie entered wrong pass 3 times, its user group will be set to 0.
 
Things are getting very strange now. I went online to test and suddenly had a load of alarm messages at the runtime startup which I hadn't had before (also the Admin password had been changed - although that's something that seems to happen on a regular basis, haven't a clue why!). I then decided to go back offline and create a new variable to store the group number in, which obviously was no problem, but when I then went back into the Scheduler to change the variable, the "GetGroupNumber" function has disappeared!!!!

Under "User administration" there is only "GetUserName" available!

I think it's time to stop or today! I'm off down to the customer tomorrow and I'd like to have had this finished, but he only needs the functionality to do the system checks, so it will suffice for the time being if I just leave all buttons available.

Then on Friday I can try and find out where my "GetGroupNumber" function has got to!

Cheers for now

Roy
 
OK I have inherited a project where ALL buttons are hidden. Even if I create a new screen with anew button , it is invisible. I've checked everything...does anybody have any ideas ?????
 

Similar Topics

Hi, We have upgraded our laptop which includes Windows 11. It appears that WinCC flexible 2008 advanced does not support Windows 11. What...
Replies
11
Views
268
Hello everyone I Have an Issue with the usage of recipes in Wincc Flexible 2008, I create the recipe to change the values in a fast way The...
Replies
0
Views
107
Hi colleagues.We do data logging system.We want to record three temperatures under a certain condition. We prepared the project as follows. We do...
Replies
1
Views
755
Hello to everyone. I change the value of a "PQW" with a button in Wincc flexible. The code of the button is defined as M102.0. Value reset...
Replies
10
Views
4,580
Hello Friends I have installed WinCC Flexible 2008 SP5 Update 2. I have open the software, but the Transfer option does not appear. Is It...
Replies
2
Views
1,477
Back
Top Bottom