What this does is the following: 1. It sets an item to the user name that just logged in 2. It then triggers the alarm 3. Whenever someone logs in on any other HMI a new login will be logged as an alarm in addition This has the following potential issues: a) If two people login on two different browsers at almost the same time one login user name might not be logged as the context item already has the value of the second user and the first user's login is not logged - instead two logins of the second user will be logged (it's all asynchronous and network latency needs to be considered) b) If you have the HMI open on multiple browser windows each login will be logged multiple times, once by each open HMI and implicitly with a different timestamp (10 HMIs open = 10 user login logs for a single login) - this can be fixed by simply removing this part of the code as it is not required This can work if you only have a single system (i.e. browser window). When using an external tool where you only send the information to this will not happen, because there you send the user name directly and even multiple logins at the same time will be handled (if you tool has been programmed correctly of course). However, when the user logs in to the server itself using the API this will not be logged in both cases.
... View more