(same post as previously but with a topic title and screenshots)
I am currently facing an issue regarding reading the IP addresses of webvisu clients connected to a codesys runtime for sl3300 wago.
After implementing the iterateClient block, I am unable to read any addresses other than the loopback address 127.0.0.1. Despite this, the iteration process seems to be functioning correctly, as the names of the different views displayed on the various pages change correctly as we navigate through the respective webvisus.
However, the IP addresses of the clients do not take on any values other than 127.0.0.1
What am I missing here?
I have done it like this:
FUNCTION CheckClientData : ARRAY[0..5] OF VisuClientData
pClient : POINTER TO VisuElems.VisuElemBase.VisuStructClientData;
pClientTmp : POINTER TO VisuElems.VisuElemBase.VisuStructClientData;
DataHelper : VisuElems.VisuFbClientTagDataHelper;
i : UINT;
WHILE (pClient := VisuElems.VisuElemBase.g_ClientManager.GetNextClient()) <> 0 DO
IF pClient^.GlobalData.ClientType = VisuElems.VisuElemBase.Visu_ClientType.WebVisualization THEN
IF pClientTmp <> pClient THEN
DataHelper(pClientData := pClient);
CheckClientData[i].ClientIP := DataHelper.stIPv4;
CheckClientData[i].CurrentUserName := pClient^.GlobalData.CurrentUserName;
CheckClientData[i].CurrentFullUserName := pClient^.GlobalData.CurrentFullUserName;
CheckClientData[i].CurrentUserGroupName := pClient^.GlobalData.CurrentUserGroupName;
pClientTmp := pClient;
IF i <= UPPER_BOUND(CheckClientData,1) THEN
i := i + 1;
ELSE i := 0;
TYPE VisuClientData :
ClientIP : STRING(15); //IP-Adresse
CurrentUserName : WSTRING;
CurrentFullUserName : WSTRING;
CurrentUserGroupName : WSTRING(511);
Thanks foryour answer.
I copy pasted you code in a new program, just made small adjustment to avoid having several reference of the same client in de "CheckClientData" array. Still got "127.0.0.1".
I also asked the question to wago support, I hope I'll get an answer. It is very important for us to be able to identify each screan and also check that no unintended client connect to the machine.
Is there a specific task or a (preferential one) where to call this function? Is it ok to do it in visu_task?
Sorry, so in your original post, is it correct that the 3 stCurrentVisu[x]'s are 3 different pages being accessed on 3 different PC's (or HMI's)?
I have used this similar function before on 2 devices and it worked, I would have to locate where though....
Yes, that's right stCurrentVisu refers to three visualizations displayed on 3 different machines.
I think the problem comes from the integration of the 3S runtime by Wago. I don't see why it wouldn't work otherwise.
On what type of runtime have you seen this function working correctly?
For your information, the edge controller from Wago is a machine based on LInux, but the runtime used is not the runtime for Linux, it is a particular version made by Wago.
It sounds like you are right, if the CurrentVisu's are coming through it has to be cycling correctly! The code def looks right.
I believe it was one on a PC and the other was on a Schneider HMI, so Vijeo Runtime?
Log in to post a comment.