Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
Is there a way to detect that a client is connected and is able to communicate with webvisu? My concern is that a user loses connection over wifi and is not able to stop the plc remotely. Ideally I would like to have a variable that could be used to enable a safety latch.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I can see that when I watch the auto logout timer, the time will start ticking down from 50 days one the first client login (webvisu loaded into browser) and stops when I disconnect the client from wifi. Is there a variable that will simply allow me to tell if the webvisu client is connected? Is there a timeout flag of srts that can be seen when I close my wifi connection on the client end?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I never did find a status bit of sorts or even a variable with number of clients connected, etc. I wasn't even able to use the client type function, since they returned nothing or ??. I did however use the auto-logoff countdown timer to determine when a client was present and used it to control a safety latch when the user is toggled into a certain run mode.
If there is a simpler way to just see if a client is there or not, via a BOOL or other variable, (eg: number_of_clients = 0) please let me know.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here's the workaround that I've been able to accomplish:
For my application, I am only looking to see if there is a client using Webvisu or not, I am not so much concerned with how many Webvisu clients there are at any given time. I can keep count of the number of clients using Webvisu with the following:
Declaration:
pClient    :  POINTERTOVisuElems.VisuElemBase.VisuStructClientData;ClientCount : INT :=0;NoClients: BOOL; //True if there are no webvisu clients
Program:
VisuElems.g_ClientManager.BeginIteration();ClientCount:=0; WHILE(pClient :=VisuElems.VisuElemBase.g_ClientManager.GetNextClient())<>0DO
  IFpClient^.GlobalData.ClientType=VisuElems.VisuElemBase.Visu_ClientType.WebVisualizationTHEN
    ClientCount:=ClientCount+1;
  END_IFEND_WHILEIFClientCount=0THEN
  NoClients :=TRUE;ELSE
  NoClients :=FALSE;END_IF
Is there a way to detect that a client is connected and is able to communicate with webvisu? My concern is that a user loses connection over wifi and is not able to stop the plc remotely. Ideally I would like to have a variable that could be used to enable a safety latch.
Hello,
Still looking for a solution to this. If anyone has any advice it would be most welcome!
Google is giving me nothing, at least not with the search terms I'm coming up with.
Hi,
check the examples here in the PI section:
l viewtopic.php?f=23&t=6247&p=13503#p13503 l
BR
Edwin
maybe I'm starting to get somewhere.
I can see that when I watch the auto logout timer, the time will start ticking down from 50 days one the first client login (webvisu loaded into browser) and stops when I disconnect the client from wifi. Is there a variable that will simply allow me to tell if the webvisu client is connected? Is there a timeout flag of srts that can be seen when I close my wifi connection on the client end?
I keep forgetting to update this thread.
I never did find a status bit of sorts or even a variable with number of clients connected, etc. I wasn't even able to use the client type function, since they returned nothing or ??. I did however use the auto-logoff countdown timer to determine when a client was present and used it to control a safety latch when the user is toggled into a certain run mode.
If there is a simpler way to just see if a client is there or not, via a BOOL or other variable, (eg: number_of_clients = 0) please let me know.
Hello
I am doing the same thing, do you know what happens when the autologout runs out?
Here's the workaround that I've been able to accomplish:
For my application, I am only looking to see if there is a client using Webvisu or not, I am not so much concerned with how many Webvisu clients there are at any given time. I can keep count of the number of clients using Webvisu with the following:
Declaration:
Program:
The inspiration came from the following link on the FAQ page: https://faq.codesys.com/display/CDSFAQ/WebVisu%3A+Reading+the+IP+Address+of+the+Client
Hope this helps!
Thank you @dgirard
Your idea and above description helped me what i was looking for.