I have a system that, in case of alarm, have to block.
When the operator logs in must have to acknoledge the alarm and should operate in the system freely.
To perform this I detect the logged User by (VisuElems.CurrentUserGroupID <> 0) with a similar code to the the following:
The problem I have is in the last 5 lines of the code:
Even if there is a logged in user, the GroupID variable is subjected to a refresh that cyclically set for an instant it to 0 and this close the valve making difficult to the user to work
Now I solved it creating a time hysteresys cycle but it is not a good solution.
Someone is able to explane me why the GroupID variable is sobjected to this refresh and how to stabilize to avoiding it?
Thank you in advance,
Riccardo
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure what you are trying to do, but getting the CurrentUserGroupID like this will not work, because there could be multiple Visualization Clients and each can have a different user that is logged in. Also when you go online with CODESYS and open an Visualization, this is counted as a client. Probably this is the reason you see it changing.
The fbIterator, in the example above, should be an instance of an FB which you have created yourself and this must implement VU.IVisualizationClientIteration. For example:
Thanks for the reply.
I don't know if your solution solve my trouble yet, I am going to see the link you sent me.
In the mean time I try to explane better what I need to do.
I have a turbine system that get in alarm under some condition (E.g low speed of turbine) and block the itself. When the system is stoped there is no speed turbine and the system cannot start.
To give to the operetor the possibility to bypass the alarms, there is an acknoledgement alarm pushbutton.
This bypass must not work for everyone but only for those client that perform the login by (User Management).
Furthermore, if the user perform the (manual or automatic) logout in alarm conditions, the acknowlegment must be annulled and block the system again.
To do this, I need to know if an operator is logged in the page and is working to fix the problem; otherwise the syste must autoturn off again.
Now I go to study your solution, if I have explaned better and you have another idea tell me please.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
GoodMorning everyone.
I have a system that, in case of alarm, have to block.
When the operator logs in must have to acknoledge the alarm and should operate in the system freely.
To perform this I detect the logged User by (VisuElems.CurrentUserGroupID <> 0) with a similar code to the the following:
The problem I have is in the last 5 lines of the code:
Even if there is a logged in user, the GroupID variable is subjected to a refresh that cyclically set for an instant it to 0 and this close the valve making difficult to the user to work
Now I solved it creating a time hysteresys cycle but it is not a good solution.
Someone is able to explane me why the GroupID variable is sobjected to this refresh and how to stabilize to avoiding it?
Thank you in advance,
Riccardo
I'm not sure what you are trying to do, but getting the CurrentUserGroupID like this will not work, because there could be multiple Visualization Clients and each can have a different user that is logged in. Also when you go online with CODESYS and open an Visualization, this is counted as a client. Probably this is the reason you see it changing.
What you can to is "iterate" over all clients and then see which user is logged in on which visualization Client. For this you need to add the Visu Utils library to the project and call the FbIterateClients.
See https://content.helpme-codesys.com/en/libs/Visu%20Utils/4.4.0.0/VisuUtils/VisuActionUtilities/Function-Blocks/FbIterateClients.html
The fbIterator, in the example above, should be an instance of an FB which you have created yourself and this must implement VU.IVisualizationClientIteration. For example:
FUNCTION_BLOCK FB_ITERATOR IMPLEMENTS VU.IVisualizationClientIteration
Then automatically the corresponding methods will be called.
In the HandleClient Method, you will get an interface to the client(s) and then you can get the current user through this interface:
itfClient.UserGroupId
You can also get the UserName:
itfClient.UserName
Goodmorning TimvH,
Thanks for the reply.
I don't know if your solution solve my trouble yet, I am going to see the link you sent me.
In the mean time I try to explane better what I need to do.
I have a turbine system that get in alarm under some condition (E.g low speed of turbine) and block the itself. When the system is stoped there is no speed turbine and the system cannot start.
To give to the operetor the possibility to bypass the alarms, there is an acknoledgement alarm pushbutton.
This bypass must not work for everyone but only for those client that perform the login by (User Management).
Furthermore, if the user perform the (manual or automatic) logout in alarm conditions, the acknowlegment must be annulled and block the system again.
To do this, I need to know if an operator is logged in the page and is working to fix the problem; otherwise the syste must autoturn off again.
Now I go to study your solution, if I have explaned better and you have another idea tell me please.