Access timer value property from client script

I was saving the timer value to a tag and used the tag in my scripting but then every second gets recorded to my audit log which is excessive and makes the audit log hard to read.

If there is way I can read the time value from the client script this will save my sanity. But I’m having trouble calling it. Any tips or ideas, or is this even possible?

Thank you!

Where is the timer?

@pturmel it is on my nav - navigation window, which is a main window.

You mean a timer component in a Vision window? If so, consider bidirectional binding to a client tag, not a gateway tag. Then read that in your other scripts. However, if the main window closes, the timer value stops. Are you sure you shouldn’t be using a timer event instead? Or for control purposes, a gateway timer event?

@pturmel Yes it is a timer component in a vision window. Essentially it is being use to log people out after a pre determined amount of time on non-critical windows, and on critical windows it will not log said user out. User clicks on window > script resets timer value, turns on countdown display, and starts the timer. ( on non critical windows) on critical windows it disables the timer so the condition will never be met. In the client timer script it executes every second to examine the value of the time. When timer value equals pre determined time, it will initiate my log out process i.e. switching to logged off window > disabling and resetting the timer, switching to default user etc…

I have it working with timer value being binded to a tag. My issue is when I look up the audit log to see who done what its cluttered with the timer value tag being written to every second it is on. This makes it very hard to navigate user actions.

This is why I was hoping to reference the property instead of a tag binding. Because then those seconds won’t be logged to the audit.

Well, a tag binding also suffers from the fact that regular tags are global to all open clients–your different clients will stomp on each other. The audit log noise is just another nuisance.

Consider using and modifying the example auto-logout functionality that uses the built-in inactivity timer (like in the starter projects that have navigation in the sidebar). Instead of arbitrarily logging out, loop through the list of current open windows to see if one is a critical window.

@pturmel I do have a version I did with the inactivity feature. My only issue was it resets the timer anytime you touch the screen even if you do not click on anything. Thus extending the time someone can stay logged in past the pre determined logout time.

@pturmel If I use a client tag, there should be no issue with stomping on each other. just noise in the log.

Shouldn’t even have that, as client events get logged locally.

2 Likes

@JordanCClark not my best day haha. thank you.