# Writing to plc tag using a udt and custom property

**URL:** <https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 22, 2023, 4:14pm UTC](https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823 "2023-10-22T16:14:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_Coughlin](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Steve\_Coughlin](https://forum.inductiveautomation.com/u/Steve_Coughlin)\
**Post date:** [October 22, 2023, 4:14pm UTC](https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823/1 "2023-10-22T16:14:45Z")

</div>

Hello,

I have perspective project where I am writing to a plc tag which writes to a laser marker block. I recently have switched my tags to udts to help with scalability.

However, when I use a custom property to write a machineID based on device IP it doesn’t seem to write. I believe my issue is that I need to output the tagpath as a string?? See image below.

Thanks for any help!

 ![IMG_6676](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef36a40b9fb8603a7fed8aba7063ea4094748e5a.jpeg)

---

<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:** [October 22, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823/2 "2023-10-22T16:20:45Z")

</div>

Hi Steve,

You've double nested your list of tag paths. Instead of a list of (one) strings, you have a list of a list of one string.

In the future, don't post screenshots of code, except perhaps to show editor context. Instead, use a code block:

> [@Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831):
>
> This thread is intended as a short help file for all those struggling to post formatted code on the forum. Posting formatted code on the forum (and most others) is as simple as selecting the code and pressing the \</\> button. It works the same as applying Bold or Italic styles to your document. It preserves indentation and applies syntax highlighting. [How to post code]

---

<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:** [October 22, 2023, 7:15pm UTC](https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823/3 "2023-10-22T19:15:05Z")

</div>

> [@pturmel](#):
>
> except perhaps to show editor context

And if you do, make sure compression is low for jpgs, or just use a compressionless format like PNG (_far_ superior to jpg for screenshots)

---

<div class="post-metadata">

**Author:** ![Steve\_Coughlin](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Steve\_Coughlin](https://forum.inductiveautomation.com/u/Steve_Coughlin)\
**Post date:** [October 23, 2023, 2:32pm UTC](https://forum.inductiveautomation.com/t/writing-to-plc-tag-using-a-udt-and-custom-property/80823/4 "2023-10-23T14:32:42Z")

</div>

Thanks for the help, this solved my issue! Here's the updated code below in the correct format (I think) 🙂

```auto
tagPath = "[default]Keyence Laser Marker MD-X2000/" + self.session.custom.IP_MachineID + "/Trigger"

system.tag.writeBlocking([tagPath],[1])

```
