# Read / Write to Tags from a Module

**URL:** <https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296>\
**Category:** Module Development\
**Tags:** ignition81, opcua\
**Created:** [January 23, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296 "2025-01-23T15:45:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [January 23, 2025, 3:45pm UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296/1 "2025-01-23T15:45:53Z")

</div>

Hi all, are there any up to date examples of Reading / Writing to Tags in a Module. For my case, it is likely better to not subscribe and instead do a single "read" every time I need to (as it likely wont be often).

However, an example with both would be ideal, if there are any resources I am missing please let me know but looking at the Ignition SDK Examples, I couldn't see anything that was particularly what I was looking for. I have also looked on the forums but I am not completely sure what some posters mean (I couldn't navigate around the wording) and all posts seem to be a fair bit older and from what I can tell a fair bit seems to have changed.

Thanks for any help in advanced,

MG3.

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [January 23, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296/2 "2025-01-23T16:20:27Z")

</div>

There may be a better way but I am using `GatewayTagManager.readAsync`

```Java
GatewayTagManager tagManager = this.gatewayContext.getTagManager();
TagPath tPath = TagPathParser.parse("[default]MyTag");
            values = tagManager.readAsync(Arrays.asList(tPath),
                    SecurityContext.emptyContext()).get(30,
                            TimeUnit.SECONDS);
            QualifiedValue qv = values.get(0);
            String tagId = qv.getValue() != null ? qv.getValue().toString() : "null";

```

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [January 23, 2025, 11:07pm UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296/3 "2025-01-23T23:07:05Z")

</div>

Hi Benhamin, I am looking at doing something really very similar to this, I am currently just figuring out how to call it from a Component that is being implemented (as this is the end goal).

Will let you know how it goes for me, thanks!

---

<div class="post-metadata">

**Author:** ![Benjamin\_Furlani](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/benjamin_furlani/32/66084_2.png) [@Benjamin\_Furlani](https://forum.inductiveautomation.com/u/Benjamin_Furlani)\
**Post date:** [January 24, 2025, 1:50am UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296/4 "2025-01-24T01:50:33Z")

</div>

Couldnt you just have a property that the user drives? A tag binding would be a good use for this. Otherwise if that tag doesn't exist what would you do to handle that? Just a thought.

---

<div class="post-metadata">

**Author:** ![MG3](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mg3/32/84125_2.png) [@MG3](https://forum.inductiveautomation.com/u/MG3)\
**Post date:** [January 24, 2025, 8:53am UTC](https://forum.inductiveautomation.com/t/read-write-to-tags-from-a-module/101296/5 "2025-01-24T08:53:40Z")

</div>

Unfortunately, that will not be possible. It's hard to explain what I'm doing without giving it away completely (currently can't disclose) but there would be a dynamic number of tags that need reading so properties and bindings won't particularly work. Especially as the component is more like a template and will be given data via a vision client and not using designer.
