# Reading tag values

**URL:** <https://forum.inductiveautomation.com/t/reading-tag-values/7518>\
**Category:** Module Development\
**Created:** [November 5, 2013, 10:30am UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518 "2013-11-05T10:30:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [November 5, 2013, 10:30am UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/1 "2013-11-05T10:30:23Z")

</div>

Dear All,

I am trying to read tag values in a gateway module, but I am not successful.  
Can some one help me with an example or sample code?

Regards  
PRAMANJ.

---

<div class="post-metadata">

**Author:** ![nclemeur](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nclemeur](https://forum.inductiveautomation.com/u/nclemeur)\
**Post date:** [November 5, 2013, 11:34pm UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/2 "2013-11-05T23:34:39Z")

</div>

Maybe you should let us know what you have tried so far and what did not work. Any error message?

You should just get the TagManager from the gatewayContext (gatewayContext.getTagManager()) and then just use the tagManager.read(tagPath)…

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [November 6, 2013, 7:26am UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/3 "2013-11-06T07:26:55Z")

</div>

Hi, Thanks a lot for your mail.  
I got the problem resolved.

---

<div class="post-metadata">

**Author:** ![nclemeur](https://avatars.discourse-cdn.com/v4/letter/n/b5e925/32.png) [@nclemeur](https://forum.inductiveautomation.com/u/nclemeur)\
**Post date:** [November 6, 2013, 7:39am UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/4 "2013-11-06T07:39:54Z")

</div>

I don’t have a SQLTagManagerContext in my version (I am on 7.6.1). So maybe there is a difference there. You might also want to use the TagPathParser class to build the TagPath object.

Cheers

Nicolas

---

<div class="post-metadata">

**Author:** ![dieegom](https://avatars.discourse-cdn.com/v4/letter/d/898d66/32.png) [@dieegom](https://forum.inductiveautomation.com/u/dieegom)\
**Post date:** [July 19, 2016, 4:48pm UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/5 "2016-07-19T16:48:52Z")

</div>

Hello!

I’m new in Ignition SDK development and I’m trying to to simple read a TAG in Client scope, but I’m getting this error:

serializationException: Unexpected parsing error during binary deserialization.  
caused by IOExceptionWithCause: java.lang.ClassNotFoundException: com.BirminD.PIDcomp.client.BirminD\_PID\_comp  
caused by ClassNotFoundException: com.BirminD.PIDcomp.client.BirminD\_PID\_comp  
   
Ignition v7.8.2 (b2016030813)  
Java: Oracle Corporation 1.8.0\_91

My code is:

```auto
TagPath path = TagPathParser.parse("", "_BMD_Device_/Ramp/Ramp0");
QualifiedValue value = getAppContext().getTagManager().read(Arrays.asList(TagPathParser.parse("","_BMD_Device_/Ramp/Ramp0"))).get(0);
String x = value.getValue().toString();
JOptionPane.showMessageDialog(null, path.getItemName());
```

If this part of code is commented, the rest of program works fine.

What am I doing wrong? 😢

Sry for noob questions…

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dpitzer](https://avatars.discourse-cdn.com/v4/letter/d/b5a626/32.png) [@dpitzer](https://forum.inductiveautomation.com/u/dpitzer)\
**Post date:** [August 2, 2016, 4:11am UTC](https://forum.inductiveautomation.com/t/reading-tag-values/7518/6 "2016-08-02T04:11:54Z")

</div>

@dieegom

I see you got the dreaded ClassNotFoundException. It’s gotta be one of the most common Java exceptions there are. Thankfully, it’s relatively easy to fix. Basically, it’s saying you are referencing a class that has not been defined in any libraries included in your project (either in build time or in runtime - the runtime one got me once). To give you more specifics, tell me…are you using eclipse? Also, I’m not familiar with the “BirminD\_PID\_comp” class. Do you even need it for reading tags?
