Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

  • Explore the new navigation for even easier access to your community.
  • Bookmark and use our new, easy-to-remember address (community.se.com).
  • Get ready for more content and an improved experience.

Contact SchneiderCommunity.Support@se.com if you have any questions.

Close
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
84250members
353350posts

Script to determine who is logged on

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

Solved
jlx
Ensign
Ensign
0 Likes
3
1173

Script to determine who is logged on

Hello, I have a remote site that is running a Geo SCADA standalone to a RTU. I also have a Enterprise SCADA running GeoSCADA. These two sites poll the same controller for DNP3 events, however the systems aren't sync'd in any way (Other than the DNP3 events being polled via radio). 

 

I need to know from the Enterprise SCADA who modified a setpoint or clicked a button. Only way I can think to achieve this is to create a script on the local Geo SCADA that would lookup who is logged on and update a DNP3 point based on user ID. Two questions:

 

Question 1: Is there a better way to sync these two SCADAs without having to write a script (Keeping in mind the Enterprise SCADA is on Radio comms)

 

Question 2: My script below works, however it could be better in that if users are added I would have to update the script. How do I determine who is logged on via ST, other than my current approach? 

 

PROGRAM ActiveUser

VAR

u01on AT %I(System.Security.Users.Engineer.IsLoggedOn): BOOL;
u01id AT %I(System.Security.Users.Engineer.Id): DINT;
u02on AT %I(System.Security.Users.Operator.IsLoggedOn): BOOL;
u02id AT %I(System.Security.Users.Operator.Id): DINT;
u03on AT %I(System.Security.Users.Supervisor.IsLoggedOn): BOOL;
u03id AT %I(System.Security.Users.Supervisor.Id): DINT;
u04on AT %I(System.Security.Users.SysAdmin.IsLoggedOn): BOOL;
u04id AT %I(System.Security.Users.SysAdmin.Id): DINT;

Output AT %M(System.Security.ActiveUserID): DINT;

END_VAR;


IF u01on = 1 THEN
Output := u01id;
ELSIF u02on = 1 THEN
Output := u02id;
ELSIF u03on = 1 THEN
Output := u03id;
ELSIF u04on = 1 THEN
Output := u04id;
ELSE
Output := 99;
END_IF;

END_PROGRAM

 

Thank you!


Accepted Solutions
BevanWeiss
Spock
Spock
0
1161

Re: Script to determine who is logged on

Does this Logic routine actually do what you want?

 

I thought the problem was 2 ClearSCADAs and 1 cup RTU..  but your logic only appears to look at the one Enterprise SCADA.

 

As Jesse mentioned, looking at the Event Journal is probably the 'nicest' way to identify which user performed an action on the points associated with the shared RTU.  But this would need to be the Event Journal on each ClearSCADA instance right? (i.e. User A might be logged into ClearSCADA A and issuing the control, or User B might be logged into ClearSCADA B and issuing the control).

This situation is quite a bit trickier.  If you only have a radio link between the Enterprise SCADA and the Local SCADA that adds some more challenges.

 

What you could do is:

Have an ODBC point at each end which provides the username and timestamp of the last person that executed a command to the RTU. At the Enterprise SCADA end, also have an OPC (or other comms link) to the Local SCADA to read out the username/timestamp from the Local SCADA.  Then at the Remote SCADA you just look at which timestamp is more advanced.  and they were the last user to issue a control.  If you want that info for each point... it starts to all add up, and the radio link might not be so nice (strings are never good telemetry data).

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..

See Answer In Context

3 Replies 3
JChamberlain
Schneider Alumni (Retired)
Schneider Alumni (Retired)
0 Likes
1
1169

Is that Re: Script to determine who is logged on

Is that a script or logic? It looks like logic. They are two very different things in Geo SCADA!

 

My first suggestion to refine your approach would be to query the CDBUser table for that same field/column.

 

The other is rather than seeing who is logged in, query the event journal so you can see exactly who did what and when.

 

Adam's table here might also be useful.

AdamWoodland
Commander Commander
Commander
0 Likes
0
1166

Re: Is that Re: Script to determine who is logged on

If the logic program is called from a script on a mimic (you mention clicking a button), you can always pass the user name in as an input using VAR_INPUT.

 

As Jesse says, logic and scripting are two very different beasts, need to be careful what you're using and how (for example logic has no context of a user)

BevanWeiss
Spock
Spock
0
1162

Re: Script to determine who is logged on

Does this Logic routine actually do what you want?

 

I thought the problem was 2 ClearSCADAs and 1 cup RTU..  but your logic only appears to look at the one Enterprise SCADA.

 

As Jesse mentioned, looking at the Event Journal is probably the 'nicest' way to identify which user performed an action on the points associated with the shared RTU.  But this would need to be the Event Journal on each ClearSCADA instance right? (i.e. User A might be logged into ClearSCADA A and issuing the control, or User B might be logged into ClearSCADA B and issuing the control).

This situation is quite a bit trickier.  If you only have a radio link between the Enterprise SCADA and the Local SCADA that adds some more challenges.

 

What you could do is:

Have an ODBC point at each end which provides the username and timestamp of the last person that executed a command to the RTU. At the Enterprise SCADA end, also have an OPC (or other comms link) to the Local SCADA to read out the username/timestamp from the Local SCADA.  Then at the Remote SCADA you just look at which timestamp is more advanced.  and they were the last user to issue a control.  If you want that info for each point... it starts to all add up, and the radio link might not be so nice (strings are never good telemetry data).

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..