Hi, I'm using Codesys v. 3.5 SP7 with Berghof IEC 2250, and I've got one question.
I've read somewhere that webserver can support up to 100 clients. I want to test it. I've prepared a visualisation already.
My question: is there any counter or method to count number of clients currently connected to webvisu via browser?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You Need to call this in visutask context 'VISU_TASK'
PROGRAMCountClientsVARÂ Â Â Â Â Â pClient:POINTERTOVisuElems.VisuElemBase.VisuStructClientData;Â Â Â Â Â Â countWebvisu:INT;Â Â Â Â Â Â countAll:INT;END_VAR
WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
      IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
            countWebvisu := countWebvisu + 1;
      END_IF
      countAll := countAll + 1;
END_WHILE
```BR
Edwin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank u a lot for your answear but I'm a newbie so I need some more explanation
As I understood this part:
Zitat:
PROGRAM CountClients
VAR
pClient: POINTER TO VisuElems.VisuElemBase.VisuStructClientData;
countWebvisu: INT;
countAll: INT;
END_VAR
Stood for a structure (DUT) named CountClients.
The second part stands for POU named g_ClientManager.
But if i want to add CountClients to VISU_TASK as a call the program goes into the exception.
And if i would like to add a g_ClientManager as a call in VISU_TASK i can't because its type is TYPE.
What have i done wrong?
I tried with VISU_NO_EXCEPTION_HANDLING but it failed, with 42 errors like Problem during creating a client: we are out of memory.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I'm using Codesys v. 3.5 SP7 with Berghof IEC 2250, and I've got one question.
I've read somewhere that webserver can support up to 100 clients. I want to test it. I've prepared a visualisation already.
My question: is there any counter or method to count number of clients currently connected to webvisu via browser?
Hi,
try it that way:
You Need to call this in visutask context 'VISU_TASK'
__Implementation______
```
countWebvisu := 0;
countAll := 0;
g_ClientManager.BeginIteration();
WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
      IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
            countWebvisu := countWebvisu + 1;
      END_IF
      countAll := countAll + 1;
END_WHILE
```BR
Edwin
Thank u a lot for your answear but I'm a newbie so I need some more explanation
As I understood this part:
Stood for a structure (DUT) named CountClients.
The second part stands for POU named g_ClientManager.
But if i want to add CountClients to VISU_TASK as a call the program goes into the exception.
And if i would like to add a g_ClientManager as a call in VISU_TASK i can't because its type is TYPE.
What have i done wrong?
I tried with VISU_NO_EXCEPTION_HANDLING but it failed, with 42 errors like Problem during creating a client: we are out of memory.