# How to define local variables independent of other users - Web Visualization

**URL:** <https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064>\
**Category:** CODESYS\
**Tags:** pfc200, how-to, edge-controller, codesys\
**Created:** [June 28, 2024, 5:50pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064 "2024-06-28T17:50:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafael](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/rafael/32/795_2.png) [@Rafael](https://www.wago.community/u/Rafael)\
**Post date:** [June 28, 2024, 5:50pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/1 "2024-06-28T17:50:36Z")

</div>

Hello everyone

I’m trying to do some animations in WebVisu, like visibility of objects, change colors etc.

But variables are all global, if i hit a button that turns the visibility of a object on, it turns on in every user connected in the same webpage. I tried to define vars inside the screen but it still change it’s values in all instances of connected users.

I want to now if there is a way to create a variable that runs local and don’t share the same memory globaly, just local for each user

Or if I can do a ST code or something that access the objects properties directly and change them without needing to put a variable, just change the property via script (ST) or something like that. I’m a bit familiar to do this things in other SCADA softwares but here i don’t see a natural way of doing it.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![PatrickR](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/patrickr/32/262_2.png) [@PatrickR](https://www.wago.community/u/PatrickR)\
**Post date:** [June 29, 2024, 7:32pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/2 "2024-06-29T19:32:35Z")

</div>

Declare the global variable as an array  
[VISU\_MIN\_NUMBER\_OF\_CLIENTS… VISU\_MAX\_NUMBER\_OF\_CLIENTS] of your type/var/…  
then you can use this array in the visu with the variable CurrentClientId in the array index.

> **[CODESYS Group](https://content.helpme-codesys.com/en/CODESYS%20Visualization/_visu_manager_advanced_settings.html)**

---

<div class="post-metadata">

**Author:** ![Rafael](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/rafael/32/795_2.png) [@Rafael](https://www.wago.community/u/Rafael)\
**Post date:** [July 1, 2024, 4:41pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/3 "2024-07-01T16:41:31Z")

</div>

I undestand that this is a way of doing what I need but not what I want, so I will consider that it is not possible to create local tags, although the “CurrentClientId” tag itself is a local tag. ¯\_(ツ)\_/¯

Thanks for the trick

---

<div class="post-metadata">

**Author:** ![PatrickR](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/patrickr/32/262_2.png) [@PatrickR](https://www.wago.community/u/PatrickR)\
**Post date:** [July 1, 2024, 4:50pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/4 "2024-07-01T16:50:24Z")

</div>

You can also do this with variables defined in the interface editor of your visu page. Variables defined there only affect the client itself. If there is another client, it will have it’s own instance of these variables.

---

<div class="post-metadata">

**Author:** ![Rafael](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/rafael/32/795_2.png) [@Rafael](https://www.wago.community/u/Rafael)\
**Post date:** [July 1, 2024, 5:21pm UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/5 "2024-07-01T17:21:35Z")

</div>

No, it doesn’t work, I declare this in the interface editor:

```auto
VAR
test : bool
END_VAR

```

And then assigned that test variable in the “invisible” property of a object and this test bool is switching value in every instance of connected user, not local.

---

<div class="post-metadata">

**Author:** ![PatrickR](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/patrickr/32/262_2.png) [@PatrickR](https://www.wago.community/u/PatrickR)\
**Post date:** [July 2, 2024, 5:56am UTC](https://www.wago.community/t/how-to-define-local-variables-independent-of-other-users-web-visualization/1064/6 "2024-07-02T05:56:02Z")

</div>

You are right! I must have remembered something wrong. Sorry 😉  
Then you have to use the array …
