# How to set tag quality (sub?) codes like Bad\_WaitingForInitialData?

**URL:** <https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203>\
**Category:** Ignition\
**Created:** [May 4, 2022, 11:48am UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203 "2022-05-04T11:48:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 11:48am UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/1 "2022-05-04T11:48:50Z")

</div>

Hello,

We are trying to replace our OPC-UA server by Ignition.

Using `system.tag.writeBlocking` I can now write the tag quality codes found at:  
[https://docs.inductiveautomation.com/display/DOC81/Quality+Codes+and+Overlays](https://docs.inductiveautomation.com/display/DOC81/Quality+Codes+and+Overlays)

I noticed that in our current implementation we also use status code like:

- Bad\_WaitingForInitialData
- Uncertain\_NoCommunicationLastUsableValue

Those quality codes are not in the list ^^^.

I did find some references to e.g. `Bad_WaitingForInitialData` over here:  
[http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/util/AuditStatus.SubCode.html](http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/util/AuditStatus.SubCode.html)

But how does this work?

It does not seem that I can assign those quality codes to the tags?

Thanks,

Simon.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 11:58am UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/2 "2022-05-04T11:58:52Z")

</div>

I don’t know what StatusCodes are, but I don’t think they’re QualityCodes.  
Where and how are you using them ?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 12:04pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/3 "2022-05-04T12:04:12Z")

</div>

The QualityCode javadoc says:

> Inductive Automation reserves the first 1024 codes(0x0000 through 0x03FF) for codes that it will define. By convention, our codes are broken up into four bands within the range of 0 through 1023 Values 0-255 are "good" codes. Values 256-511 are "uncertain" codes Values 512 - 767 are "bad" codes that represent a condition that should have been expected (something didn't work in a way that was entirely predictable, like Values 768 - 1023 are "worse" bad codes that represent a condition that was unexpected

> Third parties may use codes 1024 through 65535 (0x0400 through 0xFFFF) for their own codes, although doing so will tend to cause very generic "good / bad" representations of the quality.

> The (optional) diagnosticMessage field in this class is used to add contextual information about the circumstance in which the quality code was generated. It is NOT meant to be the name or description of the quality code. In many cases, only the code will be stored / transferred for efficiency, and the diagnostic message may be lost in the long term (e.g. if the code is stored as part of tag history)

You might be able to use those free codes and implement your own qualities

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 12:11pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/4 "2022-05-04T12:11:33Z")

</div>

> [@pascal.fragnoud](#):
>
> Where and how are you using them ?

The initial status of a tag is e.g. set to Bad\_WaitingForInitialData (0x80320000). It there is no communication the status is set to Uncertain\_NoCommunicationLastUsableValue  
(0x408F0000).

I do find references to these "OPC UA Status/Error Codes" [here](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code).

It seems that the Ignition list found [here](https://docs.inductiveautomation.com/display/DOC81/Quality+Codes+and+Overlays) is incomplete?

Edit:  
They are mentioned [here](http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.0-beta/com/inductiveautomation/ignition/common/util/AuditStatus.SubCode.html) though...

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [May 4, 2022, 12:24pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/5 "2022-05-04T12:24:46Z")

</div>

Yes, as I said, those are StatusCodes, not QualityCodes. I don’t think they’re used for the same thing.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 12:37pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/6 "2022-05-04T12:37:01Z")

</div>

Could be, still trying to figure out how to set these status codes to tags. It looks like this is used that way in our current implementation.

Some similar post [here](https://forum.inductiveautomation.com/t/only-a-few-opc-ua-quality-codes-translated-to-ignition).

---

<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:** [May 4, 2022, 1:27pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/7 "2022-05-04T13:27:35Z")

</div>

The QualityCode documentation is here: [QualityCode](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.16/com/inductiveautomation/ignition/common/model/values/QualityCode.html)

These are the quality values that a tag might have.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 1:32pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/8 "2022-05-04T13:32:30Z")

</div>

Thanks, and the “other ones” like `Bad_WaitingForInitialData` are not implemented?

They do seem valid quality codes if I look over [here](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code)…

Edit:  
It is a bit of an issue because they are used on our current implementation of the OPC-UA server so we have to modify the contract if we make changes.

---

<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:** [May 4, 2022, 1:38pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/9 "2022-05-04T13:38:11Z")

</div>

QualityCode is Ignition’s version of an OPC UA StatusCode. There is not a 1:1 mapping between them.

You are trying to replace what sounds like a custom built OPC UA server by combining a handful of Ignition features that will sort of behave the same in the end. You’re going to lose a lot of fidelity in the process because that’s not what Ignition is really built for.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 2:39pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/10 "2022-05-04T14:39:39Z")

</div>

That doesn’t sound very reassuring for something that is included in the Ignition platform and seems like a core component?

> **[Ignition OPC UA Module | Add OPC UA Server and Client Functionality](https://inductiveautomation.com/ignition/modules/ignition-opc-ua)**
>
> The OPC UA Module allows Ignition to be a OPC UA server and client. Connect to most PLCs with included OPC drivers and share data with third-party systems.

---

<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:** [May 4, 2022, 3:02pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/11 "2022-05-04T15:02:39Z")

</div>

Sure, but what you’re missing is that our server exists primarily as a mechanism to host our drivers and bring that data into Ignition. Secondary, it can expose Ignition platform tag data to 3rd party OPC UA clients.

It’s not a generic OPC UA server, as you found out with your earlier approach trying to use the Node Management services.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 4, 2022, 3:33pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/12 "2022-05-04T15:33:14Z")

</div>

Understood.

Thanks for the clarification. Much appreciated.

At the moment we want to use Ignition to get our data out to the DCS / other OPC clients. This will act as an add-on to our solution and will be provided to customers who need the OPC connectivity.

Later on we also want to use Ignition to get data into our system. Using the Ignition OPC-UA client functionality and the Ignition modules / drivers. Hope I use the correct terminology…

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 5, 2022, 11:19am UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/13 "2022-05-05T11:19:11Z")

</div>

I find it confusing though…

The first time I tried, I have set the Quality to Good and Bad ans saw the OPC client follow this behavior.

But now I have set the quality to Uncertain the behavior is not consistent between Ignition and an OPC client.

In the Ignition Tag browser the field is called **Quality** and the value is Uncertain.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/e/def5f10aff0fbc91a9f94ae315c69c32158b1398.png)

In the Ignition OPC quick client the field is called Quality and the value is **Bad** instead of Uncertain.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b755982f31da2eb616435b7bc8932336ab7980cb.png)

In another OPC client the value is Bad as well and the field is called **Status code**.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/8/e8d59d594368aa85d085aff79c74d7d263c66bc2.png)

What is the mapping of the Quality and Status codes?

So my question is:  
Can I only expose the Status codes Good and Bad to an OPC client?

---

<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:** [May 5, 2022, 1:06pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/14 "2022-05-05T13:06:54Z")

</div>

> [@Simon.de.Kraa](#):
>
> Can I only expose the Status codes Good and Bad to an OPC client?

Yes, the current implementation works that way.

I am coincidentally working on some improvements to the "Exposed Tags" feature and it includes some additional mappings from QualityCode to StatusCode.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 5, 2022, 2:47pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/15 "2022-05-05T14:47:12Z")

</div>

> [@Kevin.Herron](#):
>
> Yes, the current implementation works that way.

But isn't it odd that one of the three main qualities i.e. Uncertain is shown as status code Bad in the OPC client?

To be honest, I don't know that much of OPC, but to me the concept of quality codes vs. status codes looks very confusing.

Quality Codes  
[https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-OPC-Quality-Codes](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-OPC-Quality-Codes)

Status Codes  
[https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code)

---

<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:** [May 5, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/16 "2022-05-05T15:19:28Z")

</div>

QualityCode is an Ignition concept, not an OPC concept, though it seems to share a name with the OPC Classic equivalent of StatusCode.

---

<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:** [May 5, 2022, 3:20pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/17 "2022-05-05T15:20:59Z")

</div>

> [@Simon.de.Kraa](#):
>
> But isn’t it odd that one of the three main qualities i.e. Uncertain is shown as status code Bad in the OPC client?

Yes, it's a bit "odd", but it's a result of essentially no mapping logic being implemented.

It's essentially just returning StatusCode.GOOD if the QualityCode is good, and StatusCode.BAD otherwise.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 5, 2022, 5:09pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/18 "2022-05-05T17:09:30Z")

</div>

> [@Kevin.Herron](#):
>
> QualityCode is an Ignition concept, not an OPC concept, though it seems to share a name with the OPC Classic equivalent of StatusCode.

Thanks for taking the time to answer. I appreciate it.  
Please bear in mind: I'm not trying to be a smart ass, just trying to understand how this works.

The Ignition quality codes look a lot like the OPC **DA or Data Access** quality codes.

> **[OPC Data Access](https://en.wikipedia.org/wiki/OPC_Data_Access)**
>
> The OPC Data Access Specification is the first of a group of specifications known as the OPC Classic Specifications.
> OPC Data Access is a group of client–server standards that provides specifications for communicating real-time data from data acquisition devices such as PLCs to display and interface devices like Human–Machine Interfaces (HMI), SCADA systems and also ERP/MES systems. The specifications focus on the continuous communication of data.
> The OPC Data Access specification is also known...

Those OPC **DA or Data Access** Quality Codes can be found over here:  
[https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-OPC-Quality-Codes](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-OPC-Quality-Codes)

As you can see there are some overlapping codes like e.g. Good is 192.  
But a lot of the codes are different which imho is very confusing.

The OPC **UA or Unified Architecture** Status Codes can be found at:  
[https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code](https://honeywellprocess-community.force.com/opcsupport/s/article/What-are-the-common-OPC-UA-Status-Code)

It seems there is no similarity with the Ignition or OPC DA quality codes.

In the OPC-UA server we currently are using, you can set these status codes to the node/tag.  
These status codes are then visible in the OPC client status code field.

The Ignition OPC quick client calls this **Quality** but ihmo this should be **Status code**.  
I find this confusing.  
Also because the quality in the Tag Browser and the status code in the OPC quick client so not always match.

Ignition distills the OPC UA status code from the (Ignition) quality codes and at the moment only do this a limited set (Good maps to Good and everything else maps to Bad).

Isn't it possible in the future to have a status code that you can assign to tags in Ignition as well?

Imho at the moment the OPC UA server in Ignition is more a OPC UA server lite version because of the missing status code which again imho is an essential part.

Thanks.

---

<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:** [May 5, 2022, 5:19pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/19 "2022-05-05T17:19:11Z")

</div>

> [@Simon.de.Kraa](#):
>
> The Ignition quality codes look a lot like the OPC **DA or Data Access** quality codes.

Yes, over a decade ago Ignition's quality concept was highly influenced by OPC Classic/DA, and some of that influence can still be seen today.

But listen to me: that is no longer the case, and while there is some overlap, Ignition has its own tag system that exists entirely independent of OPC of any flavor, and these tags have values and associated QualityCodes that are defined by the Ignition platform.

The automatic mapping of QualityCode to StatusCode by the Exposed Tags feature will be improved in a future version.

You need to understand that what you're building right now with the Web Dev module and setting data into Ignition tags has absolutely nothing to do with OPC UA except for the fact that we happen to have a feature that exposes Ignition tags over OPC UA, and that feature currently does a poor job of mapping the QualityCode to StatusCode. You are not building an OPC UA server in Ignition. You do not have the fine-grained control you wish for.

* * *

I really hesitate to mention this because I don't want to muddle this any more or send you down another path that may not be able to meet your requirements, but Ignition does have a module SDK, and one of the supported "extension points" is for adding new Device types to the server. This abstraction operates at the OPC UA level and provides pretty direct control over OPC UA stuff... but it's also coupled to the Ignition concept of "Devices" and the idea that you will be adding multiple instances of them, each with their own settings, so it may not be exactly what you're looking for.

---

<div class="post-metadata">

**Author:** ![Simon.de.Kraa](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@Simon.de.Kraa](https://forum.inductiveautomation.com/u/Simon.de.Kraa)\
**Post date:** [May 5, 2022, 7:47pm UTC](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203/20 "2022-05-05T19:47:57Z")

</div>

Thank you for the honest answer.

I think I have found the document that talks about the OPC DA Quality Code and OPC UA Status Code relationship:

> **[OPC 10000-8 Unified Architecture Part 8 Data Access and error mapping](https://reference.opcfoundation.org/v104/Core/docs/Part8/A.4.3/)**
>
> OPC 10000-8 Unified Architecture Part 8 Data Access and error mapping

So basically you can go from Quality Code + HRESULT to a Status Code and back again.

I guess it is a bit too late to implement this…

[Next page](https://forum.inductiveautomation.com/t/how-to-set-tag-quality-sub-codes-like-bad-waitingforinitialdata/59203.md?page=2)
