# Add two values on button press

**URL:** <https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698>\
**Category:** Ignition\
**Created:** [March 14, 2025, 12:58pm UTC](https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698 "2025-03-14T12:58:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maughanster](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/maughanster/32/73715_2.png) [@Maughanster](https://forum.inductiveautomation.com/u/Maughanster)\
**Post date:** [March 14, 2025, 12:58pm UTC](https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698/1 "2025-03-14T12:58:18Z")

</div>

Hello All,

I am a total newbie to Ignition, and am just starting to work my way through Inductive Automation training. I am using Ignition 8.1.2 and would really appreciate it if someone could give me a little kick start on something.

I have created three memory integer tags in the default tag provider. Tags are called Test 1, Test 2 and Test 3. I would simply like to add the values of Test 1 and Test 2 and put the result in Test 3 when a button is pressed. I know this is very basic but I’ve been reading about how to do it and for the life of me, can’t make it work. Could someone please help?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 14, 2025, 1:10pm UTC](https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698/2 "2025-03-14T13:10:55Z")

</div>

Basically, you will **read** tags 1 and 2, add them, then **write** them to the third tag.

```python
# list of tag paths to read
# read both tags at once for efficiency
tagPaths = ['[default]Test 1', '[default]Test 2']
#returns a list of fully qualified values (value,quality,timestamp)
qValues = system.tag.readBlocking(tagPaths)
summation = qValues[0].value + qValues[1].value

system.tag.writeBlocking(['[default]Test 3'], summation)

```

Alternatively, make your third tag an expression tag instead of memory and use an expression to add them together

```python
{[.]Test 1} + {[.]Test2}

```

You'll want to book mark these webpages as a reference. Remember scripting language does not equal expression language in Ignition.

[Expression Functions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/expression-functions)  
[System Functions | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 14, 2025, 2:23pm UTC](https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698/3 "2025-03-14T14:23:02Z")

</div>

Also, unrelated to the question at hand...

If you are actually using **8.1.2** you urgently need to upgrade. 8.1.2 is 4 years old, and has many severe performance bugs and some security issues. Upgrading within a major version (8.1) is always free, and gets you all the new bug fixes and features from later 8.1 releases:

> **[New in this Version 📣 | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/new-in-this-version)**
>
> Over the course of development, naturally there are changes and additions to the Ignition software. This page highlights any new functionality or modified behavior, but is not meant as a complete resource for new features. You can find more about...

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [March 15, 2025, 9:04am UTC](https://forum.inductiveautomation.com/t/add-two-values-on-button-press/103698/4 "2025-03-15T09:04:15Z")

</div>

Nevermind the security stuff (jk), a version that old is missing _so_ many designer creature comforts 😵 that was back when the tag editor was a bit.. Not good, and when the power chart still split the time axis in equal divisions, regardless of how random the times came out to be 😬
