# OPC Reads

**URL:** <https://forum.inductiveautomation.com/t/opc-reads/2630>\
**Category:** Ignition\
**Created:** [February 11, 2011, 3:58am UTC](https://forum.inductiveautomation.com/t/opc-reads/2630 "2011-02-11T03:58:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![f\_jons](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@f\_jons](https://forum.inductiveautomation.com/u/f_jons)\
**Post date:** [February 11, 2011, 3:58am UTC](https://forum.inductiveautomation.com/t/opc-reads/2630/1 "2011-02-11T03:58:46Z")

</div>

I am trying to use system.opc.readValue and check the quality. Here is a snippet of sample code:

```auto
qualifiedValue = system.opc.readValue('IgnitionOPCUA', opcPath)
if( qualifiedValue.quality.isGood() ):
   # quality is good, can continue
   print qualifiedValue.value
else:
   # quality is bad, need to do something else.
```

In essence, I want to check to make sure that the opc read succeeded before I work with the data. However, when running the above code, I get the following error:

> [@](#):
>
> Traceback (innermost last):
> 
> File "event:actionPerformed", line 28, in ?
> 
> AttributeError: write-only attr: quality
> 
> Ignition v7.1.7 (b6048)  
> Java: Sun Microsystems Inc. 1.6.0\_22

Am I using this attribute wrong? I was trying to use it the way the user manual specifies...

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [February 11, 2011, 5:06pm UTC](https://forum.inductiveautomation.com/t/opc-reads/2630/2 "2011-02-11T17:06:30Z")

</div>

Hi,

Yes, it appears that accessing “.quality” directly isn’t correct. Try this:

```auto
qualifiedValue.getQuality().isGood()
```

We’ll have to update the incorrect example in the manual.

Regards,

---

<div class="post-metadata">

**Author:** ![f\_jons](https://avatars.discourse-cdn.com/v4/letter/f/9fc29f/32.png) [@f\_jons](https://forum.inductiveautomation.com/u/f_jons)\
**Post date:** [February 11, 2011, 11:22pm UTC](https://forum.inductiveautomation.com/t/opc-reads/2630/3 "2011-02-11T23:22:06Z")

</div>

Works. Thanks!
