<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/</id><updated>2023-06-23T21:38:05.138000Z</updated><subtitle>Recent posts to VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</subtitle><entry><title>VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/?limit=25#7fcb/1e68" rel="alternate"/><published>2023-06-23T21:38:05.138000Z</published><updated>2023-06-23T21:38:05.138000Z</updated><author><name>hedgetech</name><uri>https://forge.codesys.com/u/hedgetech/</uri></author><id>https://forge.codesys.com13f64cb87e9689e1c8e6ab1d3d15e0fb8369b107</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Sorry new to CODESYS forge here.... I posted a new thread below instead of responding to you directly 😅  Thank you so much for sharing!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/?limit=25#53f7" rel="alternate"/><published>2023-06-23T21:34:09.812000Z</published><updated>2023-06-23T21:34:09.812000Z</updated><author><name>hedgetech</name><uri>https://forge.codesys.com/u/hedgetech/</uri></author><id>https://forge.codesys.com3a57de54007597ec06a94f7597fbf58a51293330</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello TimvH,&lt;/p&gt;
&lt;p&gt;Thank you so much! that worked flawlessly.&lt;br/&gt;
Except, I see what you mentioned...  It does contain code that is obsolete and I get the warning message:&lt;/p&gt;
&lt;p&gt;C0357:  POU 'SetMainVisu' has been marked as obsolete: Please use the methods of VisuUtils instead.&lt;/p&gt;
&lt;p&gt;I am not sure what/which is the method that they are referring to, to use inside of the VisuUtils library to accomplish the same action.  &lt;/p&gt;
&lt;p&gt;If it is in fact the fbChangeVisu inside of VisuUtils, I still wonder if there is a way to filter the specific WebVisu client individually....&lt;/p&gt;
&lt;p&gt;But what you shared above helped me out tremendously! Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/?limit=25#7fcb" rel="alternate"/><published>2023-06-23T15:11:36.092000Z</published><updated>2023-06-23T15:11:36.092000Z</updated><author><name>TimvH</name><uri>https://forge.codesys.com/u/timvh/</uri></author><id>https://forge.codesys.comcf278045347cf3d1e27a7995daeb07478f63ecd1</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I'm not sure you want to go in this direction, because the example below contains code which is marked as obsolete, but the library mentions that if no other option is possible, then it could be an escape... so be warned 😬&lt;/p&gt;
&lt;p&gt;Add the following code in you "HandleClient" method&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;    xChangePage : BOOL;&lt;/span&gt;
&lt;span class="err"&gt;    itfVisuClientRawData : VU.IVisualizationClientRaw;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;xQueryOK := __QUERYINTERFACE(itfClient, itfVisuClientRawData);&lt;/span&gt;
&lt;span class="err"&gt;IF xQueryOK AND xChangePage THEN&lt;/span&gt;
&lt;span class="err"&gt;    VisuElems.g_VisuManager.SetMainVisu(pClientData := itfVisuClientRawData.ClientDataPointer, stVisu := 'visu2');&lt;/span&gt;
&lt;span class="err"&gt;    xChangePage := FALSE;&lt;/span&gt;
&lt;span class="err"&gt;END_IF&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;'visu2' in this case is just the name of a Visualization, of course you have to replace this with the name of the Visualization you want to switch to...&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>VisuUtils - FBAcceptsCurrentClient - CurrentClient - WebVisu Client Independent Visualization Change</title><link href="https://forge.codesys.com/forge/talk/Visualization/thread/c9090f55b6/?limit=25#7864" rel="alternate"/><published>2023-06-21T16:18:16.494000Z</published><updated>2023-06-21T16:18:16.494000Z</updated><author><name>hedgetech</name><uri>https://forge.codesys.com/u/hedgetech/</uri></author><id>https://forge.codesys.com8469a32469dde07eac1213b7870c614d261dff60</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Is there a way to independently (asynchronously) change the shown visualization between different WebVisu clients?  Currently I am using VU.FbIterateClients to iterate through clients (follwing example from another thread) and also created a function block which implements VU.IVisualizationClientFilter, VU.IVisualizationClientIteration..Within this function block I am calling the fbChangeVisu: VU.FbChangeVisu; within the &lt;strong&gt;HandleClient&lt;/strong&gt; method.  &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="err"&gt;    fbChangeVisu(&lt;/span&gt;
&lt;span class="err"&gt;        xExecute:= xChangeVisuCondition, &lt;/span&gt;
&lt;span class="err"&gt;        xDone=&amp;gt; xChageVisuDone, &lt;/span&gt;
&lt;span class="err"&gt;        xBusy=&amp;gt; xChanveVisuBusy, &lt;/span&gt;
&lt;span class="err"&gt;        xError=&amp;gt; xChangeVisuError, &lt;/span&gt;
&lt;span class="err"&gt;        itfClientFilter:= VU.Globals.OnlyWebVisu, &lt;/span&gt;
&lt;span class="err"&gt;        eError=&amp;gt; eError, &lt;/span&gt;
&lt;span class="err"&gt;        sVisuName:= 'New_Visu');&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;With this implementation however all web visualizations (clients), will change at once to the 'New_Visu' whenever the xChangeVisuCondition is TRUE.&lt;br/&gt;
(Currently I have un-checked, the checkbox &lt;strong&gt;Use CurrentVisu Variable&lt;/strong&gt; under Visualization Manager/Settings, so I can have asynchronous display from different web-browsers accessing the controllers IP address)&lt;/p&gt;
&lt;p&gt;A more detail code snippet of what I am trying to do below:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="n"&gt;PROGRAM&lt;/span&gt; &lt;span class="n"&gt;VisuHandling&lt;/span&gt; &lt;span class="o"&gt;//&amp;lt;&lt;/span&gt;&lt;span class="c1"&gt;-- called from the VISU_TASK&lt;/span&gt;
&lt;span class="n"&gt;VAR&lt;/span&gt;
    &lt;span class="n"&gt;xExecute&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xDone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xBusy&lt;/span&gt;      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;BOOL&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fbVisuIterate&lt;/span&gt;                       &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;VU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;FbIterateClients&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fbClientFilter&lt;/span&gt;                      &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;ClientFilter&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;fbinstItCallback&lt;/span&gt;                    &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;VisuClientIteration&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;END_VAR&lt;/span&gt;

&lt;span class="n"&gt;fbVisuIterate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="n"&gt;itfClientFilter&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fbClientFilter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;itfIterationCallback&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fbinstItCallback&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;eError&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;eError&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xExecute&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;xExecute&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xBusy&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;xBusy&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xDone&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;xDone&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;xError&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;xError&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Then in the method of the &lt;br/&gt;
FUNCTION_BLOCK VisuClientIteration IMPLEMENTS VU.IVisualizationClientFilter, VU.IVisualizationClientIteration&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class="nt"&gt;METHOD&lt;/span&gt; &lt;span class="nt"&gt;HandleClient&lt;/span&gt;
&lt;span class="nt"&gt;VAR_INPUT&lt;/span&gt;
    &lt;span class="o"&gt;(*&lt;/span&gt; &lt;span class="nt"&gt;The&lt;/span&gt; &lt;span class="nt"&gt;object&lt;/span&gt; &lt;span class="nt"&gt;representing&lt;/span&gt; &lt;span class="nt"&gt;the&lt;/span&gt; &lt;span class="nt"&gt;according&lt;/span&gt; &lt;span class="nt"&gt;client&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;Will&lt;/span&gt; &lt;span class="nt"&gt;not&lt;/span&gt; &lt;span class="nt"&gt;be&lt;/span&gt; &lt;span class="nt"&gt;0&lt;/span&gt;&lt;span class="o"&gt;.*)&lt;/span&gt;
    &lt;span class="nt"&gt;itfClient&lt;/span&gt;   &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;VU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IVisualizationClient&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nt"&gt;END_VAR&lt;/span&gt;

&lt;span class="nt"&gt;fbChangeVisu&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
    &lt;span class="nt"&gt;xExecute&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;xChangeVisuCondition&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xDone&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;xChageVisuDone&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xBusy&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;xChanveVisuBusy&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;xError&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;xChangeVisuError&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;itfClientFilter&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nt"&gt;VU&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Globals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;OnlyWebVisu&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;eError&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;eError&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
    &lt;span class="nt"&gt;sVisuName&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="s1"&gt;'New_Visu'&lt;/span&gt;&lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Maybe the more adequate question is how do we properly use the VU.IVisualizationClientFilter to filter and make action only on the individual WebVisu client (not on all of the WebVisu's).&lt;/p&gt;
&lt;p&gt;Any help, insights on the above is greatly appreciated!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>