# There're a few functions lacking in 8.1 from 7.8.5, what are ways to get the same thing

**URL:** <https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929>\
**Category:** Ignition\
**Tags:** scripting, ignition80\
**Created:** [November 24, 2020, 7:06pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929 "2020-11-24T19:06:39Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 7:06pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/1 "2020-11-24T19:06:39Z")

</div>

system.tag.getAttribute(unit, “Enabled”) see if the tag is enabled, seeing if the device is enabled should work but I only saw a way to enable or disable the device not actually see if it’s enabled, I see there’s an enabled tag property, but wasn’t sure if it’s the same as the tag being enabled, it talks about the group in the docs

system.tag.read - see the quality of the tag, I see nothing about getting the quality here in the new stuff

I’m sure there’s more I find, just going through the process of migrating. Thx, jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 7:13pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/2 "2020-11-24T19:13:55Z")

</div>

To check tag quality from script, use this at the bottom of Paul's post:

> [@How to locate the number 'value' of a Tag's Data Quality](http://forum.inductiveautomation.com/t/how-to-locate-the-number-value-of-a-tags-data-quality/26840/9):
>
> You shouldn’t use string comparison or integer comparison. In the vast majority of cases, it’s preferable to use the dedicated methods on [QualityCode](http://files.inductiveautomation.com/sdk/javadoc/ignition80/8.0.14/com/inductiveautomation/ignition/common/model/values/QualityCode.html#isGood()) - isGood(), isBad(), etc directly: system.tag.read("TagPath").quality.isGood() Or, thanks to Jython: system.tag.read("TagPath").quality.good If you actually need to check for a specific quality code, then you should use is against a static member of the QualityCode class: from com.inductiveautomation.ignition.common.model.values import Quality…

While the old tag read function still exists, it's gone from doco an thus you should probably move to the new `system.tag.readBlocking` or `readAsync` in 8, which now take lists.

Maybe have a look at some things I found migrating from 7 to 8 as well that aren't obvious from doco:

> [@Undocumented changes when migrating from v7 to v8](http://forum.inductiveautomation.com/t/undocumented-changes-when-migrating-from-v7-to-v8/38044):
>
> Just some items I’ve found during v7 to v8 upgrades that may not be documented (some of them might be) and can cause hiccups (and quite a bit of work, relatively speaking!). The official guide to upgrading from IA is [here](https://docs.inductiveautomation.com/display/DOC81/Ignition+8+Upgrade+Guide). Tags: UDT v7 property UDTParentType has been renamed in v8 to TypeId Tag quality string values have changed. E.g. EDITED FOR 8.1.10 below 8.1.10 “Not Found” ==\> “Bad\_NotFound”; “Disabled” ==\> “Bad\_Disabled”; 8.1.10 and above “Bad\_NotFound(Error description…)”, “Bad\_ErrorC…

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 7:35pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/3 "2020-11-24T19:35:05Z")

</div>

If I’m reading this right, it seems we need to use the undocumented read function to get the quality. Are they going to continue support this or are they going to expand the script functions to put this back in? Sounds like the enabled property will show if it’s enabled or not and I don’t have to worry about the groups in the documentation. Please let me know if I have this all right.Thx, jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 7:41pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/4 "2020-11-24T19:41:42Z")

</div>

The new read functions still return QualifiedValue objects, so that part should remain unchanged.

Ah, I see what you’re talking about now I think. UDT instances have lost their ability to check their quality, which is what I used to do as well. I think you can read the enabled property on UDT instances now though…

You can check if a UDT instance (or tag for that matter) is enabled by reading the “enabled” property:

```auto
tagPath = 'path/to/UDTInstance'
t = system.tag.readBlocking([tagPath + '.enabled'])[0].value
print t
>>true or false

```

---

<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:** [November 24, 2020, 7:44pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/5 "2020-11-24T19:44:09Z")

</div>

> [@codersmurf](#):
>
> If I’m reading this right, it seems we need to use the undocumented read function to get the quality.

No, not at all (in fact, the legacy read function goes through the _exact same_ code path as the new read function).

If you want to read the quality of a tag, you can either directly read the quality: `system.tag.readBlocking(["[default]path/to/tag.Quality"])[0].value` _or_ read the tag itself, then extract the quality: `system.tag.readBlocking(["[default]path/to/tag"])[0].quality` - the two are functionally identical.

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 7:47pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/6 "2020-11-24T19:47:25Z")

</div>

Awesome, thx, I’ll wait for your reply.

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 7:49pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/7 "2020-11-24T19:49:42Z")

</div>

Ah, perfect, I’ll just leave my functions the same then. I was worried if they didn’t document it they were going to stop support it.Thx, jake

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 7:54pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/8 "2020-11-24T19:54:26Z")

</div>

One more thing, can I reference styles I have in my project by just doing styles.status\_red? I didn’t see anything about referencing this in script.Thx, jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 8:00pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/9 "2020-11-24T20:00:18Z")

</div>

When you say ‘styles’, are you talking about Perspective Styles?  
These you just apply to a component via the props.style.classes property as text

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 8:01pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/10 "2020-11-24T20:01:42Z")

</div>

Yes, it was suggested to have my background color styles in the project and use them throughout.Thx, jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 8:07pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/11 "2020-11-24T20:07:21Z")

</div>

Yeah, definitely. I have all of my colours in a custom css theme which I then reference the variables from my Perspective Styles. Using a CSS theme will then allow you to easily create alternate theme such as light, dark, colourblind, high-contrast, etc. in the future. Have a read of the readme.md inside the theme folder in the ignition data directory:  
`C:\Program Files\Inductive Automation\Ignition\data\modules\com.inductiveautomation.perspective\themes`  
You can reference css variables with: `var(--<VARIABLE_NAME>)` for example: `var(--neutral-20)` which is part of the light theme. You can use this in any property’s value, but obviously if it’s a colour, it won’t make sense to use in a non-colour property… You can put anything into a variable though, such as widths for certain things like standardised margins between certain components:  
`--cmp-margin: 5px;`

Using these inside Perspective Styles then lets you standardise the look and feel of your various ui elements instead of having to reference a number of css variables and other css styling for each component.

When applying P.styles to components, you just add them as a space-separated list into the relevant styles.classes property

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 8:14pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/12 "2020-11-24T20:14:57Z")

</div>

So session events there’s a Styles tree, do I just use the style names in there like status\_red, or do i need to use Styles.status\_red. Figured it would be similiar to calling script functions.Thx, Jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 8:21pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/13 "2020-11-24T20:21:01Z")

</div>

You can right click on a style and copy the path to the style. I'd recommend using a folder structure, so you might have paths like: `Devices/States/Running` as a style path

 ![Style classes example](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/8/1871da24e557b2ee25fbde9f1b6a1191942ed020.gif)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/2/62ae2b7bd4284e946493f4a42f643705ab8a77c7.png)

Also, I updated my post above RE UDT instance enable:

> [@nminchin](#):
>
> You can check if a UDT instance (or tag for that matter) is enabled by reading the “enabled” property:
> 
> ```auto
> tagPath = 'path/to/UDTInstance'
> t = system.tag.readBlocking([tagPath + '.enabled'])[0].value
> print t
> >>true or false
> 
> ```

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 8:47pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/14 "2020-11-24T20:47:20Z")

</div>

Perfect, also, will the dataset in a table accept objects?Thx, jake

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 8:50pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/15 "2020-11-24T20:50:54Z")

</div>

Objects? As in embedded views? Yes… Although it’s not quite that straight forward

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 8:51pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/16 "2020-11-24T20:51:51Z")

</div>

like json, so it would have the value and style in it

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 24, 2020, 8:54pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/17 "2020-11-24T20:54:07Z")

</div>

Ah, yes. See the example in the data property

[https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Table](https://docs.inductiveautomation.com/display/DOC80/Perspective+-+Table)

---

<div class="post-metadata">

**Author:** ![codersmurf](https://avatars.discourse-cdn.com/v4/letter/c/df788c/32.png) [@codersmurf](https://forum.inductiveautomation.com/u/codersmurf)\
**Post date:** [November 24, 2020, 8:54pm UTC](https://forum.inductiveautomation.com/t/therere-a-few-functions-lacking-in-8-1-from-7-8-5-what-are-ways-to-get-the-same-thing/40929/18 "2020-11-24T20:54:49Z")

</div>

awesome, thank you so much.
