cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

WebVisu Client

WebVisu Client

joelfernandez
New Poster

Hello,

I have a question of clients in WebVisu. We have a project with 1 core and 9 WR21 screens.

Is it possible only make one visualization for the 9 different screens? The variables should be different in all the screens 

And, Is there a way to know which client is connected to the webvisu?

Thanks.

6 REPLIES 6

Sgilk
Contributor

Hi @joelfernandez ,

Is it possible only make one visualization for the 9 different screens?

Yes, however you have to manage the session dependent behavior yourself. I attached an example of how you might read/write from a different variable, within an array, depending on a selected index. In your case, you'd set the index to the current client index. The array of values would be sized to your number of clients.

For example, on element click: write variable iArrayInt[CURRENTCLIENTID] = value

And, Is there a way to know which client is connected to the webvisu?

Yes. Within a visualization, CURRENTCLIENTID will return the client index.

You'll also want to make sure the option "Use CurrentVisu variable" is unchecked in your Visualization Manager.

Sgilk_0-1706208740603.png

Alternatively, you could have custom visualizations per client and switch them in a frame element. See documentation.

Hi @Sgilk,

We probe your code but it isn't a solution for us because if you change the value of current index in client nº1, this value change in the others clients. The idea is that the screens are independent of each other because the screens will go in different places and each one should have different variables.

 

Another problem is the ID, because we have 9 screens. If you turn it off and on again, the probability that all the screens will continue with the same ID is very small...

Thanks.

@joelfernandez ,

Sorry to confuse, the current index was meant to demonstrate that behavior. You'd want to access variables in an array the size of the number of clients by the CURRENTCLIENTID.

Since it is important that the clients maintain their ID across restart, the client will have to ID itself to the server. I think the best option for you is to target a different visualization from the client side by URL.

For example: [https://IP_ADDRESS:PORT/webvisu1.htm,  https://IP_ADDRESS:PORT/webvisu2.htm,  https://IP_ADDRESS:PORT/webvisu3.htm...]

Here is another example with multiple visualizations. It may be possible to automate this further using a template type feature, but I'm not familiar. In this case, I just copied the visualization and updated the element "Array value at visualization index" to target the array value associated with the index.

HmiGuide
Community Moderator
Community Moderator

I understood your question like this:

  • There are 9 visualization pages (e.g. visu1,..., visu9) in one PLC project
  • There are 9 WR21, which should display automatically different pages when starting. You don't want to select the page manually.
    1. WR21 should display visu1
    2. WR21 should display visu2
          :                      :
    9. WR21 should display visu9

I found the following in the CoDeSys Docu: Chapter: Configuring and starting a display variant 

You just add multiple "WebVisu" objects to the PLC project, where you can define different start pages. I attache a example project with 2 "WebVisu" objects. URL's of example project.

Hello,

The idea is to have 9 WR21 but with only one visualization page. Depending on the screen we want to write or read values without affecting the rest of WR.

  • There is 1 visualization page.
  • There are 9 WR21, which should display the same page with different variables.

Thanks.

Exactly. Just copy the page and change the variable indices. That's it.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist