Assign a max number of clients (licenses) to a project

Hello,

we have a WebIQ server with two different projects that are HMIs for the same machine, but with a different focus. One is more a viewer, while the other one is rather to control it. (But it's more than just about access rights to individual controls)

We do have 7 licenses for the server and now would like to make sure that the "control" project has always at least one license available, not matter how many clients are connected to the "viewer" project.

I found this post:

https://community.boschrexroth.com/smart-hmi-webiq-designer-and-server-zqilynus/post/limit-the-number-of-client-connection-in-webiq-zJltYzr6zrUDCzW

That seems to address my question. It say's it's not possible. But the post is 2 years old, so I thought it's okay to ask again. Is there a way to do that?

If there is no direct way, the post above mentions a way to count the connected clients. Is there maybe a workaround from inside the project to count the connected clients and deny further connections from there. Or even just disconnect the oldest or a random client?

Any idea is appreciate!

We work with WebIQ version 2.16.4

Best reply by HmiGuide

When the project starts, the number of connected clients is checked. If the newly started client exceeds the limit, it terminates and display a HTML page with an error message. The attached example contains this workaround.

limitclients-v2.16.2.zip
4.12MB

To implement it in your project:

  • Create an item called iClientCount and assign it the function usercount. Although the name is usercount, it means "number of connected clients." See WebIQ Designer documentation for meaning of existing functions.

  • Create a local script that runs when the WebIQ project starts. Content see Local script: startup

  • If iClientCount is greater than or equal to 5, the WebIQ project will terminate by displaying an HTML file with error message.

  • Place the HTML file in workspace folder of WebIQ (info.html)

  • The local script is only implemented in the viewer project.

View original
3 replies