# How to write values to UDT parameters?

**URL:** <https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124>\
**Category:** Ignition\
**Tags:** scripting, ignition81, perspective\
**Created:** [March 3, 2025, 9:21am UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124 "2025-03-03T09:21:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ali\_Paridari](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ali\_Paridari](https://forum.inductiveautomation.com/u/Ali_Paridari)\
**Post date:** [March 3, 2025, 9:21am UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/1 "2025-03-03T09:21:12Z")

</div>

I am trying to write on my UDT instances parameters for a logic I am developing I used these two functions:

```python
path = "[Default]Alarms/myTag/Parameters.HH"
# 1
system.tag.writeAsync([path], [1234])
# 2
system.tag.writeBlocking([path], [1234])

```

But neither one updates the `HH` parameter for `myTag` UDT instance.  
How should i do this?

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 3, 2025, 3:27pm UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/2 "2025-03-03T15:27:14Z")

</div>

That should work. Where are you running this script from? If you're using this in scripts called from tag value changes, you'll need to make sure you've set the Gateway Scripting Project to the project where these scripts exist or else they won't work.

If running/testing from the designer, you'll need to make sure you're in R/W mode and not just read only mode.

---

<div class="post-metadata">

**Author:** ![Ali\_Paridari](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ali\_Paridari](https://forum.inductiveautomation.com/u/Ali_Paridari)\
**Post date:** [March 4, 2025, 6:52am UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/3 "2025-03-04T06:52:16Z")

</div>

I am running these scripts in a view that is designed to config the UDT parameters with user input.

I dont understand your solution exactly. Can you elaborate more specifically of the steps to check/do?

---

<div class="post-metadata">

**Author:** ![Ali\_Paridari](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ali\_Paridari](https://forum.inductiveautomation.com/u/Ali_Paridari)\
**Post date:** [March 4, 2025, 11:51am UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/4 "2025-03-04T11:51:20Z")

</div>

I found out what you mean by read/write comm and applied your solution. Still not working.

---

<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:** [March 4, 2025, 1:03pm UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/5 "2025-03-04T13:03:25Z")

</div>

Can you show us the UDT definition ?  
Also, can you try logging the return of the call to `readBlocking` ? It should give you clues on what is not working.

---

<div class="post-metadata">

**Author:** ![michael.flagler](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/michael.flagler/32/26272_2.png) [@michael.flagler](https://forum.inductiveautomation.com/u/michael.flagler)\
**Post date:** [March 4, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/6 "2025-03-04T13:42:03Z")

</div>

Even as a first sanity check, try using your script above in the scripting console and see if it works there.

---

<div class="post-metadata">

**Author:** ![Ali\_Paridari](https://avatars.discourse-cdn.com/v4/letter/a/5fc32e/32.png) [@Ali\_Paridari](https://forum.inductiveautomation.com/u/Ali_Paridari)\
**Post date:** [March 5, 2025, 2:36pm UTC](https://forum.inductiveautomation.com/t/how-to-write-values-to-udt-parameters/103124/7 "2025-03-05T14:36:35Z")

</div>

There was a problem with my addressing. Thank you for pointing that out
