You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old February 22nd, 2012, 10:20 AM   #1
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
WinCC Flexible - Graying out buttons

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?
  Reply With Quote
Old February 22nd, 2012, 10:31 AM   #2
Jeebs
Member
Belgium

Jeebs is offline
 
Join Date: Feb 2007
Location: Leuven
Posts: 1,059
Have you checked out the UserGroup?

EDIT:
I'm in a generous mood.
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 by Jeebs; February 22nd, 2012 at 10:39 AM.
  Reply With Quote
Old February 22nd, 2012, 10:33 AM   #3
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 16,132
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.
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ
  Reply With Quote
Old February 22nd, 2012, 10:42 AM   #4
Jeebs
Member
Belgium

Jeebs is offline
 
Join Date: Feb 2007
Location: Leuven
Posts: 1,059
Hmmm, sniped by Jesper when I was still editing...
  Reply With Quote
Old February 22nd, 2012, 10:44 AM   #5
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
Quote:
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!

Last edited by RMA; February 22nd, 2012 at 10:58 AM.
  Reply With Quote
Old February 22nd, 2012, 10:46 AM   #6
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 16,132
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).
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ
  Reply With Quote
Old February 22nd, 2012, 11:22 AM   #7
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
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.
  Reply With Quote
Old February 22nd, 2012, 11:22 AM   #8
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 16,132
Quote:
Originally Posted by RMA View Post
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.
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ

Last edited by JesperMP; February 22nd, 2012 at 11:25 AM.
  Reply With Quote
Old February 22nd, 2012, 11:27 AM   #9
JesperMP
Lifetime Supporting Member + Moderator
Denmark

JesperMP is offline
 
JesperMP's Avatar
 
Join Date: Feb 2003
Location: ᚴᚬᛒᛅᚾᚼᚬᚠᚾ
Posts: 16,132
Quote:
Originally Posted by RMA View Post
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.
__________________
Jesper
NOTICE:
JesperMP has passive-aggressive tendencies, can be impolite and may even use sarcasm !
Also: ᛁᚠ ᚢᚬᚢ ᚴᚬᚾ ᚱᛅᚬᛏ ᚦᛁᛋ ᚦᛅᚾ ᚢᚬᚢ ᚼᚬᚠᛅ ᚴᚬᛁᚾᛅᛏ ᛘᚢ ᚱᛅᛋᛒᛅᚴᛏ
  Reply With Quote
Old February 22nd, 2012, 12:04 PM   #10
Jeebs
Member
Belgium

Jeebs is offline
 
Join Date: Feb 2007
Location: Leuven
Posts: 1,059
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.
Attached Images
File Type: jpg User_logon.jpg (36.8 KB, 110 views)
  Reply With Quote
Old February 22nd, 2012, 12:29 PM   #11
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
@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.
  Reply With Quote
Old February 22nd, 2012, 12:38 PM   #12
Jeebs
Member
Belgium

Jeebs is offline
 
Join Date: Feb 2007
Location: Leuven
Posts: 1,059
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.
  Reply With Quote
Old February 22nd, 2012, 12:47 PM   #13
RMA
Member
Scotland

RMA is offline
 
RMA's Avatar
 
Join Date: Sep 2004
Location: North of Hamburg, Germany
Posts: 2,052
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
  Reply With Quote
Old July 4th, 2015, 05:25 AM   #14
SteveJDRG
Member
Australia

SteveJDRG is offline
 
Join Date: Jul 2015
Location: Perth
Posts: 3
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 ?????
  Reply With Quote
Old July 4th, 2015, 06:56 AM   #15
cjd1965
Lifetime Supporting Member
United Kingdom

cjd1965 is offline
 
Join Date: Apr 2007
Location: UK
Posts: 1,659
Language settings....is the project and the edit language the same?
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Citect Vs WinCC - Long Doug_Adam LIVE PLC Questions And Answers 22 October 3rd, 2014 02:56 PM
Wincc flexible tag multiplex - buttons cjd1965 LIVE PLC Questions And Answers 3 November 11th, 2010 03:17 AM
Why cant OPs state the "Flexible" in WinCC Flexible ? JesperMP LIVE PLC Questions And Answers 0 August 5th, 2008 03:41 AM
WinCC Flexible Quirks tvey LIVE PLC Questions And Answers 5 May 3rd, 2007 07:57 AM
Simatic Wincc Flexible 2004 -->2005 STL??? LIVE PLC Questions And Answers 8 August 29th, 2006 07:42 AM


All times are GMT -4. The time now is 08:35 AM.


.