Hi.
Picture "1" shows the number of vision clients.
I would like to express this quantity from a perspective.
For your information
https://docs.inductiveautomation.com/display/DOC81/System+Tags
It's not on this site.
Please tell me how I can display the quantity.
Hard to believe that [System]Gateway/Sessions/SessionCount
doesn't exist.
But, it can be done through scripting.
https://docs.inductiveautomation.com/display/DOC81/system.util.getSessionInfo
I did it in the way you told me
I'd like to extract the yellow part of picture number 1 as a quantity, so please tell me how to do it.
something along the lines of:
sessionInfo = system.util.getSessionInfo()
clientCount = len([x for x in sessionInfo if not x['isDesigner']])
You need to return the result
Change it to
sessionInfo = system.util.getSessionInfo()
return len([x for x in sessionInfo if not x['isDesigner']])
1 Like
It was solved by doing it the way you told me.
Why did you put the "x" in front of "for" in the method
"return len([x for x in session Info if not x ['isDesigner'])" ?
This is an example of list comprehension. The x is merely a generic variable name.
4 Likes