CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Sun Feb 16, 2020 10:38 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Tue Jun 28, 2016 11:40 pm 
Offline

Joined: Thu Jun 09, 2016 10:47 pm
Posts: 20
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.


Top
   
PostPosted: Thu Aug 04, 2016 7:11 pm 
Offline

Joined: Thu Jun 09, 2016 10:47 pm
Posts: 20
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.


Top
   
PostPosted: Fri Aug 05, 2016 8:51 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3623
Hi,
check the examples here in the PI section:

viewtopic.php?f=23&t=6247&p=13503#p13503
BR
Edwin


Top
   
PostPosted: Sat Aug 13, 2016 2:40 am 
Offline

Joined: Thu Jun 09, 2016 10:47 pm
Posts: 20
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?


Top
   
PostPosted: Sun Sep 18, 2016 8:37 am 
Offline

Joined: Thu Jun 09, 2016 10:47 pm
Posts: 20
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.


Top
   
PostPosted: Tue Nov 14, 2017 12:28 pm 
Offline

Joined: Tue Nov 07, 2017 12:33 pm
Posts: 2
Hello

I am doing the same thing, do you know what happens when the autologout runs out?


Top
   
PostPosted: Thu Feb 21, 2019 2:39 pm 
Offline

Joined: Thu Feb 21, 2019 4:18 am
Posts: 1
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:
Code:
pClient       :    POINTER TO VisuElems.VisuElemBase.VisuStructClientData;
ClientCount : INT := 0;
NoClients: BOOL; //True if there are no webvisu clients


Program:
Code:
VisuElems.g_ClientManager.BeginIteration();
ClientCount:=0;
WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
    IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
      ClientCount:= ClientCount+1;
    END_IF
END_WHILE

IF ClientCount =0 THEN
   NoClients := TRUE;
ELSE
   NoClients := FALSE;
END_IF


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!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 7 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited