# Reading Ignition Tag Values

**URL:** <https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382>\
**Category:** Module Development\
**Tags:** sdk\
**Created:** [February 6, 2019, 2:59pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382 "2019-02-06T14:59:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![THK](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@THK](https://forum.inductiveautomation.com/u/THK)\
**Post date:** [February 6, 2019, 2:59pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/1 "2019-02-06T14:59:48Z")

</div>

Hi,

I am trying to add functionality to a module that will allow data written to a value in ignition to be passed to the module and back to a device.

For reading values from the ignition database would this be the correct call to make?

> provider.getTag(p).getValue()

We also need indication of when the value was changed by ignition so that we don’t have to track the last read value in the module. Ideally we would like to register a callback or have an event fired off when a value is changed in ignition.

> com.inductiveautomation.ignition.common.expressions.TagListener looks like it implements some of that functionality, is there a better class or function to use?

Tom K

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 6, 2019, 3:40pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/2 "2019-02-06T15:40:48Z")

</div>

Are you trying to do this in Ignition 7.9 or 8.0? The concepts are similar but the APIs are different.

---

<div class="post-metadata">

**Author:** ![THK](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@THK](https://forum.inductiveautomation.com/u/THK)\
**Post date:** [February 6, 2019, 3:44pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/3 "2019-02-06T15:44:21Z")

</div>

We are targeting both 7.9 and 8.0.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 6, 2019, 3:46pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/4 "2019-02-06T15:46:43Z")

</div>

Ok, you’re gonna need 2 separate modules.

In both 7.9 and 8.0 though the `TagManager` you get from the `GatewayContext` has methods to subscribe to a given `TagPath` and receives a listener that will get callback when tags change, so start there.

---

<div class="post-metadata">

**Author:** ![THK](https://avatars.discourse-cdn.com/v4/letter/t/71e660/32.png) [@THK](https://forum.inductiveautomation.com/u/THK)\
**Post date:** [February 6, 2019, 9:22pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/5 "2019-02-06T21:22:05Z")

</div>

Thanks Kevin. Is there any mechanism that indicates the source of the tag change? (Tagvalue changed via ignition or from the module)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 6, 2019, 9:24pm UTC](https://forum.inductiveautomation.com/t/reading-ignition-tag-values/22382/6 "2019-02-06T21:24:42Z")

</div>

No, no information like that. You might be able to figure out if your module was the source of the change some other way but there’s no info about the source available in the `TagChangeEvent` you get.
