Change values of 2 tags by one click

<< Click to Display Table of Contents >>

Navigation:  Examples > Change tag's value >

Change values of 2 tags by one click

Previous pageReturn to chapter overviewNext page

In this example we will show how to change values of 2 tags by one click. Let's create 2 tags - Tag2 and Tag3. We will change the values of these tags at the same time by clicking buttons. These buttons will toggle other tags - write0 and write10. Tags look like below:


Let's bind the tags write0 and write10 to two buttons:


Let's create 2 scripts that will be called when values of these 2 tags toggled from FALSE to TRUE:


And let's bind these 2 scripts to tags - write0 and write10:


Now when tags write0 and write10 are toggled from FALSE to TRUE the appropriate script is called.  

Let's Run simulation to check the settings:


You can download this project here.