OPC Reads

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

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:

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

Hi,

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

qualifiedValue.getQuality().isGood()

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

Regards,

Works. Thanks!