# Sound Player Optimization

**URL:** <https://forum.inductiveautomation.com/t/sound-player-optimization/110129>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [August 22, 2025, 10:59pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129 "2025-08-22T22:59:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carter.doud](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@carter.doud](https://forum.inductiveautomation.com/u/carter.doud)\
**Post date:** [August 22, 2025, 10:59pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/1 "2025-08-22T22:59:42Z")

</div>

I am working on getting 2 different sound players to play when a certain value is passed. right now, to pull this value, I need to reference 100 different tags to see if any of those tags have a certain value, if they do, pass one value, if not, pass another. I was thinking to use an expression tag, but not sure how to do wildcards inside of a tag path or if that is even possible. Any thoughts?

---

<div class="post-metadata">

**Author:** ![robertm](https://avatars.discourse-cdn.com/v4/letter/r/ea5d25/32.png) [@robertm](https://forum.inductiveautomation.com/u/robertm)\
**Post date:** [August 23, 2025, 2:17pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/2 "2025-08-23T14:17:44Z")

</div>

Not sure it's the best way, but I'd use system.tag.browse to get a tag list, then read the result with system.tag.readBlocking, then use a for tags in tagvalues type loop to find a true value.

> **[system.tag.browse | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-browse?utm_term=&utm_campaign=002%2BIgnition%2BPerformance%2BMax&utm_source=adwords&utm_medium=ppc&hsa_acc=1942977828&hsa_cam=19829025962&hsa_grp=&hsa_ad=&hsa_src=x&hsa_tgt=&hsa_kw=&hsa_mt=&hsa_net=adwords&hsa_ver=3&gad_source=1&gad_campaignid=21210041500&gbraid=0AAAAAD-80zjyfq3BkWvaYHdI0h9ZrXN_D&gclid=Cj0KCQjwzaXFBhDlARIsAFPv-u9kDzGewHutghTZMd7YafkokWQMRO685d737uNoayd3erpw-h9xx5EaAkrmEALw_wcB)**
>
> Returns a list of nodes found at the specified path.

> **[system.tag.readBlocking | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-tag/system-tag-readBlocking?utm_term=&utm_campaign=002%2BIgnition%2BPerformance%2BMax&utm_source=adwords&utm_medium=ppc&hsa_acc=1942977828&hsa_cam=19829025962&hsa_grp=&hsa_ad=&hsa_src=x&hsa_tgt=&hsa_kw=&hsa_mt=&hsa_net=adwords&hsa_ver=3&gad_source=1&gad_campaignid=21210041500&gbraid=0AAAAAD-80zjyfq3BkWvaYHdI0h9ZrXN_D&gclid=Cj0KCQjwzaXFBhDlARIsAFPv-u_VjNRXU2YuNEOo8x3l9B5-1UagWW2eTC1Pbi7eEVoKbbnfY9opaOwaAqa8EALw_wcB)**
>
> Reads the value of the tags at the given paths.

---

<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 23, 2025, 4:06pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/3 "2025-08-23T16:06:27Z")

</div>

> [@carter.doud](#):
>
> I need to reference 100 different tags to see if any of those tags have a certain value

I assume that you already know the tag paths of these, and given that you are wanting to use wild cards, that suggests that they have similar enough paths that they can be enumerated.

A few vialble options that I see.

1. Use a vision client tag change event. This would run in each client independently, and can reference vision client tags.
2. Use a timer to run a script which examines the list of tags to determine if any of their values match.
3. If you can, perhpas Phil’s Integration Toolkit Module would allow you to do this work in a couple of expressions with the iterators provided by that module. Maybe not, though, as I would suspect that Phil has already read this and didn’t have any suggestions.

FWIW, I’m thinking of a script something like:

```python
parentPath = '[default]someParentPath'
folder = 'someSharedFolder'
readPaths = ['tagPath1','tagPath2',...,'tagPath100']
paths = ['{}/{}/{}'.format(parentPath,folder1,tagPath) for tagPath in readPaths]

for qv in system.tag.readBlocking(paths):
    if qv.value == 'yourTriggerValue':
        #trigger sound player
        return 'value to play sound'

```

Ideally the list of paths would be written as a top level variable in a project library script so it is only processed once. Then the for loop would be in a project library function, Say

`def checkForAlarm():` Then where you want to call, this script you would simply just call that function returning the value to play the sound.

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [August 24, 2025, 12:13am UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/4 "2025-08-24T00:13:53Z")

</div>

I've been using `system.tag.query` for requirements like this, which can return values & desired properties of all tags matched for quick comparison thereafter (via `any(…)` or `all(…)`, etc ). Script can be generated using Tag Report Tool.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 24, 2025, 3:42pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/5 "2025-08-24T15:42:29Z")

</div>

> [@lrose](#):
>
> Phil has already read this and didn’t have any suggestions.

The wildcards put me off. If the tag list is constant, my `tags()` function plus some iteration would handle this.

---

<div class="post-metadata">

**Author:** ![carter.doud](https://avatars.discourse-cdn.com/v4/letter/c/ed8c4c/32.png) [@carter.doud](https://forum.inductiveautomation.com/u/carter.doud)\
**Post date:** [August 25, 2025, 3:47pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/6 "2025-08-25T15:47:48Z")

</div>

Thank you all for your replies, wasn’t expecting anything over the weekend. I am working on trying to make it into a project library script, but I can’t figure out a couple issues. I got the script working and I have it in a client timer event right now. I would prefer it to be on a tag change event, but do I need to manually insert all 100 tags in the tag change tag paths, or is there a way to include wildcards and or iteration, or even a scripting variable in that window?

---

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [August 25, 2025, 4:20pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/7 "2025-08-25T16:20:04Z")

</div>

Gateway tag change events allow wildcards at the folder level when defining tags to monitor. You can always do further filtering in your actual script to only run logic when the wanted tags change.

> **[Gateway Event Scripts | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/scripting/scripting-in-ignition/gateway-event-scripts#tag-change-scripts)**
>
> Gateway Event Scripts Overview

---

<div class="post-metadata">

**Author:** ![Chris\_Bingham](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@Chris\_Bingham](https://forum.inductiveautomation.com/u/Chris_Bingham)\
**Post date:** [August 25, 2025, 11:29pm UTC](https://forum.inductiveautomation.com/t/sound-player-optimization/110129/8 "2025-08-25T23:29:13Z")

</div>

> [@carter.doud](#):
>
> is there a way to include wildcards and or iteration

If your list of tags will never change, it might be best to hard-code them. If this list will change in future, make the tag paths more dynamic.

Can you share an example of a few of your tag paths? What kind of wildcard search do you believe would capture _only_ the desired tags?
