# Get only the value in reading OPC tag

**URL:** <https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [August 31, 2023, 4:52am UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595 "2023-08-31T04:52:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Henrol\_Jeo\_Gutierrez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/henrol_jeo_gutierrez/32/50993_2.png) [@Henrol\_Jeo\_Gutierrez](https://forum.inductiveautomation.com/u/Henrol_Jeo_Gutierrez)\
**Post date:** [August 31, 2023, 4:52am UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/1 "2023-08-31T04:52:30Z")

</div>

I have a script to read specific value of an OPC tag

```auto
currentVal = system.tag.readBlocking(event.source.parent.parent.PID.Meta.TagPath +'/SV')
print currentVal

```

and it output as:

```auto
[[23.0, Good, Thu Aug 31 12:41:11 SGT 2023 (1693456871880)]]

```

Now I wanna get only the value "23.0" on my array.  
I tried this code: (I am using this before using python to get the first value of array)

```auto
currentVal = system.tag.readBlocking(event.source.parent.parent.PID.Meta.TagPath +'/SV')
print currentVal
print currentVal[0][0]

```

But I am having error:

```auto
Caused by: org.python.core.PyException: TypeError: 'com.inductiveautomation.ignition.common.model.values.BasicQualifiedValue' object is unsubscriptable
	... 45 common frames omitted

```

Anyone encountered this?  
Or is there a way to get only the value in the ArrayList?

Thanks and Regards,

---

<div class="post-metadata">

**Author:** ![Henrol\_Jeo\_Gutierrez](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/henrol_jeo_gutierrez/32/50993_2.png) [@Henrol\_Jeo\_Gutierrez](https://forum.inductiveautomation.com/u/Henrol_Jeo_Gutierrez)\
**Post date:** [August 31, 2023, 4:57am UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/2 "2023-08-31T04:57:18Z")

</div>

Solved!

```auto
currentVal = system.tag.readBlocking(event.source.parent.parent.PID.Meta.TagPath +'/SV')
print currentVal
print currentVal[0].getValue()

```

Reference:  
[https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/model/values/BasicQualifiedValue.html](https://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/model/values/BasicQualifiedValue.html)

---

<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:** [August 31, 2023, 11:06am UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/3 "2023-08-31T11:06:26Z")

</div>

This is also discussed in the user manual, which includes examples for accessing each component of the QualifiedValue: [system.tag.readBlocking - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.tag.readBlocking)

---

<div class="post-metadata">

**Author:** ![amarks](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/amarks/32/45610_2.png) [@amarks](https://forum.inductiveautomation.com/u/amarks)\
**Post date:** [August 31, 2023, 2:58pm UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/4 "2023-08-31T14:58:27Z")

</div>

do you have to use `.getValue`, can't you just use `.value`?

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [August 31, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/5 "2023-08-31T15:01:31Z")

</div>

you can

---

<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:** [August 31, 2023, 3:02pm UTC](https://forum.inductiveautomation.com/t/get-only-the-value-in-reading-opc-tag/78595/6 "2023-08-31T15:02:12Z")

</div>

`.value`, that is, not `.Value`. Case matters.
